Win2K Kernel Drivers

Hi all,

I am working on a Kernel Driver for Win2k. & have the following prob.

==> Is there any way by which my application can request my driver to
allocate some memory(say a PAGE) in KERNEL SPACE & then map it to the
application space ???.. I mean the applicn can communicate by
IOCTLs…fine, but is there any mechanism by which the driver can allocate
some memory & map it to the calling application’s space…

Please help me out of this…

SP.

Use IRP’s MDLAddress … If u set the flag to DIRECT_IO … its done
automatically for you … the applications user address is mapped to the
upper 2 gb kernel space which you can access thru the memory descriptor list
…The IRP holds the MDL structure, already set up by the I/O Manager in
case DO_DIRECT_IO flag is set.

–Arup

-----Original Message-----
From: Shailesh [mailto:xxxxx@hotmail.com]
Sent: Tuesday, April 02, 2002 3:38 PM
To: NT Developers Interest List
Subject: [ntdev] Win2K Kernel Drivers

Hi all,

I am working on a Kernel Driver for Win2k. & have the following prob.

==> Is there any way by which my application can request my driver to
allocate some memory(say a PAGE) in KERNEL SPACE & then map it to the
application space ???.. I mean the applicn can communicate by
IOCTLs…fine, but is there any mechanism by which the driver can allocate
some memory & map it to the calling application’s space…

Please help me out of this…

SP.


You are currently subscribed to ntdev as: xxxxx@quark.co.in
To unsubscribe send a blank email to %%email.unsub%%

Yes sure, this has been covered many times here. Search the list.
Generally though, the motivation for doing this is rather suspect.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shailesh
Sent: Tuesday, April 02, 2002 5:08 AM
To: NT Developers Interest List
Subject: [ntdev] Win2K Kernel Drivers

Hi all,

I am working on a Kernel Driver for Win2k. & have the following prob.

==> Is there any way by which my application can request my
driver to allocate some memory(say a PAGE) in KERNEL SPACE &
then map it to the application space ???.. I mean the applicn
can communicate by IOCTLs…fine, but is there any mechanism
by which the driver can allocate some memory & map it to the
calling application’s space…

Please help me out of this…

SP.


You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
%%email.unsub%%

MmMapLockedPages(…UserMode…)
Do not forget to unmap it on CLEANUP path - or the OS will bugcheck PROCESS_HAS_LOCKED_PAGES on process exit.

Max

----- Original Message -----
From: “Shailesh”
To: “NT Developers Interest List”
Sent: Tuesday, April 02, 2002 2:07 PM
Subject: [ntdev] Win2K Kernel Drivers

> Hi all,
>
> I am working on a Kernel Driver for Win2k. & have the following prob.
>
> ==> Is there any way by which my application can request my driver to
> allocate some memory(say a PAGE) in KERNEL SPACE & then map it to the
> application space ???.. I mean the applicn can communicate by
> IOCTLs…fine, but is there any mechanism by which the driver can allocate
> some memory & map it to the calling application’s space…
>
> Please help me out of this…
>
> SP.
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>

hi ,

thanx a lot …
now what I understand is I can allocate mem… then initialse a pre -
allocated mdl structure(with mmprobeandlockpages) & use it with
mmmaplockedpages(with user mode). Please point out if I am wrong…

But now the virtual addr I get from mmprobeandlockpages, can it be used in
my driver also ???

The entire sequence of calls is really not clear to me… plz can someone
let me know the same…

thanx once again

SP

hi ,

thanx a lot …
now what I understand is I can allocate mem… then initialse a pre -
allocated mdl structure(with mmprobeandlockpages) & use it with
mmmaplockedpages(with user mode). Please point out if I am wrong…

But my mmprobeandlockpages fails !! probably there’s something more I must
do…
The entire sequence of calls is really not clear to me… plz can someone
let me know the same…

thanx once again

SP