From 0e5118d97bd0b0cdb6bfc502d80c3ad6c1b119f9 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sun, 24 Apr 2011 11:24:37 +0000 Subject: [PATCH] [NTOSKRNL/KE] - Correctly return whether there is a kernel APC pending in KiSwapContextExit. Fixes IRQL asserts seen in bugs 5955 and 5777. Michael Martin's help in finding and fixing this bug was invaluable. Also thanks to Art Yerkes and testing team for additional information. See issue #5955 for more details. svn path=/trunk/; revision=51445 --- reactos/ntoskrnl/ke/i386/thrdini.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/ke/i386/thrdini.c b/reactos/ntoskrnl/ke/i386/thrdini.c index 07da5ab1fa3..5a083d386fb 100644 --- a/reactos/ntoskrnl/ke/i386/thrdini.c +++ b/reactos/ntoskrnl/ke/i386/thrdini.c @@ -397,12 +397,14 @@ KiSwapContextExit(IN PKTHREAD OldThread, if (!NewThread->SpecialApcDisable) { /* Request APC delivery */ - if (SwitchFrame->ApcBypassDisable) HalRequestSoftwareInterrupt(APC_LEVEL); - return TRUE; + if (SwitchFrame->ApcBypassDisable) + HalRequestSoftwareInterrupt(APC_LEVEL); + else + return TRUE; } } - /* Return */ + /* Return stating that no kernel APCs are pending*/ return FALSE; }