Re: WDF memory object operation between bus and child driver
- From: "Doron Holan [MSFT]" <doron.holan@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Sep 2009 10:48:03 -0700
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
- Follow-Ups:
- References:
- WDF memory object operation between bus and child driver
- From: Ziv
- Re: WDF memory object operation between bus and child driver
- From: Maxim S. Shatskih
- Re: WDF memory object operation between bus and child driver
- From: Ziv
- WDF memory object operation between bus and child driver
- Prev by Date: Re: Read USB Multiple Configurations
- Next by Date: Re: How to reduce the thread priority
- Previous by thread: Re: WDF memory object operation between bus and child driver
- Next by thread: Re: WDF memory object operation between bus and child driver
- Index(es):
Relevant Pages
|
Loading