Skip to content

Commit

Permalink
Balloon: Check ActionFlags before request unmark
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Kostiuk <konstantin@daynix.com>
  • Loading branch information
kostyanf14 authored and YanVugenfirer committed Aug 31, 2022
1 parent 6266327 commit 663b6dd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Balloon/sys/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,18 @@ VOID BalloonIoStop(IN WDFQUEUE Queue,
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_READ,
"--> %!FUNC! Request: %p", Request);

if (WdfRequestUnmarkCancelable(Request) == STATUS_CANCELLED)
if (ActionFlags & WdfRequestStopRequestCancelable)
{
WdfRequestStopAcknowledge(Request, FALSE);
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);
}
Expand All @@ -138,6 +145,7 @@ VOID BalloonIoStop(IN WDFQUEUE Queue,
WdfRequestComplete(Request, STATUS_UNSUCCESSFUL);
}

end_io_stop:
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_READ, "<-- %!FUNC!");
}

Expand Down

0 comments on commit 663b6dd

Please sign in to comment.