jwareason.pas 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. {******************************************************************************}
  2. { }
  3. { Windows Shutdown Reason Codes interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: reason.h, released June 2000. The original Pascal }
  9. { code is: Reason.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. unit JwaReason;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "WinReg.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaWinType;
  51. // Reason flags
  52. // Flags used by the various UIs.
  53. const
  54. SHTDN_REASON_FLAG_COMMENT_REQUIRED = $01000000;
  55. {$EXTERNALSYM SHTDN_REASON_FLAG_COMMENT_REQUIRED}
  56. SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = $02000000;
  57. {$EXTERNALSYM SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED}
  58. SHTDN_REASON_FLAG_CLEAN_UI = $04000000;
  59. {$EXTERNALSYM SHTDN_REASON_FLAG_CLEAN_UI}
  60. SHTDN_REASON_FLAG_DIRTY_UI = $08000000;
  61. {$EXTERNALSYM SHTDN_REASON_FLAG_DIRTY_UI}
  62. // Flags that end up in the event log code.
  63. SHTDN_REASON_FLAG_USER_DEFINED = $40000000;
  64. {$EXTERNALSYM SHTDN_REASON_FLAG_USER_DEFINED}
  65. SHTDN_REASON_FLAG_PLANNED = DWORD($80000000);
  66. {$EXTERNALSYM SHTDN_REASON_FLAG_PLANNED}
  67. // Microsoft major reasons.
  68. SHTDN_REASON_MAJOR_OTHER = $00000000;
  69. {$EXTERNALSYM SHTDN_REASON_MAJOR_OTHER}
  70. SHTDN_REASON_MAJOR_NONE = $00000000;
  71. {$EXTERNALSYM SHTDN_REASON_MAJOR_NONE}
  72. SHTDN_REASON_MAJOR_HARDWARE = $00010000;
  73. {$EXTERNALSYM SHTDN_REASON_MAJOR_HARDWARE}
  74. SHTDN_REASON_MAJOR_OPERATINGSYSTEM = $00020000;
  75. {$EXTERNALSYM SHTDN_REASON_MAJOR_OPERATINGSYSTEM}
  76. SHTDN_REASON_MAJOR_SOFTWARE = $00030000;
  77. {$EXTERNALSYM SHTDN_REASON_MAJOR_SOFTWARE}
  78. SHTDN_REASON_MAJOR_APPLICATION = $00040000;
  79. {$EXTERNALSYM SHTDN_REASON_MAJOR_APPLICATION}
  80. SHTDN_REASON_MAJOR_SYSTEM = $00050000;
  81. {$EXTERNALSYM SHTDN_REASON_MAJOR_SYSTEM}
  82. SHTDN_REASON_MAJOR_POWER = $00060000;
  83. {$EXTERNALSYM SHTDN_REASON_MAJOR_POWER}
  84. SHTDN_REASON_MAJOR_LEGACY_API = $00070000;
  85. {$EXTERNALSYM SHTDN_REASON_MAJOR_LEGACY_API}
  86. // Microsoft minor reasons.
  87. SHTDN_REASON_MINOR_OTHER = $00000000;
  88. {$EXTERNALSYM SHTDN_REASON_MINOR_OTHER}
  89. SHTDN_REASON_MINOR_NONE = $000000ff;
  90. {$EXTERNALSYM SHTDN_REASON_MINOR_NONE}
  91. SHTDN_REASON_MINOR_MAINTENANCE = $00000001;
  92. {$EXTERNALSYM SHTDN_REASON_MINOR_MAINTENANCE}
  93. SHTDN_REASON_MINOR_INSTALLATION = $00000002;
  94. {$EXTERNALSYM SHTDN_REASON_MINOR_INSTALLATION}
  95. SHTDN_REASON_MINOR_UPGRADE = $00000003;
  96. {$EXTERNALSYM SHTDN_REASON_MINOR_UPGRADE}
  97. SHTDN_REASON_MINOR_RECONFIG = $00000004;
  98. {$EXTERNALSYM SHTDN_REASON_MINOR_RECONFIG}
  99. SHTDN_REASON_MINOR_HUNG = $00000005;
  100. {$EXTERNALSYM SHTDN_REASON_MINOR_HUNG}
  101. SHTDN_REASON_MINOR_UNSTABLE = $00000006;
  102. {$EXTERNALSYM SHTDN_REASON_MINOR_UNSTABLE}
  103. SHTDN_REASON_MINOR_DISK = $00000007;
  104. {$EXTERNALSYM SHTDN_REASON_MINOR_DISK}
  105. SHTDN_REASON_MINOR_PROCESSOR = $00000008;
  106. {$EXTERNALSYM SHTDN_REASON_MINOR_PROCESSOR}
  107. SHTDN_REASON_MINOR_NETWORKCARD = $00000009;
  108. {$EXTERNALSYM SHTDN_REASON_MINOR_NETWORKCARD}
  109. SHTDN_REASON_MINOR_POWER_SUPPLY = $0000000a;
  110. {$EXTERNALSYM SHTDN_REASON_MINOR_POWER_SUPPLY}
  111. SHTDN_REASON_MINOR_CORDUNPLUGGED = $0000000b;
  112. {$EXTERNALSYM SHTDN_REASON_MINOR_CORDUNPLUGGED}
  113. SHTDN_REASON_MINOR_ENVIRONMENT = $0000000c;
  114. {$EXTERNALSYM SHTDN_REASON_MINOR_ENVIRONMENT}
  115. SHTDN_REASON_MINOR_HARDWARE_DRIVER = $0000000d;
  116. {$EXTERNALSYM SHTDN_REASON_MINOR_HARDWARE_DRIVER}
  117. SHTDN_REASON_MINOR_OTHERDRIVER = $0000000e;
  118. {$EXTERNALSYM SHTDN_REASON_MINOR_OTHERDRIVER}
  119. SHTDN_REASON_MINOR_BLUESCREEN = $0000000F;
  120. {$EXTERNALSYM SHTDN_REASON_MINOR_BLUESCREEN}
  121. SHTDN_REASON_MINOR_SERVICEPACK = $00000010;
  122. {$EXTERNALSYM SHTDN_REASON_MINOR_SERVICEPACK}
  123. SHTDN_REASON_MINOR_HOTFIX = $00000011;
  124. {$EXTERNALSYM SHTDN_REASON_MINOR_HOTFIX}
  125. SHTDN_REASON_MINOR_SECURITYFIX = $00000012;
  126. {$EXTERNALSYM SHTDN_REASON_MINOR_SECURITYFIX}
  127. SHTDN_REASON_MINOR_SECURITY = $00000013;
  128. {$EXTERNALSYM SHTDN_REASON_MINOR_SECURITY}
  129. SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY = $00000014;
  130. {$EXTERNALSYM SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY}
  131. SHTDN_REASON_MINOR_WMI = $00000015;
  132. {$EXTERNALSYM SHTDN_REASON_MINOR_WMI}
  133. SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL = $00000016;
  134. {$EXTERNALSYM SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL}
  135. SHTDN_REASON_MINOR_HOTFIX_UNINSTALL = $00000017;
  136. {$EXTERNALSYM SHTDN_REASON_MINOR_HOTFIX_UNINSTALL}
  137. SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL = $00000018;
  138. {$EXTERNALSYM SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL}
  139. SHTDN_REASON_MINOR_MMC = $00000019;
  140. {$EXTERNALSYM SHTDN_REASON_MINOR_MMC}
  141. SHTDN_REASON_MINOR_TERMSRV = $00000020;
  142. {$EXTERNALSYM SHTDN_REASON_MINOR_TERMSRV}
  143. SHTDN_REASON_MINOR_DC_PROMOTION = $00000021;
  144. {$EXTERNALSYM SHTDN_REASON_MINOR_DC_PROMOTION}
  145. SHTDN_REASON_MINOR_DC_DEMOTION = $00000022;
  146. {$EXTERNALSYM SHTDN_REASON_MINOR_DC_DEMOTION}
  147. SHTDN_REASON_UNKNOWN = SHTDN_REASON_MINOR_NONE;
  148. {$EXTERNALSYM SHTDN_REASON_UNKNOWN}
  149. SHTDN_REASON_LEGACY_API = SHTDN_REASON_MAJOR_LEGACY_API or SHTDN_REASON_FLAG_PLANNED;
  150. {$EXTERNALSYM SHTDN_REASON_LEGACY_API}
  151. // This mask cuts out UI flags.
  152. SHTDN_REASON_VALID_BIT_MASK = DWORD($c0ffffff);
  153. {$EXTERNALSYM SHTDN_REASON_VALID_BIT_MASK}
  154. // Convenience flags.
  155. PCLEANUI = SHTDN_REASON_FLAG_PLANNED or SHTDN_REASON_FLAG_CLEAN_UI;
  156. {$EXTERNALSYM PCLEANUI}
  157. UCLEANUI = SHTDN_REASON_FLAG_CLEAN_UI;
  158. {$EXTERNALSYM UCLEANUI}
  159. PDIRTYUI = SHTDN_REASON_FLAG_PLANNED or SHTDN_REASON_FLAG_DIRTY_UI;
  160. {$EXTERNALSYM PDIRTYUI}
  161. UDIRTYUI = SHTDN_REASON_FLAG_DIRTY_UI;
  162. {$EXTERNALSYM UDIRTYUI}
  163. (*
  164. * Maximum character lengths for reason name, description, problem id, and
  165. * comment respectively.
  166. *)
  167. MAX_REASON_NAME_LEN = 64;
  168. {$EXTERNALSYM MAX_REASON_NAME_LEN}
  169. MAX_REASON_DESC_LEN = 256;
  170. {$EXTERNALSYM MAX_REASON_DESC_LEN}
  171. MAX_REASON_BUGID_LEN = 32;
  172. {$EXTERNALSYM MAX_REASON_BUGID_LEN}
  173. MAX_REASON_COMMENT_LEN = 512;
  174. {$EXTERNALSYM MAX_REASON_COMMENT_LEN}
  175. SHUTDOWN_TYPE_LEN = 32;
  176. {$EXTERNALSYM SHUTDOWN_TYPE_LEN}
  177. (*
  178. * S.E.T. policy value
  179. *
  180. *)
  181. POLICY_SHOWREASONUI_NEVER = 0;
  182. {$EXTERNALSYM POLICY_SHOWREASONUI_NEVER}
  183. POLICY_SHOWREASONUI_ALWAYS = 1;
  184. {$EXTERNALSYM POLICY_SHOWREASONUI_ALWAYS}
  185. POLICY_SHOWREASONUI_WORKSTATIONONLY = 2;
  186. {$EXTERNALSYM POLICY_SHOWREASONUI_WORKSTATIONONLY}
  187. POLICY_SHOWREASONUI_SERVERONLY = 3;
  188. {$EXTERNALSYM POLICY_SHOWREASONUI_SERVERONLY}
  189. (*
  190. * Snapshot policy values
  191. *)
  192. SNAPSHOT_POLICY_NEVER = 0;
  193. {$EXTERNALSYM SNAPSHOT_POLICY_NEVER}
  194. SNAPSHOT_POLICY_ALWAYS = 1;
  195. {$EXTERNALSYM SNAPSHOT_POLICY_ALWAYS}
  196. SNAPSHOT_POLICY_UNPLANNED = 2;
  197. {$EXTERNALSYM SNAPSHOT_POLICY_UNPLANNED}
  198. (*
  199. * Maximue user defined reasons
  200. *)
  201. MAX_NUM_REASONS = 256;
  202. {$EXTERNALSYM MAX_NUM_REASONS}
  203. implementation
  204. end.