Author: greatlrd
Date: Fri Mar 2 03:42:34 2007
New Revision: 25940
URL:
http://svn.reactos.org/svn/reactos?rev=25940&view=rev
Log:
merges part of 25937 the changes for fixed some issue with seh by alex
This solv some of the inifiloop I got with seh, but not all
Modified:
branches/ros-branch-0_3_1/reactos/include/ndk/asm.h
branches/ros-branch-0_3_1/reactos/include/ndk/ketypes.h
branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/except.c
branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/exp.c
branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/trap.s
Modified: branches/ros-branch-0_3_1/reactos/include/ndk/asm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/includ…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/include/ndk/asm.h (original)
+++ branches/ros-branch-0_3_1/reactos/include/ndk/asm.h Fri Mar 2 03:42:34 2007
@@ -479,8 +479,10 @@
#define DR6_LEGAL 0xE00F
#define DR7_LEGAL 0xFFFF0155
#define DR7_ACTIVE 0x55
+#define DR7_OVERRIDE_V 0x04
#define DR7_RESERVED_MASK 0xDC00
#define DR7_OVERRIDE_MASK 0xF0000
+
//
// Usermode callout frame definitions
@@ -589,3 +591,4 @@
#define MAXIMUM_IDTVECTOR 0xFF
#endif // !_ASM_H
+
Modified: branches/ros-branch-0_3_1/reactos/include/ndk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/includ…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/include/ndk/ketypes.h (original)
+++ branches/ros-branch-0_3_1/reactos/include/ndk/ketypes.h Fri Mar 2 03:42:34 2007
@@ -89,6 +89,12 @@
#define KF_XMMI64 0x00010000
#define KF_NX_DISABLED 0x00400000
#define KF_NX_ENABLED 0x00800000
+
+//
+// Internal Exception Codes
+//
+#define KI_EXCEPTION_INTERNAL 0x10000000
+#define KI_EXCEPTION_ACCESS_VIOLATION (KI_EXCEPTION_INTERNAL | 0x04)
//
// KPCR Access for non-IA64 builds
@@ -281,6 +287,17 @@
} KTHREAD_STATE, *PKTHREAD_STATE;
//
+// Continue Status
+//
+typedef enum _KCONTINUE_STATUS
+{
+ ContinueError = 0,
+ ContinueSuccess,
+ ContinueProcessorReselected,
+ ContinueNextProcessor
+ } KCONTINUE_STATUS;
+
+//
// Process States
//
typedef enum _KPROCESS_STATE
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/except.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/except.c (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/except.c Fri Mar 2 03:42:34 2007
@@ -144,9 +144,8 @@
}
_SEH_END;
- /* Make sure we didn't crash in SEH */
- if (NT_SUCCESS(Status))
- {
+ if (!NT_SUCCESS(Status)) return Status;
+
/* Convert the context record */
KeContextToTrapFrame(Context,
ExceptionFrame,
@@ -155,12 +154,13 @@
PreviousMode);
/* Dispatch the exception */
+ ExceptionRecord->ExceptionCode &= ~KI_EXCEPTION_INTERNAL;
+
KiDispatchException(ExceptionRecord,
ExceptionFrame,
TrapFrame,
PreviousMode,
SearchFrames);
- }
/* Return the status */
return Status;
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/exp.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/exp.c (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/exp.c Fri Mar 2 03:42:34 2007
@@ -90,7 +90,7 @@
ULONG DebugMask = KeGetCurrentThread()->DispatcherHeader.DebugActive;
/* Check if debugging is enabled */
- if (DebugMask & DR_ACTIVE_MASK)
+ if (DebugMask & DR_MASK(DR7_OVERRIDE_V))
{
/* Sanity checks */
ASSERT((DebugMask & DR_REG_MASK) != 0);
@@ -133,11 +133,11 @@
Result = FALSE;
/* Check the DR mask */
- NewMask &= 0x7F;
+ NewMask &= ~(DR_MASK(7));
if (NewMask & DR_REG_MASK)
{
/* Set the active mask */
- NewMask |= DR_ACTIVE_MASK;
+ NewMask |= DR_MASK(DR7_OVERRIDE_V);
/* Set DR7 override */
*DrMask = DR7_OVERRIDE_MASK;
@@ -154,8 +154,8 @@
Result = NewMask ? TRUE: FALSE;
/* Update the mask to disable debugging */
- NewMask &= ~DR_ACTIVE_MASK;
- NewMask |= 0x80;
+ NewMask &= ~(DR_MASK(DR7_OVERRIDE_V));
+ NewMask |= DR_MASK(7);
}
/* Check if caller wants the new mask */
@@ -1046,3 +1046,4 @@
return (NTSTATUS)OldEip;
}
+
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/trap.s (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/ke/i386/trap.s Fri Mar 2 03:42:34 2007
@@ -484,7 +484,7 @@
/* Call debug service dispatcher */
mov eax, [ebp+KTRAP_FRAME_EAX]
mov ecx, [ebp+KTRAP_FRAME_ECX]
- mov edx, [ebp+KTRAP_FRAME_EAX]
+ mov edx, [ebp+KTRAP_FRAME_EDX]
/* Check for V86 mode */
test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK
@@ -639,7 +639,7 @@
mov [esp+EXCEPTION_RECORD_NUMBER_PARAMETERS], ecx
/* Check parameter count */
- cmp eax, 0
+ cmp ecx, 0
jz NoParams
/* Get information */
@@ -841,7 +841,6 @@
/* Setup EIP, NTSTATUS and parameter count, then dispatch */
mov ebx, [ebp+KTRAP_FRAME_EIP]
dec ebx
- mov eax, STATUS_BREAKPOINT
mov ecx, 3
call _CommonDispatchException