WdfRequestRequeue

Hi,

Just to confirm, WdfRequestRequeue requeues back to the head of the queue, not the tail, correct?

Thanks,
HL

From the WDK Docs:

The WdfRequestRequeue method returns an I/O request to the head of the I/O queue from which it was delivered to the driver.

Are you having a specific problem, or just… you know… curious?

Peter
OSR

Hi Peter

I have a piece of code that depends on retrieving a request from a queue, passing its buffer to a user mode application and requeue it for later retrieval. The assumption I make is a later retrieval from the queue should return the same request. That’s why I need to make sure puts back the request in the head of the queue.

Thanks,
HL

>I have a piece of code that depends on retrieving a request from a queue, passing its buffer to a user mode application

Just to clarify, it sounds like you want application A to make a read/write/ioctl request to the driver, and then you want to map that buffer to be visible in application B?

Jan

Same application does one read through an IOCTL followed by another write IOCTL. Second write should retrieve the same WdfRequest as the one returned through the read phase.

Are you relying on the app not to send two reads in a row without an intervening write? IE to be well behaved? If you are, that is a pretty bad idea. Instead of assuming the request you need to pull of is at the head, the subsequent ioctl which retrieve the request should provide an id cookie that you provide when you complete the initial read ioctl.

d


From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] on behalf of xxxxx@gmail.com [xxxxx@gmail.com]
Sent: Saturday, February 09, 2013 2:26 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WdfRequestRequeue

Same application does one read through an IOCTL followed by another write IOCTL. Second write should retrieve the same WdfRequest as the one returned through the read phase.


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

Yes, but the application is written in a way that WRITE always follows READ, i.e. cannot do multiple reads without an intervening WRITE. Do you see a way this can fail?

A driver must always be defensive and never assume a well behaving app. Imagine if a different app was running that is trying to make your driver do bad/wrong things. You can’t assume the app is well behaved and the state is correct without verification at runtime

d


From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] on behalf of xxxxx@gmail.com [xxxxx@gmail.com]
Sent: Saturday, February 09, 2013 5:35 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WdfRequestRequeue

Yes, but the application is written in a way that WRITE always follows READ, i.e. cannot do multiple reads without an intervening WRITE. Do you see a way this can fail?


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