IRP pending returned flag

Hi all,
I am quite new to WDM and have run into a doubt which I guess would be very
trivial to the masters reading this post.

My current understanding is that when the DispatchRoutine returns a
STATUS_PENDING to the IoCallDriver,the IoCallDriver is going to wait unitl
the IoCompleteRequest releases it from its wait.But what happens when the
DispatchRoutine returns some other status?

How will the IoCompleteRequest know that the dipatchRoutine has returned
without status pending ? IoMarkPending that is called form the
DispatchRoutine will set the SL_PENDING_RETURNED of the IoStackLocation.

But I find in some codes that IoCompleteRequest actually checks for
IRP->PendingReturned to determine wether the DispatchRoutine has returned a
STATUS_PENDING or not?
So Who is responsible for setting the IRP->prnding flag? Should it be set by
the DispatchRoutine or will the kernel take care of it?

Thanks in advance for your patience and reply

Abdul

Read the nt insider article http://www.osronline.com/article.cfm?id=83

This is on How Nt Handles I/O completion…

–Mark Cariddi

OSR, Open Systems Resources, Inc

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abdul Qader
Sent: Thursday, August 20, 2009 9:35 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IRP pending returned flag

Hi all,

I am quite new to WDM and have run into a doubt which I guess would be
very trivial to the masters reading this post.

My current understanding is that when the DispatchRoutine returns a
STATUS_PENDING to the IoCallDriver,the IoCallDriver is going to wait
unitl the IoCompleteRequest releases it from its wait.But what happens
when the DispatchRoutine returns some other status?

How will the IoCompleteRequest know that the dipatchRoutine has returned
without status pending ? IoMarkPending that is called form the
DispatchRoutine will set the SL_PENDING_RETURNED of the IoStackLocation.

But I find in some codes that IoCompleteRequest actually checks for
IRP->PendingReturned to determine wether the DispatchRoutine has
returned a STATUS_PENDING or not?

So Who is responsible for setting the IRP->prnding flag? Should it be
set by the DispatchRoutine or will the kernel take care of it?

Thanks in advance for your patience and reply

Abdul

— NTDEV is sponsored by OSR 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