Read request buffer

Hi all,
I have a question about buffers in a WDF driver when a client application calls ReadFile. I've seen in other posts that IOCTLs' out buffer can be used in either direction. Does that happen to be the case for reads as well? Specifically, we have a wdf driver using buffered IO and trying to find a synchronization bug between software, driver, and the hardware. If we allocate a buffer in the client application, write some value in the first index of the buffer and call ReadFile, are we guaranteed that the output buffer attached to the corresponding WDF request (in the driver's EvtIoRead method) contain that value (before we overwrite the data)? Thanks

If you are configured to use direct I/O, then the ReadFile buffer is mapped into kernel space, and you can read whatever is in there. If you are using buffered I/O, then that isn't the case.

Partly because of that, I'd call that a design flaw. If you need an input and an output buffer, then use DeviceIoControl.