From 8a945ffbf3caa0c67d14c3a076a07af1bcbff39e Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sat, 23 Jul 2011 17:17:06 +0000 Subject: [PATCH] [KERNEL32]: SleepEx forgot to de-activate the SxS frame. svn path=/trunk/; revision=52811 --- reactos/dll/win32/kernel32/client/synch.c | 3 +++ reactos/lib/rtl/actctx.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/reactos/dll/win32/kernel32/client/synch.c b/reactos/dll/win32/kernel32/client/synch.c index 3d577fe2e2e..dede163c9a0 100644 --- a/reactos/dll/win32/kernel32/client/synch.c +++ b/reactos/dll/win32/kernel32/client/synch.c @@ -702,6 +702,9 @@ SleepEx(IN DWORD dwMilliseconds, errCode = NtDelayExecution((BOOLEAN)bAlertable, TimePtr); } while ((bAlertable) && (errCode == STATUS_ALERTED)); + + /* Cleanup the activation context */ + if (bAlertable) RtlDeactivateActivationContextUnsafeFast(&ActCtx); /* Return the correct code */ return (errCode == STATUS_USER_APC) ? WAIT_IO_COMPLETION : 0; diff --git a/reactos/lib/rtl/actctx.c b/reactos/lib/rtl/actctx.c index 7984cf1e802..e607960033f 100644 --- a/reactos/lib/rtl/actctx.c +++ b/reactos/lib/rtl/actctx.c @@ -2832,7 +2832,10 @@ RtlDeactivateActivationContextUnsafeFast(IN PRTL_CALLER_ALLOCATED_ACTIVATION_CON frame = &Frame->Frame; if (!frame) + { + DPRINT1("No top frame!\n"); RtlRaiseStatus( STATUS_SXS_INVALID_DEACTIVATION ); + } /* pop everything up to and including frame */ NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = frame->Previous;