Re: WDF-newbie: Sharing memory between application and driver?



in addition to all of the other suggestions given you to, you must do
thelocking in your EvtIoInCallerContext callback which is guaranteed to be
in the right context. YOur EvtIoDeviceIoControl routine can be called in
any arbitrary context

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Joerg Hoppe" <jhoppe@xxxxxxxxxxxxxxxx> wrote in message
news:OxiLxjuOHHA.4604@xxxxxxxxxxxxxxxxxxxxxxx
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
    ... As soon as device reaches the end of the buffer ... Sure, I am developing both PCI adapter and device driver, so, it is ... not afford reinitializing DMA on my device after every transfer. ... x86 CPU memory management structures I never tried to dig into Windows ...
    (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? ... 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)