Apply kjk's change to thread.c too
Modified: trunk/reactos/lib/kernel32/thread/thread.c

Modified: trunk/reactos/lib/kernel32/thread/thread.c
--- trunk/reactos/lib/kernel32/thread/thread.c	2005-06-20 03:55:42 UTC (rev 16131)
+++ trunk/reactos/lib/kernel32/thread/thread.c	2005-06-20 04:07:19 UTC (rev 16132)
@@ -20,46 +20,27 @@
 
 
 /* FUNCTIONS *****************************************************************/
-
-/* FIXME: please put this in some header */
-static EXCEPTION_DISPOSITION __cdecl
-_except_handler(EXCEPTION_RECORD *ExceptionRecord,
-		void * EstablisherFrame,
-		CONTEXT *ContextRecord,
-		void * DispatcherContext)
+_SEH_FILTER(BaseThreadExceptionFilter)
 {
-   EXCEPTION_POINTERS ExceptionInfo;
-   EXCEPTION_DISPOSITION ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER;
+   EXCEPTION_POINTERS * ExceptionInfo = _SEH_GetExceptionPointers();
+   LONG ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER;
 
-   ExceptionInfo.ExceptionRecord = ExceptionRecord;
-   ExceptionInfo.ContextRecord = ContextRecord;
-
    if (GlobalTopLevelExceptionFilter != NULL)
    {
       _SEH_TRY
       {
-         ExceptionDisposition = GlobalTopLevelExceptionFilter(&ExceptionInfo);
+         ExceptionDisposition = GlobalTopLevelExceptionFilter(ExceptionInfo);
       }
       _SEH_HANDLE
       {
-         ExceptionDisposition = UnhandledExceptionFilter(&ExceptionInfo);
+         ExceptionDisposition = UnhandledExceptionFilter(ExceptionInfo);
       }
       _SEH_END;
    }
 
-   if (ExceptionDisposition == EXCEPTION_EXECUTE_HANDLER)
-      ExitThread(ExceptionRecord->ExceptionCode);
-
-   /* translate EXCEPTION_XXX defines into EXCEPTION_DISPOSITION enum values */
-   if (ExceptionDisposition == EXCEPTION_CONTINUE_EXECUTION)
-     return ExceptionContinueExecution;
-   else if (ExceptionDisposition == EXCEPTION_CONTINUE_SEARCH)
-     return ExceptionContinueSearch;
-
-   return -1; /* unknown return from UnhandledExceptionFilter */
+   return ExceptionDisposition;
 }
 
-
 __declspec(noreturn) void STDCALL
 ThreadStartup
 (
@@ -69,13 +50,16 @@
 {
   volatile UINT uExitCode = 0;
 
-  __try1(_except_handler)
-  {
-    /* FIXME: notify csrss of thread creation ?? */
-    uExitCode = (lpStartAddress)(lpParameter);
-  }
-  __except1
-
+     _SEH_TRY
+   {
+      uExitCode = (lpStartAddress)((PVOID)lpParameter);
+   }
+   _SEH_EXCEPT(BaseThreadExceptionFilter)
+   {
+      uExitCode = _SEH_GetExceptionCode();
+   }
+   _SEH_END;
+   
   ExitThread(uExitCode);
 }