Explorar o código

* In preparation to support SEH on Win32, moved definitions that apply to Win32 from seh64.inc into syswin.inc.

git-svn-id: trunk@26153 -
sergei %!s(int64=11) %!d(string=hai) anos
pai
achega
6a40ff730c
Modificáronse 2 ficheiros con 34 adicións e 22 borrados
  1. 31 0
      rtl/win/syswin.inc
  2. 3 22
      rtl/win64/seh64.inc

+ 31 - 0
rtl/win/syswin.inc

@@ -81,10 +81,23 @@ const
   STATUS_FLOAT_MULTIPLE_TRAPS             = $C00002B5;
   STATUS_REG_NAT_CONSUMPTION              = $C00002C9;
 
+  { Exceptions raised by RTL use this code }
+  FPC_EXCEPTION_CODE                      = $E0465043;
+
   EXCEPTION_EXECUTE_HANDLER               = 1;
   EXCEPTION_CONTINUE_EXECUTION            = -1;
   EXCEPTION_CONTINUE_SEARCH               = 0;
 
+  { exception flags (not everything applies to Win32!) }
+  EXCEPTION_NONCONTINUABLE  = $01;
+  EXCEPTION_UNWINDING       = $02;
+  EXCEPTION_EXIT_UNWIND     = $04;
+  EXCEPTION_STACK_INVALID   = $08;
+  EXCEPTION_NESTED_CALL     = $10;
+  EXCEPTION_TARGET_UNWIND   = $20;
+  EXCEPTION_COLLIDED_UNWIND = $40;
+
+
   CONTEXT_X86                             = $00010000;
   CONTEXT_CONTROL                         = CONTEXT_X86 or $00000001;
   CONTEXT_INTEGER                         = CONTEXT_X86 or $00000002;
@@ -97,6 +110,24 @@ const
 
   MAXIMUM_SUPPORTED_EXTENSION             = 512;
 
+type
+  EXCEPTION_DISPOSITION=(
+    ExceptionContinueExecution,
+    ExceptionContinueSearch,
+    ExceptionNestedException,
+    ExceptionCollidedUnwind
+  );
+
+  TUnwindProc=procedure(frame: PtrUInt);
+
+procedure RaiseException(
+  dwExceptionCode: DWORD;
+  dwExceptionFlags: DWORD;
+  dwArgCount: DWORD;
+  lpArguments: Pointer);  // msdn: *ULONG_PTR
+  stdcall; external 'kernel32.dll' name 'RaiseException';
+
+
   {*****************************************************************************
                                 Parameter Handling
   *****************************************************************************}

+ 3 - 22
rtl/win64/seh64.inc

@@ -15,14 +15,8 @@
 
 { exception flags }
 const
-  EXCEPTION_NONCONTINUABLE  = $01;
-  EXCEPTION_UNWINDING       = $02;
-  EXCEPTION_EXIT_UNWIND     = $04;
-  EXCEPTION_STACK_INVALID   = $08;
-  EXCEPTION_NESTED_CALL     = $10;
-  EXCEPTION_TARGET_UNWIND   = $20;
-  EXCEPTION_COLLIDED_UNWIND = $40;
-  EXCEPTION_UNWIND          = $66;
+  EXCEPTION_UNWIND          = EXCEPTION_UNWINDING or EXCEPTION_EXIT_UNWIND or
+                              EXCEPTION_TARGET_UNWIND or EXCEPTION_COLLIDED_UNWIND;
 
   UNWIND_HISTORY_TABLE_SIZE = 12;
 
@@ -109,12 +103,6 @@ type
     IntegerContext: array[0..15] of PQWord;
   end;
 
-  EXCEPTION_DISPOSITION=(
-    ExceptionContinueExecution,
-    ExceptionContinueSearch,
-    ExceptionNestedException,
-    ExceptionCollidedUnwind
-  );
 
   PExceptionPointers = ^TExceptionPointers;
   TExceptionPointers = record
@@ -204,17 +192,10 @@ procedure RtlUnwindEx(
   HistoryTable: PUNWIND_HISTORY_TABLE);
   external 'kernel32.dll' name 'RtlUnwindEx';
 
-procedure RaiseException(
-  dwExceptionCode: DWORD;
-  dwExceptionFlags: DWORD;
-  dwArgCount: DWORD;
-  lpArguments: Pointer);  // msdn: *ULONG_PTR
-  external 'kernel32.dll' name 'RaiseException';
 
 { FPC specific stuff }
 {$ifdef FPC_USE_WIN64_SEH}
 const
-  FPC_EXCEPTION_CODE=$E0465043;
   SCOPE_FINALLY=0;
   SCOPE_CATCHALL=1;
   SCOPE_IMPLICIT=2;
@@ -237,7 +218,7 @@ type
     RvaHandler: DWord;
   end;
 
-  TUnwindProc=procedure(frame: QWord);
+
   TExceptObjProc=function(code: Longint; const rec: TExceptionRecord): Pointer; { Exception }
   TExceptClsProc=function(code: Longint): Pointer; { ExceptClass }