Merge trunk head (r43756)
[reactos.git] / reactos / dll / win32 / kernel32 / except / except.c
index 726965b..fda2e4b 100644 (file)
@@ -222,7 +222,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
    ULONG_PTR ErrorParameters[4];
    ULONG ErrorResponse;
 
-   if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION &&
+   if ((NTSTATUS)ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION &&
        ExceptionInfo->ExceptionRecord->NumberParameters >= 2)
    {
       switch(ExceptionInfo->ExceptionRecord->ExceptionInformation[0])
@@ -275,7 +275,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
       /* Print a stack trace. */
       DbgPrint("Unhandled exception\n");
       DbgPrint("ExceptionCode:    %8x\n", ExceptionInfo->ExceptionRecord->ExceptionCode);
-      if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION &&
+      if ((NTSTATUS)ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION &&
           ExceptionInfo->ExceptionRecord->NumberParameters == 2)
       {
          DbgPrint("Faulting Address: %8x\n", ExceptionInfo->ExceptionRecord->ExceptionInformation[1]);
@@ -318,7 +318,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
    ErrorParameters[0] = (ULONG)ExceptionInfo->ExceptionRecord->ExceptionCode;
    ErrorParameters[1] = (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress;
 
-   if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION)
+   if ((NTSTATUS)ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION)
    {
        /* get the type of operation that caused the access violation */
        ErrorParameters[2] = ExceptionInfo->ExceptionRecord->ExceptionInformation[0];
@@ -401,7 +401,18 @@ RaiseException(IN DWORD dwExceptionCode,
     {
         DPRINT1("Delphi Exception at address: %p\n", ExceptionRecord.ExceptionInformation[0]);
         DPRINT1("Exception-Object: %p\n", ExceptionRecord.ExceptionInformation[1]);
-        DPRINT1("Exception text: %s\n", ExceptionRecord.ExceptionInformation[2]);        
+        DPRINT1("Exception text: %s\n", ExceptionRecord.ExceptionInformation[2]);
+    }
+
+    /* Trace the wine special error and show the modulename and functionname */
+    if (dwExceptionCode == 0x80000100 /*EXCEPTION_WINE_STUB*/)
+    {
+       /* Numbers of parameter must be equal to two */
+       if (ExceptionRecord.NumberParameters == 2)
+       {
+          DPRINT1("Missing function in   : %s\n", ExceptionRecord.ExceptionInformation[0]);
+          DPRINT1("with the functionname : %s\n", ExceptionRecord.ExceptionInformation[1]);
+       }
     }
 
     /* Raise the exception */