sys: complete functions may repost IRP by setting Result to STATUS_PENDING

This commit is contained in:
Bill Zissimopoulos 2016-01-05 14:52:02 -08:00
parent aad518ac27
commit cafa15f1e4
2 changed files with 13 additions and 4 deletions

View File

@ -125,9 +125,9 @@ extern __declspec(selectany) int bpglobal = 1;
if (0 == (IrpSp->Control & SL_PENDING_RETURNED))\
{ \
/* if the IRP has not been marked pending already */\
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension =\
FSP_FSVOL_DEVICE_EXTENSION *fsp_leave_FsvolDeviceExtension =\
FspFsvolDeviceExtension(DeviceObject);\
if (!FspIoqPostIrp(FsvolDeviceExtension->Ioq, Irp, &Result))\
if (!FspIoqPostIrp(fsp_leave_FsvolDeviceExtension->Ioq, Irp, &Result))\
FspIopCompleteIrp(Irp, Result);\
} \
} \
@ -150,7 +150,16 @@ extern __declspec(selectany) int bpglobal = 1;
__VA_ARGS__, \
NtStatusSym(Result), \
(LONGLONG)Irp->IoStatus.Information);\
FspIopCompleteIrp(Irp, Result);\
if (STATUS_PENDING == Result) \
{ \
/* repost request! */ \
FSP_FSVOL_DEVICE_EXTENSION *fsp_leave_FsvolDeviceExtension =\
FspFsvolDeviceExtension(IrpSp->DeviceObject);\
if (!FspIoqPostIrp(fsp_leave_FsvolDeviceExtension->Ioq, Irp, &Result))\
FspIopCompleteIrp(Irp, Result);\
} \
else \
FspIopCompleteIrp(Irp, Result);\
)
#define FSP_ENTER_BOOL(...) \
BOOLEAN Result = TRUE; FSP_ENTER_(__VA_ARGS__)

View File

@ -581,7 +581,7 @@ NTSTATUS FspVolumeTransact(
* also cancel the PendingIrp we have in our hands.
*/
ASSERT(FspIoqStopped(FsvolDeviceExtension->Ioq));
FspIopCompleteIrp(PendingIrp, STATUS_CANCELLED);
FspIopCompleteCanceledIrp(PendingIrp);
return STATUS_CANCELLED;
}