viorng: Fix SDV EvtIoStopCancel issue
@@ -160,16 +160,22 @@ VOID VirtRngEvtIoStop(IN WDFQUEUE Queue,
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_READ,
"--> %!FUNC! Request: %p", Request);
- if (ActionFlags & WdfRequestStopActionSuspend)
+ NTSTATUS status = WdfRequestUnmarkCancelable(Request);
+ if (status == STATUS_CANCELLED)
{
WdfRequestStopAcknowledge(Request, FALSE);
}
- else if (ActionFlags & WdfRequestStopActionPurge)
+ else if (ActionFlags & WdfRequestStopActionSuspend)
{
- if (WdfRequestUnmarkCancelable(Request) != STATUS_CANCELLED)
+ WdfRequestStopAcknowledge(Request, FALSE);
+ }
+ else if (ActionFlags & WdfRequestStopActionPurge)
{
WdfRequestComplete(Request, STATUS_CANCELLED);
}
+ else
+ {
+ WdfRequestComplete(Request, STATUS_UNSUCCESSFUL);
}
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_READ, "<-- %!FUNC!");
