viofs: Check ActionFlags before request unmark
@@ -417,11 +417,18 @@ VOID VirtFsEvtIoStop(IN WDFQUEUE Queue,
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL,
"--> %!FUNC! Request: %p ActionFlags: 0x%08x", Request, ActionFlags);
- if (WdfRequestUnmarkCancelable(Request) == STATUS_CANCELLED)
+ if (ActionFlags & WdfRequestStopRequestCancelable)
+ {
+ NTSTATUS status = WdfRequestUnmarkCancelable(Request);
+ __analysis_assume(status != STATUS_NOT_SUPPORTED);
+ if (status == STATUS_CANCELLED)
{
WdfRequestStopAcknowledge(Request, FALSE);
+ goto end_io_stop;
}
- else if (ActionFlags & WdfRequestStopActionSuspend)
+ }
+
+ if (ActionFlags & WdfRequestStopActionSuspend)
{
WdfRequestStopAcknowledge(Request, TRUE);
}
@@ -453,6 +460,7 @@ VOID VirtFsEvtIoStop(IN WDFQUEUE Queue,
WdfRequestComplete(Request, STATUS_UNSUCCESSFUL);
}
+end_io_stop:
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL, "<-- %!FUNC!");
}
