https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a3c607f532cd4658719a3ce104cb9f0a2a72a01

commit 1a3c607f532cd4658719a3ce104cb9f0a2a72a01
Author:     Hervé Poussineau <[email protected]>
AuthorDate: Sun Nov 22 18:13:51 2020 +0100
Commit:     Hervé Poussineau <[email protected]>
CommitDate: Sun Nov 22 18:17:59 2020 +0100

    [NTOS:KD] Change the way we detect if exception if from KernelMode/UserMode
    
    CORE-17381
---
 ntoskrnl/kd/kdio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c
index 50f011c7f02..c1b01dec20b 100644
--- a/ntoskrnl/kd/kdio.c
+++ b/ntoskrnl/kd/kdio.c
@@ -56,7 +56,6 @@ static ULONG KdbgNextApiNumber = DbgKdContinueApi;
 static CONTEXT KdbgContext;
 static EXCEPTION_RECORD64 KdbgExceptionRecord;
 static BOOLEAN KdbgFirstChanceException;
-static KPROCESSOR_MODE KdbgPreviousMode;
 static NTSTATUS KdbgContinueStatus = STATUS_SUCCESS;
 
 /* LOCKING FUNCTIONS *********************************************************/
@@ -581,7 +580,6 @@ KdSendPacket(
             KdbgNextApiNumber = DbgKdGetContextApi;
             KdbgExceptionRecord = WaitStateChange->u.Exception.ExceptionRecord;
             KdbgFirstChanceException = 
WaitStateChange->u.Exception.FirstChance;
-            KdbgPreviousMode = 
((PKTHREAD)(ULONG_PTR)WaitStateChange->Thread)->PreviousMode;
             return;
         }
     }
@@ -601,7 +599,7 @@ KdSendPacket(
             }
 
             Result = KdbEnterDebuggerException(&KdbgExceptionRecord,
-                                               KdbgPreviousMode,
+                                               KdbgContext.SegCs & 1,
                                                &KdbgContext,
                                                KdbgFirstChanceException);
 #else

Reply via email to