WDF-newbie: Sharing memory between application and driver?



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)
  • Re: Real World Significant Sources of (what we usually call) Latency
    ... CPU is twice as fast, you can reduce your buffer size to half." ... the buffer adjustment for the driver or DAW program would go down to zero. ... nothing that can distract it from processing audio. ...
    (rec.audio.pro)

Loading