https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94b8095ba2064f9a6194f…
commit 94b8095ba2064f9a6194f8b16aafde6294913501
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Wed Sep 9 03:46:56 2020 +0200
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Thu Nov 4 23:20:21 2021 +0300
[NTOS:KE] KiTrap0EHandler(): Use MI_IS_WRITE_ACCESS()
---
ntoskrnl/ke/i386/traphdlr.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/ntoskrnl/ke/i386/traphdlr.c b/ntoskrnl/ke/i386/traphdlr.c
index 1ae5bf02240..e9045186f12 100644
--- a/ntoskrnl/ke/i386/traphdlr.c
+++ b/ntoskrnl/ke/i386/traphdlr.c
@@ -1321,7 +1321,6 @@ FASTCALL
KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
{
PKTHREAD Thread;
- BOOLEAN StoreInstruction;
ULONG_PTR Cr2;
NTSTATUS Status;
@@ -1347,9 +1346,6 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
/* Enable interrupts */
_enable();
- /* Interpret the error code */
- StoreInstruction = (TrapFrame->ErrCode & 2) != 0;
-
/* Check if we came in with interrupts disabled */
if (!(TrapFrame->EFlags & EFLAGS_INTERRUPT_MASK))
{
@@ -1412,7 +1408,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
/* This status code is repurposed so we can recognize it later */
KiDispatchException2Args(KI_EXCEPTION_ACCESS_VIOLATION,
TrapFrame->Eip,
- StoreInstruction,
+ MI_IS_WRITE_ACCESS(TrapFrame->ErrCode),
Cr2,
TrapFrame);
}
@@ -1422,7 +1418,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
/* These faults only have two parameters */
KiDispatchException2Args(Status,
TrapFrame->Eip,
- StoreInstruction,
+ MI_IS_WRITE_ACCESS(TrapFrame->ErrCode),
Cr2,
TrapFrame);
}
@@ -1432,7 +1428,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
0,
TrapFrame->Eip,
3,
- StoreInstruction,
+ MI_IS_WRITE_ACCESS(TrapFrame->ErrCode),
Cr2,
Status,
TrapFrame);