DPRINT("IoSecondStageCompletion(Irp %x, PriorityBoost %d)\n",
Irp, PriorityBoost);
+ /* FIXME: Should we set 'Irp->UserIosb' only on MasterIrp finalization
+ * or we should set it for each subrequest?
+ */
+ if (Irp->UserIosb)
+ {
+ *Irp->UserIosb=Irp->IoStatus;
+ }
+
+ /* Handling only subrequest of AssociatedIrp group from MasterIrp?
+ * Is it the last subrequest?
+ * FIXME: It appears to me as if 'Irp->AssociatedIrp.IrpCount' is +1 than expected. :-?
+ */
+ if (Irp->Flags & IRP_ASSOCIATED_IRP)
+ {
+ Irp=Irp->AssociatedIrp.MasterIrp;
+ if (!Irp)
+ KeBugCheck(0);
+ if (!Irp->AssociatedIrp.IrpCount)
+ KeBugCheck(0); /* Completion of already completed MasterIrp? */
+ /* TODO:thread */
+ if (--Irp->AssociatedIrp.IrpCount)
+ return; /* not yet fully completed MasterIrp */
+ if (Irp->UserIosb)
+ {
+ *Irp->UserIosb=Irp->IoStatus;
+ }
+ }
+
IoStack = &Irp->Stack[(ULONG)Irp->CurrentLocation];
FileObject = IoStack->FileObject;