jwareason.pas 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. // $Id: JwaReason.pas,v 1.8 2005/09/04 07:02:38 marquardt Exp $
  43. {$IFNDEF JWA_INCLUDEMODE}
  44. unit JwaReason;
  45. {$WEAKPACKAGEUNIT}
  46. {$I jediapilib.inc}
  47. interface
  48. uses
  49. JwaWinType;
  50. {$ENDIF !JWA_INCLUDEMODE}
  51. {$IFDEF JWA_INTERFACESECTION}
  52. {$HPPEMIT ''}
  53. {$HPPEMIT '#include "WinReg.h"'}
  54. {$HPPEMIT ''}
  55. // Reason flags
  56. // Flags used by the various UIs.
  57. const
  58. SHTDN_REASON_FLAG_COMMENT_REQUIRED = $01000000;
  59. {$EXTERNALSYM SHTDN_REASON_FLAG_COMMENT_REQUIRED}
  60. SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = $02000000;
  61. {$EXTERNALSYM SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED}
  62. SHTDN_REASON_FLAG_CLEAN_UI = $04000000;
  63. {$EXTERNALSYM SHTDN_REASON_FLAG_CLEAN_UI}
  64. SHTDN_REASON_FLAG_DIRTY_UI = $08000000;
  65. {$EXTERNALSYM SHTDN_REASON_FLAG_DIRTY_UI}
  66. // Flags that end up in the event log code.
  67. SHTDN_REASON_FLAG_USER_DEFINED = $40000000;
  68. {$EXTERNALSYM SHTDN_REASON_FLAG_USER_DEFINED}
  69. SHTDN_REASON_FLAG_PLANNED = DWORD($80000000);
  70. {$EXTERNALSYM SHTDN_REASON_FLAG_PLANNED}
  71. // Microsoft major reasons.
  72. SHTDN_REASON_MAJOR_OTHER = $00000000;
  73. {$EXTERNALSYM SHTDN_REASON_MAJOR_OTHER}
  74. SHTDN_REASON_MAJOR_NONE = $00000000;
  75. {$EXTERNALSYM SHTDN_REASON_MAJOR_NONE}
  76. SHTDN_REASON_MAJOR_HARDWARE = $00010000;
  77. {$EXTERNALSYM SHTDN_REASON_MAJOR_HARDWARE}
  78. SHTDN_REASON_MAJOR_OPERATINGSYSTEM = $00020000;
  79. {$EXTERNALSYM SHTDN_REASON_MAJOR_OPERATINGSYSTEM}
  80. SHTDN_REASON_MAJOR_SOFTWARE = $00030000;
  81. {$EXTERNALSYM SHTDN_REASON_MAJOR_SOFTWARE}
  82. SHTDN_REASON_MAJOR_APPLICATION = $00040000;
  83. {$EXTERNALSYM SHTDN_REASON_MAJOR_APPLICATION}
  84. SHTDN_REASON_MAJOR_SYSTEM = $00050000;
  85. {$EXTERNALSYM SHTDN_REASON_MAJOR_SYSTEM}
  86. SHTDN_REASON_MAJOR_POWER = $00060000;
  87. {$EXTERNALSYM SHTDN_REASON_MAJOR_POWER}
  88. SHTDN_REASON_MAJOR_LEGACY_API = $00070000;
  89. {$EXTERNALSYM SHTDN_REASON_MAJOR_LEGACY_API}
  90. // Microsoft minor reasons.
  91. SHTDN_REASON_MINOR_OTHER = $00000000;
  92. {$EXTERNALSYM SHTDN_REASON_MINOR_OTHER}
  93. SHTDN_REASON_MINOR_NONE = $000000ff;
  94. {$EXTERNALSYM SHTDN_REASON_MINOR_NONE}
  95. SHTDN_REASON_MINOR_MAINTENANCE = $00000001;
  96. {$EXTERNALSYM SHTDN_REASON_MINOR_MAINTENANCE}
  97. SHTDN_REASON_MINOR_INSTALLATION = $00000002;
  98. {$EXTERNALSYM SHTDN_REASON_MINOR_INSTALLATION}
  99. SHTDN_REASON_MINOR_UPGRADE = $00000003;
  100. {$EXTERNALSYM SHTDN_REASON_MINOR_UPGRADE}
  101. SHTDN_REASON_MINOR_RECONFIG = $00000004;
  102. {$EXTERNALSYM SHTDN_REASON_MINOR_RECONFIG}
  103. SHTDN_REASON_MINOR_HUNG = $00000005;
  104. {$EXTERNALSYM SHTDN_REASON_MINOR_HUNG}
  105. SHTDN_REASON_MINOR_UNSTABLE = $00000006;
  106. {$EXTERNALSYM SHTDN_REASON_MINOR_UNSTABLE}
  107. SHTDN_REASON_MINOR_DISK = $00000007;
  108. {$EXTERNALSYM SHTDN_REASON_MINOR_DISK}
  109. SHTDN_REASON_MINOR_PROCESSOR = $00000008;
  110. {$EXTERNALSYM SHTDN_REASON_MINOR_PROCESSOR}
  111. SHTDN_REASON_MINOR_NETWORKCARD = $00000009;
  112. {$EXTERNALSYM SHTDN_REASON_MINOR_NETWORKCARD}
  113. SHTDN_REASON_MINOR_POWER_SUPPLY = $0000000a;
  114. {$EXTERNALSYM SHTDN_REASON_MINOR_POWER_SUPPLY}
  115. SHTDN_REASON_MINOR_CORDUNPLUGGED = $0000000b;
  116. {$EXTERNALSYM SHTDN_REASON_MINOR_CORDUNPLUGGED}
  117. SHTDN_REASON_MINOR_ENVIRONMENT = $0000000c;
  118. {$EXTERNALSYM SHTDN_REASON_MINOR_ENVIRONMENT}
  119. SHTDN_REASON_MINOR_HARDWARE_DRIVER = $0000000d;
  120. {$EXTERNALSYM SHTDN_REASON_MINOR_HARDWARE_DRIVER}
  121. SHTDN_REASON_MINOR_OTHERDRIVER = $0000000e;
  122. {$EXTERNALSYM SHTDN_REASON_MINOR_OTHERDRIVER}
  123. SHTDN_REASON_MINOR_BLUESCREEN = $0000000F;
  124. {$EXTERNALSYM SHTDN_REASON_MINOR_BLUESCREEN}
  125. SHTDN_REASON_MINOR_SERVICEPACK = $00000010;
  126. {$EXTERNALSYM SHTDN_REASON_MINOR_SERVICEPACK}
  127. SHTDN_REASON_MINOR_HOTFIX = $00000011;
  128. {$EXTERNALSYM SHTDN_REASON_MINOR_HOTFIX}
  129. SHTDN_REASON_MINOR_SECURITYFIX = $00000012;
  130. {$EXTERNALSYM SHTDN_REASON_MINOR_SECURITYFIX}
  131. SHTDN_REASON_MINOR_SECURITY = $00000013;
  132. {$EXTERNALSYM SHTDN_REASON_MINOR_SECURITY}
  133. SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY = $00000014;
  134. {$EXTERNALSYM SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY}
  135. SHTDN_REASON_MINOR_WMI = $00000015;
  136. {$EXTERNALSYM SHTDN_REASON_MINOR_WMI}
  137. SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL = $00000016;
  138. {$EXTERNALSYM SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL}
  139. SHTDN_REASON_MINOR_HOTFIX_UNINSTALL = $00000017;
  140. {$EXTERNALSYM SHTDN_REASON_MINOR_HOTFIX_UNINSTALL}
  141. SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL = $00000018;
  142. {$EXTERNALSYM SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL}
  143. SHTDN_REASON_MINOR_MMC = $00000019;
  144. {$EXTERNALSYM SHTDN_REASON_MINOR_MMC}
  145. SHTDN_REASON_MINOR_TERMSRV = $00000020;
  146. {$EXTERNALSYM SHTDN_REASON_MINOR_TERMSRV}
  147. SHTDN_REASON_MINOR_DC_PROMOTION = $00000021;
  148. {$EXTERNALSYM SHTDN_REASON_MINOR_DC_PROMOTION}
  149. SHTDN_REASON_MINOR_DC_DEMOTION = $00000022;
  150. {$EXTERNALSYM SHTDN_REASON_MINOR_DC_DEMOTION}
  151. SHTDN_REASON_UNKNOWN = SHTDN_REASON_MINOR_NONE;
  152. {$EXTERNALSYM SHTDN_REASON_UNKNOWN}
  153. SHTDN_REASON_LEGACY_API = SHTDN_REASON_MAJOR_LEGACY_API or SHTDN_REASON_FLAG_PLANNED;
  154. {$EXTERNALSYM SHTDN_REASON_LEGACY_API}
  155. // This mask cuts out UI flags.
  156. SHTDN_REASON_VALID_BIT_MASK = DWORD($c0ffffff);
  157. {$EXTERNALSYM SHTDN_REASON_VALID_BIT_MASK}
  158. // Convenience flags.
  159. PCLEANUI = SHTDN_REASON_FLAG_PLANNED or SHTDN_REASON_FLAG_CLEAN_UI;
  160. {$EXTERNALSYM PCLEANUI}
  161. UCLEANUI = SHTDN_REASON_FLAG_CLEAN_UI;
  162. {$EXTERNALSYM UCLEANUI}
  163. PDIRTYUI = SHTDN_REASON_FLAG_PLANNED or SHTDN_REASON_FLAG_DIRTY_UI;
  164. {$EXTERNALSYM PDIRTYUI}
  165. UDIRTYUI = SHTDN_REASON_FLAG_DIRTY_UI;
  166. {$EXTERNALSYM UDIRTYUI}
  167. (*
  168. * Maximum character lengths for reason name, description, problem id, and
  169. * comment respectively.
  170. *)
  171. MAX_REASON_NAME_LEN = 64;
  172. {$EXTERNALSYM MAX_REASON_NAME_LEN}
  173. MAX_REASON_DESC_LEN = 256;
  174. {$EXTERNALSYM MAX_REASON_DESC_LEN}
  175. MAX_REASON_BUGID_LEN = 32;
  176. {$EXTERNALSYM MAX_REASON_BUGID_LEN}
  177. MAX_REASON_COMMENT_LEN = 512;
  178. {$EXTERNALSYM MAX_REASON_COMMENT_LEN}
  179. SHUTDOWN_TYPE_LEN = 32;
  180. {$EXTERNALSYM SHUTDOWN_TYPE_LEN}
  181. (*
  182. * S.E.T. policy value
  183. *
  184. *)
  185. POLICY_SHOWREASONUI_NEVER = 0;
  186. {$EXTERNALSYM POLICY_SHOWREASONUI_NEVER}
  187. POLICY_SHOWREASONUI_ALWAYS = 1;
  188. {$EXTERNALSYM POLICY_SHOWREASONUI_ALWAYS}
  189. POLICY_SHOWREASONUI_WORKSTATIONONLY = 2;
  190. {$EXTERNALSYM POLICY_SHOWREASONUI_WORKSTATIONONLY}
  191. POLICY_SHOWREASONUI_SERVERONLY = 3;
  192. {$EXTERNALSYM POLICY_SHOWREASONUI_SERVERONLY}
  193. (*
  194. * Snapshot policy values
  195. *)
  196. SNAPSHOT_POLICY_NEVER = 0;
  197. {$EXTERNALSYM SNAPSHOT_POLICY_NEVER}
  198. SNAPSHOT_POLICY_ALWAYS = 1;
  199. {$EXTERNALSYM SNAPSHOT_POLICY_ALWAYS}
  200. SNAPSHOT_POLICY_UNPLANNED = 2;
  201. {$EXTERNALSYM SNAPSHOT_POLICY_UNPLANNED}
  202. (*
  203. * Maximue user defined reasons
  204. *)
  205. MAX_NUM_REASONS = 256;
  206. {$EXTERNALSYM MAX_NUM_REASONS}
  207. {$ENDIF JWA_INTERFACESECTION}
  208. {$IFNDEF JWA_INCLUDEMODE}
  209. implementation
  210. {$ENDIF !JWA_INCLUDEMODE}
  211. {$IFDEF JWA_IMPLEMENTATIONSECTION}
  212. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  213. {$IFNDEF JWA_INCLUDEMODE}
  214. end.
  215. {$ENDIF !JWA_INCLUDEMODE}