Tech Support > Microsoft Windows > Drivers > Re: User mode space accessing kernel mode space
Re: User mode space accessing kernel mode space
Posted by Don Burn on July 23rd, 2004


The problem here is though you can do it, you will need someway to
synchronize access so the user mode code isn't modifying it when the kernel
is checking it. This will require a kernel call which blows any performance
advantage you might get with this design. Also, it can dependiing on how
you do it open a security hole.

Just use an IOCTL to set the structure or query the structure, you are
looking to a lot of work for a dangerous implementation, that will not buy
you anything.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Ben Geib" <BenGeib@discussions.microsoft.com> wrote in message
news:18FE62B1-4D4C-44E1-9AFD-D50BC95C59F7@microsoft.com...
information which will be applied upon an IOCTL call. The users application
will need to be able to access/modify this structure. Is there a way I can
map the kernel space containing the structure into user space so that the
application can access/modify it directly? Thank you for your time.



Posted by Don Burn on July 23rd, 2004


It is complicated you are going to have to map memory, be sure to unmap
memory, handle process termination and a lot of other things. Then in the
end you will still be calling an IOCTL. So don't do it, just call the ioctl
and have it take a parameter of the structure.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

"Ben Geib" <BenGeib@discussions.microsoft.com> wrote in message
news:0B2D4991-CC61-458A-9588-ADD9A483EFF7@microsoft.com...
IOCTL call which then applies the settings. What is the way that you know
of that enables this? Thank you for your time.


Posted by Maxim S. Shatskih on July 23rd, 2004


Usual IOCTL. Pass the structure as InputBuffer, it will be accessible in
the driver as Irp->AssociatedIrp.SystemBuffer (as a copy).

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Ben Geib" <BenGeib@discussions.microsoft.com> wrote in message
news:0B2D4991-CC61-458A-9588-ADD9A483EFF7@microsoft.com...
IOCTL call which then applies the settings. What is the way that you know of
that enables this? Thank you for your time.