There is one little difference most drivers - especially filters on the
critical i/o path for storage stacks - forget. The scheduling boost you
supply to IoCompleteRequest should be chosen quite carefully.
Unfortunately, there is no way to communicate that from one
IoCompleteRequest() to another today. If you know what you are doing,
and you are in the critical perf path for storage stacks, you should
supply IO_DISK_INCREMENT
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, April 06, 2005 12:05 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Problem with IoCompleteRequest() call
I am not sure if I can be more clear. This sequence:
Irp->IoStatus.Status = ntStatus;
return STATUS_CONTINUE_COMPLETION;
Is enough.
Think of it this way. When you send the irp down the stack and the
lower driver completes the request, it completes back to the i/o
manager. The i/o manager then walks up each stack location, calling the
completion routine. The i/o manager will stop walking up the stack
locations under the following conditions
- there are no more stack locations. At this point, the i/o manager
returns processing to the initiator of the IRP
- the current stack location’s completion routin returns
STATUS_MORE_PROCESSING_REQUIRED. At this point, the i/o manager stops
processing the IRP entirely. To further complete the request,
IoCompleteRequest must be called.
So, taking this into account, you can do one of 2 things to complete the
request back up to the caller
-
(like I indicated before)
Irp->IoStatus.Status = ntStatus;
return STATUS_CONTINUE_COMPLETION;
Irp->IoStatus.Status = ntStatus;
IoCompleteRequest(Irp, IO_NO_INCREMENT); return
STATUS_MORE_PROCESSING_REQUIRED;
both of these do exactly the same thing
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ramya Desai
Sent: Tuesday, April 05, 2005 11:43 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Problem with IoCompleteRequest() call
Dear Doron,
In the dispatch routing begining I am marking my IRP as pending.
Is it not compulsory to add IoCompleteRequest() after completion of
processing.
Is this Irp->IoStatus.Status = ntStatus statement enough ?
But I am giving IoCompleteRequest() after assigning status. Then my
driver is crashing. This code looks like following.
if(!ioContext->bytesRemaining)
{
Irp->IoStatus.Status = ntStatus;
Irp->IoStatus.Information = ioContext->Numxfer;
IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; //Newly
Added.
}
Regards,
Ramya.
On Apr 6, 2005 11:41 AM, Doron Holan
wrote:
> That will complete the request with ntStatus (whatever value that is).
> Looks fine to me given just the context you have given.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Ramya Desai
> Sent: Tuesday, April 05, 2005 10:48 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Problem with IoCompleteRequest() call
>
> Dear D,
> Here I am passing the code snippet that I have in Completion routine.
> This code executes when no data is to be processing.
>
> if(!ioContext->bytesRemaining)
> {
> Irp->IoStatus.Status = ntStatus;
> Irp->IoStatus.Information = ioContext->Numxfer;
> BulkUsb_DbgPrint(3, (“IOCTL_RWCompletion with STATUS_SUCCESS\n”));
> return STATUS_SUCCESS; }
>
>
***************************************************
>
> When you return STATUS_MORE_PROCESSING_REQUIRED in your completion
> routine, you are telling the i/o manager that you will complete the
> request on your own. When you return anything other then
> STATUS_MORE_PROCESSING_REQUIRED (something like STATUS_SUCESS), the
i/o
> manager will complete the request for you. Think of the processing of
> this NTSTATUS value as a BOOLEAN in this particular instance.
>
> Note that you still have to set Irp->IoStatus.Status to the status you
> want the irp to complete with. The NTSTATUS value returned by your
> completion routine is not placed into the irp.
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com