Hi
As you know there are 8 Irp Handling scenarios in WDM book. I have one more
that i couldn’t figure out what gonna happen next.
A-) In Intermediate Driver:
Dispatch Routine:
//////////////////////////
KEVENT event;
KeInitializeEvent(&event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
IoSetCompletionRoutine(Irp,CatchIrpRoutine,&event,TRUE,TRUE,TRUE);
status = IoCallDriver(DeviceObject, Irp);
if (status == STATUS_PENDING) {
status = KeWaitForSingleObject(&event,Executive,KernelMode,FALSE,NULL);
ASSERT(NT_SUCCESS(status));
status = Irp->IoStatus.Status;
}
return status;
///////////////////////
Completion Routine:
////////////////////////
NTSTATUS CatchIrpRoutine(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp,IN
PKEVENT Event)
{
if (Irp->PendingReturned) {
KeSetEvent( Event, IO_NO_INCREMENT, FALSE );
}
return STATUS_MORE_PROCESSING_REQUIRED;
}
/////////////////////
B-)Lowest Level Driver:
It doesn’t make device operation, just complete it and return in Dispatch
routine:
Irp->IoStatus.Status = STATUS_XXX; //1
Irp->IoStatus.Information = YYY; // 2
IoCompleteRequest(Irp, IO_NO_INCREMENT);// 3
return STATUS_XXX; // 4
1-) When 3. line is executed, IoCompleteRequest() will call Completion
Routines that previously registered, before returning STATUS_XXX
2-) After calling IoCompleteRequest(), In that step, CatchIrpRoutine starts
to execute and and return STATUS_MORE_PROCESSING_REQUIRED
3-) STATUS_MORE_PROCESSING_REQUIRED means stops the upward completion of the
IRP and leaves the IRP stack pointer at its current location
4-) So, here, in step 4 , after returning STATUS_MORE_PROCESSING_REQUIRED,
Is
a. “return STATUS_XXX;” executed, or
b. Intermediate Drivers Dispatch Routine executed?
5-) (I have no idea??)
Can you please help me to figure out what happens in step 4 and 5?
Thank you…