Requeuing of requests is not working?

I am working on selective suspend. In which i want to re queue all read requests which
were canceled when device was leaving working state.So i am using one queue for all
canceled read requests whose dispatch type is manual.In completion routine of read request
i am re queuing all those canceled read requests.
And when device resumes its working state i am trying to send those re queued requests back to target.
But problem is that when i call WdfIoQueueRetrieveNextRequest its not returning with success status i am getting 0xc0200203 (which i did not find in ntstatus.h), though i got success for WdfRequestForwardToIoQueue at the time of re queuing the request.

Can any one tell me why is this happening?
Regards,
Amit.

From: Ten Things You Need To Know About KMDF (http://www.osronline.com/article.cfm?article=496)

“Strange NTSTATUS Values Returned From KMDF Functions
A very common question that we get in our KMDF seminar is “Help! The NTSTATUS value I got back from calling a KMDF function isn’t listed in NTSTATUS.H!” Well, yeaaaahhhh. If you get a status value that starts with 0xC020xxxx, it’s a custom WDF status value. Look in the WDK’s \inc\wdf\kmdf\10\wdfstatus.h for the definitions of the WDF status values. Problem solved!”

Then do !WDFKD.WDFLOGDUMP in the debugger.

Between the two of these, it should get you all the data you need,

Peter
OSR

Peter
OSR

Hi Peter,
Thanks for your prompt reply. I will do it and let you know.
Regards,
Amit

Hi Peter

As you said i checked 0xc0200203 status code in wdfstatus.h which says 0xc0200203 means STATUS_WDF_PAUSED. This was happening as my manual queue was power managed.So i made it non powermanaged now that problem is solved.But now i am facing other problem.
1.Actually i am using collector object to store all sent read requests(in flight read requests).
2.I have also register event callback function for EvtDeviceArmWakeFromS0 which gets called before EvtDeviceD0Exit.
3.So in this EvtDeviceArmWakeFromS0 i am canceling all pending read requests by calling WdfRequestCancelSentRequest which i had stored in collector .
4.I am referring http://msdn.microsoft.com/en-us/library/aa490079.aspx for this.
5.After cancellation of pending requests completion routine of those read requests is getting called there i am re queuing all requests back to my manual queue.
6. Here WdfRequestForwardToIoQueue is also returning success.
7. I have also register notification event for this queue by calling WdfIoQueueReadyNotify but even i am not getting any notifications when i add request to queue , though WdfRequestForwardToIoQueue returns success.
8. In EvtDeviceD0Entry i am resending all those re queued requests back to target. For that i am calling WdfIoQueueRetrieveNextRequest which returns me STATUS_NO_MORE_ENTRIES.
Can you tell me why this queue is automatically getting empty.
thanks ,
Amit.

Hi Doron ,
Can you give some suggestions on my problem.I am not getting why my queue is getting emptied automatically.
Thanks,
Amit.

after you are done fwding the requests to the manual queue, run !wdfkd.wdfqueue and see if the fwd’ed requests are in the queue or not. also, register a EvtIoCanceledOnQueue on the manual queue and see when/iof the callback is invoked. if it is, look at the callstack to see who is canceling the request/why you are getting called back

d

Hi Doron,
Thanks for your prompt reply. I have registered EvtIoCanceledOnQueue on a manual queue and it was getting called. I guess as the request was in a canceled state so it was completed by framework when it was inserted in the queue that is why it is automatically getting removed from manual queue. But is not there any way to cancel and re queue the framework supplied requests.
Thanks and regards,
Amit.