There is no entirely squeaky-clean way to map the physical pages
described by kernel memory into the address of a user-mode process
(which will save you a memory copy), but if you want to take a shot at
it check out the OSR article linked below. The other direction
(user->kernel) is highly optimized, just not the reverse commute. 
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of sxw
Sent: Tuesday, June 10, 2003 11:15 PM
To: NT Developers Interest List
Subject: [ntdev] newbie question: memory sharing between Kernel-user
mode
Hi,
My kernel mode driver receive buffer during IRP_MJ_READ/WRITE, and this
buffer is needed to be transfered to an user mode process to do some
checks, can I transfer the buffer pointer(or MDL) directly back to that
user mode process?
If it can't work, the only way I know at this time is to allocate a new
buffer in kernel mode and do copies and then transfer the handle of
that section to user mode, it looks a little stupid , right?
Thanks
-sxw
You are currently subscribed to ntdev as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Thanks, Nick.
That article is very helpful, but there’s no current process context
available for my case, I’m not sure whether the ReadProcessMemory and
WriteProcessMemory work for this case. Because I have no more time left on
this problem, I’ll use an additional buffer for that.
-sxw
“Nick Ryan” ???:xxxxx@ntdev…
>
> There is no entirely squeaky-clean way to map the physical pages
> described by kernel memory into the address of a user-mode process
> (which will save you a memory copy), but if you want to take a shot at
> it check out the OSR article linked below. The other direction
> (user->kernel) is highly optimized, just not the reverse commute. 
>
> http://www.osronline.com/article.cfm?id=39
>
> - Nick Ryan
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of sxw
> Sent: Tuesday, June 10, 2003 11:15 PM
> To: NT Developers Interest List
> Subject: [ntdev] newbie question: memory sharing between Kernel-user
> mode
>
>
> Hi,
>
> My kernel mode driver receive buffer during IRP_MJ_READ/WRITE, and this
> buffer is needed to be transfered to an user mode process to do some
> checks, can I transfer the buffer pointer(or MDL) directly back to that
> user mode process?
>
> If it can’t work, the only way I know at this time is to allocate a new
> buffer in kernel mode and do copies and then transfer the handle of
> that section to user mode, it looks a little stupid , right?
>
> Thanks
>
> -sxw
>
> —
> You are currently subscribed to ntdev as: xxxxx@nryan.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@nryan.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>