METHOD_BUFFERED - WdfRequestTypeRead.WdfRequestRetrieveOutputBuffer contents contents

Hi

I am doing some simulation work (so upper layer stack can finish implementation as well) in the driver as the FW client is not yet ready.
This driver has many clients sitting on top of it. I am one of the client.

(My communication is synchronous,

During WdfRequestTypeWrite, I check InBuffer and trap if it is my msg.

When I receive a WdfRequestTypeRead, I want to do a) below
a) if the message is of my FW interest, I pend that in a manual queue.
b) Then I complete above, when the app sends a trigger (ICOTL with the actual data in InBuffer to be returned) to satisfy the above read

So for convenience I used the same IOCTL.InBuffer as Read.OutBuffer!
Is there anyway (I can get to the Virt Addr space of the user buffer :slight_smile: or make I/O mgr copy the contents of that Read.User.OutBuffer when it creates it own copy to be included in the IRP.

Else which is best way to achieve this?
Right now I am just trapping based on the OutBufferSize. But eventually I can have different OutBufferSizes and in somecases we do not know the actual OuBufferSize (like Async FW notifications etc - FW found n devices that I subscribed and following is their capabilities/info etc). Again all this is for Simulation purposes to aid upper level stack implementtion, until FW is ready.

Thx.

There is no flag to copy the buffet before sending the read. The solution is not to use read at all, rather a new ioctl that has both input and output buffers

d

Bent from my phone


From: xxxxx@yahoo.commailto:xxxxx
Sent: ?5/?1/?2013 8:05 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] METHOD_BUFFERED - WdfRequestTypeRead.WdfRequestRetrieveOutputBuffer contents contents

Hi

I am doing some simulation work (so upper layer stack can finish implementation as well) in the driver as the FW client is not yet ready.
This driver has many clients sitting on top of it. I am one of the client.

(My communication is synchronous,

During WdfRequestTypeWrite, I check InBuffer and trap if it is my msg.

When I receive a WdfRequestTypeRead, I want to do a) below
a) if the message is of my FW interest, I pend that in a manual queue.
b) Then I complete above, when the app sends a trigger (ICOTL with the actual data in InBuffer to be returned) to satisfy the above read

So for convenience I used the same IOCTL.InBuffer as Read.OutBuffer!
Is there anyway (I can get to the Virt Addr space of the user buffer :slight_smile: or make I/O mgr copy the contents of that Read.User.OutBuffer when it creates it own copy to be included in the IRP.

Else which is best way to achieve this?
Right now I am just trapping based on the OutBufferSize. But eventually I can have different OutBufferSizes and in somecases we do not know the actual OuBufferSize (like Async FW notifications etc - FW found n devices that I subscribed and following is their capabilities/info etc). Again all this is for Simulation purposes to aid upper level stack implementtion, until FW is ready.

Thx.


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

As Doron said, no.

But you CAN copy the contents of the IOCTL’s InBuffer to the Read’s OutBuffer using memcpy, right? It really is that simple. WdfRequestRetrieveInputBuffer and WdfRequestRetrieveOutputBuffer, get the min() of the two buffer lengths, and memcpy In to Out… done!

Peter
OSR

Yes I am already doing that before I posted the question.

Wanted to know if I can trap my READs (the same way I do my WRITES), w/o making this driver/effort (which is for simulation only) too stateful.