Skip to content

Commit

Permalink
Kernel - Force ReleaseTimeoutPendingIrp on ForceTimeoutEvent
Browse files Browse the repository at this point in the history
ForceTimeoutEvent is used when a Create is forced cancel during an oplock break. We should not have to wait for the check interval to happen.
  • Loading branch information
Liryna committed May 22, 2022
1 parent e9f4bef commit a31981d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sys/timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,14 @@ Routine Description:
// KillEvent or something error is occurred
waitObj = FALSE;
} else {
BOOL isForceTimeout = status == STATUS_WAIT_1;
KeClearEvent(&Dcb->ForceTimeoutEvent);
// In this case the timer was executed and we are checking if the timer
// occurred regulary using the period DOKAN_CHECK_INTERVAL. If not, this
// means the system was in sleep mode.
KeQuerySystemTime(&CurrentTime);
if ((CurrentTime.QuadPart - LastTime.QuadPart) >
((DOKAN_CHECK_INTERVAL + 2000) * 10000)) {
if (!isForceTimeout && (CurrentTime.QuadPart - LastTime.QuadPart) >
((DOKAN_CHECK_INTERVAL + 2000) * 10000)) {
DokanLogInfo(&logger, L"Wake from sleep detected.");
} else {
ReleaseTimeoutPendingIrp(Dcb);
Expand Down

0 comments on commit a31981d

Please sign in to comment.