WDF-newbie: Sharing memory between application and driver?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm porting an old driver from Compuware Driver::Works to WDF.
I need to share memory between application and my driver.

Problem 1:
My application manages larges buffers. The driver should read/write
data to the application buffer directly. No FileRead/FileWrite ... data access is not sequentiell.

So I pass a buffer pointer to the driver via an IoCtl.
How do I lock/map this buffer so the driver can access it savely?

Problem 2:
My driver allocates kernel memory with ExAllocatePoolWithTag.
The Application issues an IoCtl and wants to receive a pointer to the memory.
How do I map the result of WdfMemoryGetBuffer to user process space?


Any Wdf-Examples would be helpful.


Thanks
.



Relevant Pages

  • Re: PCI bus-master and large contiguous memory buffers
    ... x86 CPU memory management structures I never tried to dig into Windows ... What about buffer consistency in the long run? ... The scattergather list methods provide a vastly simplified mechanism ... CD-ROM driver may keep the system for seconds at elevated IRQL levels, ...
    (microsoft.public.development.device.drivers)
  • Re: PCI bus-master and large contiguous memory buffers
    ... I built my scatter gather list in SRAM that was on my device, ... could have done it in system memory had I needed to. ... interrupt when a buffer was filled, the application would save the buffer to ... beginning of the recording I made a device IO control call to my driver. ...
    (microsoft.public.development.device.drivers)
  • Re: PCI bus-master and large contiguous memory buffers
    ... x86 CPU memory management structures I never tried to dig into Windows ... What about buffer consistency in the long run? ... CD-ROM driver may keep the system for seconds at elevated IRQL levels, ... addresses of physical pages of memory, from which the user buffer ...
    (microsoft.public.development.device.drivers)
  • PCI bus-master and large contiguous memory buffers
    ... large 32MB contiguous memory buffer, which is a big problem in modern ... After getting these data from device driver needs to perform some ... buffer while OS not yet managed to invoke my DPC for ISR. ... addresses of physical pages of memory, from which the user buffer ...
    (microsoft.public.development.device.drivers)
  • [PATCH 1/1] hv: Added new hv_utils driver with shutdown as first functionality - NO OUTLOOK
    ... Addition of new driver for Hyper-V called hv_utils. ... * VmbusChannelSendPacket- Send the specified buffer on the given channel ... struct vmbus_channel *channel; ...
    (Linux-Kernel)