I have a KMDF driver that sets the IO type to Direct and uses
WdfRequestRetrieve(Output/Input)Buffer call inside EvtIoRead/EvtIoWrite to
get a pointer to the request buffer. This works fine. However, if I switch
the device IO type to Buffered, then the WdfRequestRetrieveX functions return
SUCCESS status, yet set the buffer pointer to NULL. I don't see any
explanation for this in the documentation, as these functions are supposed to
work identically regardless for both Direct and Buffered IO type;
furthermore, I imagine that a buffer retrieval problem would be indicated by
the returned status.

Any ideas?

Re: KMDF Buffered vs Direct IO by Eliyas

Eliyas
Wed Aug 29 10:02:58 CDT 2007

I need some proof. First turn on framework verifier for your driver and set
the tracing level to verbose and restart your driver.

http://msdn2.microsoft.com/en-us/library/aa938992.aspx
http://msdn2.microsoft.com/en-us/library/aa490042.aspx

Set a breakpoint on EvtIoRead or Write dispatch routine. When you hit that,
dump the WDFREQUEST object as shown below:

kd>!wdfrequest <WDFREQUEST handle>

This will show the pointer to the irp. Dump that using

kd>!irp <address> 2

Now step thru the code and right after you call the retrieve functions, dump
the framework logdump.

kd>!wdfttmffile <point to the wdf01000.tmf file in the WDK>

kd>!wdflogdump <drivername>


Post the results here.

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