mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[NTOS:KE] Save and restore previous mode in KiZwSystemService and fix restoring the trap frame
This commit is contained in:
parent
b2a483b9ea
commit
3aaee35629
1 changed files with 9 additions and 1 deletions
|
@ -835,6 +835,10 @@ FUNC KiZwSystemService
|
|||
/* Get current thread */
|
||||
mov r11, gs:[PcCurrentThread]
|
||||
|
||||
/* Save PreviousMode in the trap frame */
|
||||
mov dil, byte ptr [r11 + KTHREAD_PreviousMode]
|
||||
mov byte ptr [rbp + KTRAP_FRAME_PreviousMode], dil
|
||||
|
||||
/* Save the old trap frame in TrapFrame.Rdx */
|
||||
mov rdi, [r11 + KTHREAD_TrapFrame]
|
||||
mov [rbp + KTRAP_FRAME_Rdx], rdi
|
||||
|
@ -865,9 +869,13 @@ FUNC KiZwSystemService
|
|||
|
||||
/* Restore the old trap frame */
|
||||
mov r11, gs:[PcCurrentThread]
|
||||
mov rsi, [rsp + KTRAP_FRAME_Rdx]
|
||||
mov rsi, [rbp + KTRAP_FRAME_Rdx]
|
||||
mov [r11 + KTHREAD_TrapFrame], rsi
|
||||
|
||||
/* Restore PreviousMode from the trap frame */
|
||||
mov dil, byte ptr [rbp + KTRAP_FRAME_PreviousMode]
|
||||
mov byte ptr [r11 + KTHREAD_PreviousMode], dil
|
||||
|
||||
/* Restore rdi and rsi */
|
||||
mov rsi, [rbp + KTRAP_FRAME_Rsi]
|
||||
mov rdi, [rbp + KTRAP_FRAME_Rdi]
|
||||
|
|
Loading…
Reference in a new issue