crash.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*++
  2. Copyright (c) 2012 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. crash.h
  5. Abstract:
  6. This header contains definitions for fatal system error codes.
  7. Author:
  8. Evan Green 25-Sep-2012
  9. --*/
  10. //
  11. // ---------------------------------------------------------------- Definitions
  12. //
  13. //
  14. // This is not a valid crash code.
  15. //
  16. #define CRASH_INVALID 0x0
  17. #define CRASH_PAGE_FAULT 0x1
  18. #define CRASH_PAGE_FAULT_AT_HIGH_RUN_LEVEL 0x2
  19. #define CRASH_PAGE_IN_ERROR 0x3
  20. #define CRASH_PAGE_OUT_ERROR 0x4
  21. #define CRASH_SYSTEM_INITIALIZATION_FAILURE 0x5
  22. #define CRASH_HARDWARE_LAYER_FAILURE 0x6
  23. #define CRASH_IPI_FAILURE 0x7
  24. #define CRASH_INVALID_IRP 0x8
  25. #define CRASH_THREAD_ERROR 0x9
  26. #define CRASH_POOL_CORRUPTION 0xA
  27. #define CRASH_ACPI_FAILURE 0xB
  28. #define CRASH_WORK_ITEM_CORRUPTION 0xC
  29. #define CRASH_DPC_FAILURE 0xD
  30. #define CRASH_KTIMER_FAILURE 0xE
  31. #define CRASH_KERNEL_STACK_EXCEPTION 0xF
  32. #define CRASH_DIVIDE_BY_ZERO 0x10
  33. #define CRASH_OUT_OF_MEMORY 0x11
  34. #define CRASH_DRIVER_ERROR 0x12
  35. #define CRASH_USB_ERROR 0x13
  36. #define CRASH_PAGING_DEVICE_REMOVAL 0x14
  37. #define CRASH_MATH_FAULT 0x15
  38. #define CRASH_ILLEGAL_INSTRUCTION 0x16
  39. //
  40. // Call this macro to take the system down.
  41. //
  42. #define KeCrashSystem(_CrashCode, \
  43. _Parameter1, \
  44. _Parameter2, \
  45. _Parameter3, \
  46. _Parameter4) \
  47. \
  48. KeCrashSystemEx(_CrashCode, \
  49. #_CrashCode, \
  50. _Parameter1, \
  51. _Parameter2, \
  52. _Parameter3, \
  53. _Parameter4)
  54. //
  55. // -------------------------------------------------------- Function Prototypes
  56. //
  57. KERNEL_API
  58. VOID
  59. KeCrashSystemEx (
  60. ULONG CrashCode,
  61. PSTR CrashCodeString,
  62. ULONGLONG Parameter1,
  63. ULONGLONG Parameter2,
  64. ULONGLONG Parameter3,
  65. ULONGLONG Parameter4
  66. );
  67. /*++
  68. Routine Description:
  69. This routine officially takes the system down after a fatal system error
  70. has occurred. This function does not return. Do not call this routine
  71. directly, use the non-Ex version, a macro that calls this routine with the
  72. correct string.
  73. Arguments:
  74. CrashCode - Supplies the reason for the system crash.
  75. CrashCodeString - Supplies the string corresponding to the given crash
  76. code. This parameter is generated by the macro, and should not be
  77. filled in directly.
  78. Parameter1 - Supplies an optional parameter regarding the crash.
  79. Parameter2 - Supplies an optional parameter regarding the crash.
  80. Parameter3 - Supplies an optional parameter regarding the crash.
  81. Parameter4 - Supplies an optional parameter regarding the crash.
  82. Return Value:
  83. None. This function does not return.
  84. --*/