JwaReason.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:9k
源码类别:

Windows编程

开发平台:

Delphi

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