Re: WDF memory object operation between bus and child driver



both designs are awful. you can use a WDFMEMORY to format a WDFREQUEST, but you cannot pass the handle value itself down to the lower stack.

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"Ziv" <zivhuang@xxxxxxxxx> wrote in message news:1c4483bf-8879-4c92-98ef-68f7f450bffb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for your comment. ^_^

There are two scenarios in my crazy idea.

1st:
1. Upper driver (child) issue a request to its bus driver.
2. Bus driver allocate WDF memory (WdfMemoryCreate) and record the
memory handler on the buffer of child's request.
3. Child hadle the memory object in its completion routine and free
the memory object by calling WdfObjectDelete.

2nd:
1. Upper driver (child) issue a request to its bus driver.
2. Bus driver allocate WDF memory and record the memory handler on the
buffer of child's request.
3. Bus driver add reference for this memory object and free this
memory object immediately.
4. Child hadle the memory object in its completion routine and
decrease the reference of memory object.

Is there any side effect for those designs or those totally are bad
ideas?

Thanks for any comment. ^_^

Ziv


On 9月10日, 下午4時45分, "Maxim S. Shatskih"
<ma...@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Can I allocate WDF memory object from the bus driver and pass the
> memory handle to the child.

I think that no WDF object can cross the driver boundary.

Allocate the usual memory by ExAllocatePoolWithTag instead.

And yes, the cleaner design is the lower driver to return the memory back to the upper, and the upper will free it.

--
Maxim S. Shatskih
Windows DDK MVP
ma...@xxxxxxxxxxxxxxxxxxxx://www.storagecraft.com

.



Relevant Pages

  • Re: Anybody have an Idea on this ?
    ... What other reports appear in the System and Application logs in Event Viewer ... "With 3 memory modules the Dual Channel Memory Technology is not activated." ... Bus Driver wrote: ... kernel-mode process or driver tried to access a memory location to ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: WDF memory object operation between bus and child driver
    ... Upper driver (child) issue a request to its bus driver. ... Bus driver allocate WDF memory and record the ... Child hadle the memory object in its completion routine and free ...
    (microsoft.public.development.device.drivers)
  • Re: About SD interface in WinCE 5.0
    ... The one is for SD memory and the another is for SDIO-type WLAN module. ... As long as I know, After a SD device is inserted, the bus driver ... This operation is initiated by the SD card insertion. ...
    (microsoft.public.windowsce.platbuilder)
  • About SD interface in WinCE 5.0
    ... The one is for SD memory and the another is for SDIO-type WLAN module. ... As long as I know, After a SD device is inserted, the bus driver ... This operation is initiated by the SD card insertion. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: WDF memory object operation between bus and child driver
    ... And I intend to avoid to copy data from bus driver to child in order ... (I believe that child allocate request with memory object and send ... request to its bus driver. ...
    (microsoft.public.development.device.drivers)

Loading