Many posts have talked about this topic, but I still have some questions.
A normal solution to share buffer between driver and application is,
1. application allocates a buffer,
2. pass the buffer pointer to driver by an IOCTL.
3. driver calls ProbeForWrite to probe the buffer, creates an MDL for that
buffer and calls MmProbeAndLockPages to lock pages, then calls
MmGetSystemAddressForMdlSafe to get a system-space virtual address.
After calling MmProbeAndLockPages() and MmGetSystemAddressForMdlSafe(),
driver gets a nonpaged buffer pointer and buffer occupies physical memory.
That is not what I wanted. In my case, a driver thread runs always at
PASSIVE_LEVEL and it needs to manipulate many massive buffers allocated by
an application. If they are all commited to nonpaged buffer, memory resource
may runs out. Can I get a page-able system-space virtual adress which memory
is shared with application?