Intra-driver IoCompleteRequest: is it good?

(preliminary thanks to MS’s people if they will respond)

Imagine the code:

IoCopyCurrentIrpStackLocationToNext(Irp);
IoSetCompletionRoutine(Irp, MyCompletion, Context, TRUE, TRUE, TRUE);
IoSetNextIrpStackLocation(Irp);
DeliverIrpToSubsystem(Irp);

and the subsystem later calls IoCompleteRequest, to return the IRP to MyCompletion within the same driver, which does something and returns STATUS_MORE_PROCESSING_REQUIRED.

Is it a good practice? It works on all Windows versions and Verifier does not complain, but is it an approved way of doing things?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

That works

d

dent from a phpne with no keynoard

-----Original Message-----
From: Maxim S. Shatskih
Sent: October 25, 2010 7:15 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Intra-driver IoCompleteRequest: is it good?

(preliminary thanks to MS’s people if they will respond)

Imagine the code:

IoCopyCurrentIrpStackLocationToNext(Irp);
IoSetCompletionRoutine(Irp, MyCompletion, Context, TRUE, TRUE, TRUE);
IoSetNextIrpStackLocation(Irp);
DeliverIrpToSubsystem(Irp);

and the subsystem later calls IoCompleteRequest, to return the IRP to MyCompletion within the same driver, which does something and returns STATUS_MORE_PROCESSING_REQUIRED.

Is it a good practice? It works on all Windows versions and Verifier does not complain, but is it an approved way of doing things?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer