crash.h 3.3 KB

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