RE: Newbie question: IRP with STATUS_PENDING in IoCom petion routine

Actually, from a completion routine you should only return STATUS_SUCCESS or
STATUS_MORE_PROCESSING_REQUIRED. The I/O manager only looks for
STATUS_MORE_PROCESSING_REQUIRED. Any other return is treated just like
STATUS_SUCCESS - so adding additional information is a bit pointless (a
shame this function was not originally prototyped as a BOOLEAN, since that’s
really how it is used.)

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@NAI.com [mailto:xxxxx@NAI.com]
Sent: Monday, May 05, 2003 12:48 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Newbie question: IRP with STATUS_PENDING in IoCompetion
routine

KK,
I believe you have a problem with your completion routine. You
check the pending returned flag and call IoMarkIrpPending that is all
fine. But returning STATUS_PENDING from completion routine, this does
not look right. Go through documentation and sample code. You should
return STATUS_SUCCESS, or any error value appropriate or
STATUS_MORE_PROCESSING_REQUIRED.

-Srin.

-----Original Message-----
From: Keshab Koch [mailto:xxxxx@india.nsc.com]
Sent: Monday, May 05, 2003 9:23 AM
To: NT Developers Interest List
Subject: [ntdev] Newbie question: IRP with STATUS_PENDING in IoCompetion
routine

Hi:

I am using IoAllocateIrp to create a TDI_ACCEPT IRP in my TDI client.
The
connect event handler returns this IRP and the IRP’s completion routine
is
called with the IRP’s status marked as pending (irp->PendingReturned ==
TRUE). As per the DDK, I call IoMarkIrpPending on the IRP and return
with
STATUS_PENDING. The system crashes. Even if I don’t do that, the system
crashes.

When I pre-allocate and use TdiBuildInternalDeviceControlIrp the
TDI_ACCEPT IRP completes successfully. Here’s what I am doing now:

ConnectEventHandler
{
.
.
.
irp = IoAllocateIrp(deviceObject->StackSize, FALSE);
TdiBuildAccept(irp,…);
IoSetNextIrpStackLocation(irp);

}

IoAcceptComplete
{
//—update whatever is necessary
if(irp->PendingReturned)
{
IoMarkIrpPending(irp);
ntStatus = STATUS_PENDING;
}

return ntStatus;
}

My feeling is that I am missing out on something that I should do to the
IRP before returning it in the connectEventHandler. Can anyone advise?

KK


You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com