}
else
{
+ /* Check if we have an associated user IOSB */
+ if (Irp->UserIosb)
+ {
+ /* We do, so let's give them the final status */
+ _SEH2_TRY
+ {
+ /* Save the IOSB Information */
+ *Irp->UserIosb = Irp->IoStatus;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore any error */
+ }
+ _SEH2_END;
+ }
+
/*
* Either we didn't return from the request, or we did return but this
* request was synchronous.
/* So we did return with a synch operation, was it the IRP? */
if (Irp->Flags & IRP_SYNCHRONOUS_API)
{
- /* Yes, this IRP was synchronous, so return the I/O Status */
- *Irp->UserIosb = Irp->IoStatus;
-
/* Now check if the user gave an event */
if (Irp->UserEvent)
{
ErrorCode = PtrToUlong(LastStackPtr->Parameters.Others.Argument4);
}
- /* Get the Current Stack and skip it */
+ /* Get the Current Stack */
StackPtr = IoGetCurrentIrpStackLocation(Irp);
- IoSkipCurrentIrpStackLocation(Irp);
/* Loop the Stacks and complete the IRPs */
do
{
+ /* Skip current stack location */
+ IoSkipCurrentIrpStackLocation(Irp);
+
/* Set Pending Returned */
Irp->PendingReturned = StackPtr->Control & SL_PENDING_RETURNED;
IopClearStackLocation(StackPtr);
}
- /* Move to next stack location and pointer */
- IoSkipCurrentIrpStackLocation(Irp);
+ /* Move pointer to next stack location */
StackPtr++;
- } while (Irp->CurrentLocation <= (Irp->StackCount + 1));
+ } while (Irp->CurrentLocation <= Irp->StackCount);
/* Check if the IRP is an associated IRP */
if (Irp->Flags & IRP_ASSOCIATED_IRP)
OUT PULONG pSessionId)
{
/* Return the session */
- *pSessionId = (ULONG_PTR)IoGetRequestorProcess(Irp)->Session;
+ *pSessionId = IoGetRequestorProcess(Irp)->Session;
return STATUS_SUCCESS;
}