[NTOS:KE:X64][ASM:X64] Fix delivery of APCs

- Deliver pending APCs on trap exit
- Pass the trapframe of KiApcInterrupt to KiDeliverApcs, not NULL.
- Fix parameter passing from KiSwapContext to KiSwapContextInternal and KiSwapContextResume, so that the ApcBypass parameter is not uninitialized
- Fix return value of KiSwapContextResume to correctly indicate whether we want to have APCs directly delivered or not (when there are non, or when delivery is suppressed)
This commit is contained in:
Timo Kreuzer 2018-02-12 20:53:15 +01:00
parent fdc1261fb7
commit a016ccd117
4 changed files with 76 additions and 35 deletions

View file

@ -150,6 +150,7 @@ ENDM
MACRO(ExitTrap, Flags)
LOCAL kernel_mode_return
LOCAL IntsEnabled
LOCAL NoUserApc
#if DBG
/* Check previous irql */
@ -181,8 +182,9 @@ MACRO(ExitTrap, Flags)
/* Load current thread into r10 */
mov r10, gs:[PcCurrentThread]
cmp byte ptr [r10 + KTHREAD_UserApcPending], 0
jne KiExitToUserApc
je NoUserApc
call KiInitiateUserApc
NoUserApc:
endif
#if DBG