Leaked source code of windows server 2003
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.

115 lines
4.6 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: reason.h
  7. //
  8. // Contents: Shutdown reason code values.
  9. //
  10. // History: 8-00 Created Hughleat
  11. //
  12. //--------------------------------------------------------------------
  13. #if !defined SENTINEL_Reason
  14. # define SENTINEL_Reason
  15. // Reason flags
  16. // Flags used by the various UIs.
  17. #define SHTDN_REASON_FLAG_COMMENT_REQUIRED 0x01000000
  18. #define SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED 0x02000000
  19. #define SHTDN_REASON_FLAG_CLEAN_UI 0x04000000
  20. #define SHTDN_REASON_FLAG_DIRTY_UI 0x08000000
  21. // Flags that end up in the event log code.
  22. #define SHTDN_REASON_FLAG_USER_DEFINED 0x40000000
  23. #define SHTDN_REASON_FLAG_PLANNED 0x80000000
  24. // Microsoft major reasons.
  25. #define SHTDN_REASON_MAJOR_OTHER 0x00000000
  26. #define SHTDN_REASON_MAJOR_NONE 0x00000000
  27. #define SHTDN_REASON_MAJOR_HARDWARE 0x00010000
  28. #define SHTDN_REASON_MAJOR_OPERATINGSYSTEM 0x00020000
  29. #define SHTDN_REASON_MAJOR_SOFTWARE 0x00030000
  30. #define SHTDN_REASON_MAJOR_APPLICATION 0x00040000
  31. #define SHTDN_REASON_MAJOR_SYSTEM 0x00050000
  32. #define SHTDN_REASON_MAJOR_POWER 0x00060000
  33. #define SHTDN_REASON_MAJOR_LEGACY_API 0x00070000
  34. // Microsoft minor reasons.
  35. #define SHTDN_REASON_MINOR_OTHER 0x00000000
  36. #define SHTDN_REASON_MINOR_NONE 0x000000ff
  37. #define SHTDN_REASON_MINOR_MAINTENANCE 0x00000001
  38. #define SHTDN_REASON_MINOR_INSTALLATION 0x00000002
  39. #define SHTDN_REASON_MINOR_UPGRADE 0x00000003
  40. #define SHTDN_REASON_MINOR_RECONFIG 0x00000004
  41. #define SHTDN_REASON_MINOR_HUNG 0x00000005
  42. #define SHTDN_REASON_MINOR_UNSTABLE 0x00000006
  43. #define SHTDN_REASON_MINOR_DISK 0x00000007
  44. #define SHTDN_REASON_MINOR_PROCESSOR 0x00000008
  45. #define SHTDN_REASON_MINOR_NETWORKCARD 0x00000009
  46. #define SHTDN_REASON_MINOR_POWER_SUPPLY 0x0000000a
  47. #define SHTDN_REASON_MINOR_CORDUNPLUGGED 0x0000000b
  48. #define SHTDN_REASON_MINOR_ENVIRONMENT 0x0000000c
  49. #define SHTDN_REASON_MINOR_HARDWARE_DRIVER 0x0000000d
  50. #define SHTDN_REASON_MINOR_OTHERDRIVER 0x0000000e
  51. #define SHTDN_REASON_MINOR_BLUESCREEN 0x0000000F
  52. #define SHTDN_REASON_MINOR_SERVICEPACK 0x00000010
  53. #define SHTDN_REASON_MINOR_HOTFIX 0x00000011
  54. #define SHTDN_REASON_MINOR_SECURITYFIX 0x00000012
  55. #define SHTDN_REASON_MINOR_SECURITY 0x00000013
  56. #define SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY 0x00000014
  57. #define SHTDN_REASON_MINOR_WMI 0x00000015
  58. #define SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL 0x00000016
  59. #define SHTDN_REASON_MINOR_HOTFIX_UNINSTALL 0x00000017
  60. #define SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL 0x00000018
  61. #define SHTDN_REASON_MINOR_MMC 0x00000019
  62. #define SHTDN_REASON_MINOR_TERMSRV 0x00000020
  63. #define SHTDN_REASON_MINOR_DC_PROMOTION 0x00000021
  64. #define SHTDN_REASON_MINOR_DC_DEMOTION 0x00000022
  65. #define SHTDN_REASON_UNKNOWN SHTDN_REASON_MINOR_NONE
  66. #define SHTDN_REASON_LEGACY_API (SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED)
  67. // This mask cuts out UI flags.
  68. #define SHTDN_REASON_VALID_BIT_MASK 0xc0ffffff
  69. // Convenience flags.
  70. #define PCLEANUI (SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_CLEAN_UI)
  71. #define UCLEANUI (SHTDN_REASON_FLAG_CLEAN_UI)
  72. #define PDIRTYUI (SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_DIRTY_UI)
  73. #define UDIRTYUI (SHTDN_REASON_FLAG_DIRTY_UI)
  74. /*
  75. * Maximum character lengths for reason name, description, problem id, and
  76. * comment respectively.
  77. */
  78. #define MAX_REASON_NAME_LEN 64
  79. #define MAX_REASON_DESC_LEN 256
  80. #define MAX_REASON_BUGID_LEN 32
  81. #define MAX_REASON_COMMENT_LEN 512
  82. #define SHUTDOWN_TYPE_LEN 32
  83. /*
  84. * S.E.T. policy value
  85. *
  86. */
  87. #define POLICY_SHOWREASONUI_NEVER 0
  88. #define POLICY_SHOWREASONUI_ALWAYS 1
  89. #define POLICY_SHOWREASONUI_WORKSTATIONONLY 2
  90. #define POLICY_SHOWREASONUI_SERVERONLY 3
  91. /*
  92. * Snapshot policy values
  93. */
  94. #define SNAPSHOT_POLICY_NEVER 0
  95. #define SNAPSHOT_POLICY_ALWAYS 1
  96. #define SNAPSHOT_POLICY_UNPLANNED 2
  97. /*
  98. * Maximue user defined reasons
  99. */
  100. #define MAX_NUM_REASONS 256
  101. #endif // !defined SENTINEL_Reason