Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. SxsExceptionHandling.cpp
  5. Abstract:
  6. Author:
  7. Jay Krell (a-JayK) October 2000
  8. Revision History:
  9. --*/
  10. #include "stdinc.h"
  11. #include <stdio.h>
  12. INT
  13. SxspExceptionFilter(
  14. PEXCEPTION_POINTERS ExceptionPointers,
  15. PCSTR Function
  16. )
  17. {
  18. // add handling for unhandled status in RtlUnhandledExceptionFilter
  19. switch ( ExceptionPointers->ExceptionRecord->ExceptionCode )
  20. {
  21. case STATUS_NO_MEMORY:
  22. case STATUS_INSUFFICIENT_RESOURCES:
  23. return EXCEPTION_EXECUTE_HANDLER;
  24. default:
  25. break;
  26. }
  27. #if defined(FUSION_WIN)
  28. INT i = ::FusionpRtlUnhandledExceptionFilter(ExceptionPointers);
  29. if (i == EXCEPTION_CONTINUE_SEARCH)
  30. {
  31. i = EXCEPTION_EXECUTE_HANDLER;
  32. }
  33. return i;
  34. #else
  35. char buf[64];
  36. buf[RTL_NUMBER_OF(buf) - 1] = 0;
  37. ::_snprintf(buf, RTL_NUMBER_OF(buf) - 1, "** Unhandled exception 0x%x\n", ExceptionPointers->ExceptionRecord->ExceptionCode);
  38. ::OutputDebugStringA(buf);
  39. #if DBG
  40. ::_snprintf(buf, RTL_NUMBER_OF(buf) - 1, "** .exr %p\n", ExceptionPointers->ExceptionRecord);
  41. ::OutputDebugStringA(buf);
  42. ::_snprintf(buf, RTL_NUMBER_OF(buf) - 1, "** .cxr %p\n", ExceptionPointers->ContextRecord);
  43. ::OutputDebugStringA(buf);
  44. ::DebugBreak();
  45. #endif
  46. return EXCEPTION_EXECUTE_HANDLER;
  47. #endif
  48. }