Re: IOSetCompletion Routine?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



First Scenario:
It means that if lower driver returns STATUS_PENDING, then
Pix_IrpCompletionRoutine function will not executed at all or in other terms
Pix_IrpCompletionRoutine function will be executed only when lower driver
returns STATUS_SUCCESS (please correct if i am wrong).

Second scenario:
When we returning STATUS_MORE_PROCESSING_REQUIRED, what other work we are
performing in below sequence calls (in order to stop the call stack to
proceed above the current driver).

Regards
wanni

"Don Burn" wrote:

The status pending will occur when the next lower driver returns from its
dispatch routine with the status STATUS_PENDING. The
STATUS_MORE_PROCESSING_REQUIRED is needed since the Irp has been completed,
and without that value the IO manager would continue up the call stack to
above the current driver.


--
Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply



"umesh" <umesh@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8CE57F52-CDA4-4790-B64A-345BD1C6A382@xxxxxxxxxxxxxxxx
Hi All,
I am little bit curious about following code snippet

1) IoCopyCurrentIrpStackLocationToNext( Irp );
2) IoSetCompletionRoutine( Irp,
Pix_IrpCompletionRoutine,
&event , , ,)
3) status = IoCallDriver( DeviceObject, Irp );
4) if( status == STATUS_PENDING )
{
....
}
5) IoCompleteRequest( Irp, IO_NO_INCREMENT );
6) return status;

Pix_IrpCompletionRoutine
{
return STATUS_MORE_PROCESSING_REQUIRED;
}

As per my inderstanding IOCallDriver will pass the IRP to next lower
driver.
Then this next lower driver will process the IRP and after fininshing it's
work it call the IOCompletion Routine function i.e.
Pix_IrpCompletionRoutine.
This Pix_IrpCompletionRoutine function is returning
STATUS_MORE_PROCESSING_REQUIRED.

I just want to know when" if( status == STATUS_PENDING ) " will come into
question. It will execute immediately after IOCallDriver or it will wait
till
IOCallDriver finishes its job. Whats the use of
STATUS_MORE_PROCESSING_REQUIRED value here.

I appreciate if anyone can throw light in this one.

Regards
wanni





.



Relevant Pages

  • Re: IoSkipCurrentIrpStackLocation() design flaw?
    ... IoSkipCurrentIrpStackLocationwas a race that if not handled with ... Such races the the headache of the originator of the IRP, ... below which execute this IRP. ... IRP and device usage tracking so driver writers aren't given the ...
    (microsoft.public.development.device.drivers)
  • Re: drive present detection?
    ... the free space of all online drives. ... If the underlying device driver determines that the media has not ... changed, the driver should complete the IRP, returning the IoStatus ...
    (microsoft.public.win32.programmer.kernel)
  • winddk7600.16385.0srcinputvserialVSerial.c WDK 1.9 IRP_MN_QUERY_ID can not pass DTM Device Path Exer
    ... I've developed a virtual HID driver for win 7 which I have to implement ... IRP_MN_QUERY_ID to report Hardware IDs, ... if forward IRP to lower device, got The driver has responded to an IRP ... PWCHAR buffer = NULL; ...
    (microsoft.public.development.device.drivers)
  • Re: Questions about I/O Buffers
    ... Windows Driver Developer Support ... > I am developing the firmware of a camera that talks to Microsoft USB Video ... > IRP ... >>> I look into the IRP packet that sends DEVICE_CONTROL to low layer. ...
    (microsoft.public.development.device.drivers)
  • Re: Question about filter sample from Mr. Oneys book
    ... The lower driver is done with the buffer when it completes the request. ... Does that imply the IRP is still pending as far as the lower ... >>> Should the completion routine be returning STATUS_SUCCESS in this case? ...
    (microsoft.public.development.device.drivers)