' ########################################################################################
' Microsoft Windows
' File: Reason.inc
' Contents: Shutdown reason code values
' Copyright (c) 2010 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_Reason_PBI)
#DEFINE PBX_Reason_PBI
%EQUATE `REASON_INC = 1
'// Reason flags
'// Flags used by the various UIs.
%EQUATE `SHTDN_REASON_FLAG_COMMENT_REQUIRED = &H01000000
%EQUATE `SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = &H02000000
%EQUATE `SHTDN_REASON_FLAG_CLEAN_UI = &H04000000
%EQUATE `SHTDN_REASON_FLAG_DIRTY_UI = &H08000000
'// Flags that end up in the event log code.
%EQUATE `SHTDN_REASON_FLAG_USER_DEFINED = &H40000000
%EQUATE `SHTDN_REASON_FLAG_PLANNED = &H80000000
'// Microsoft major reasons.
%EQUATE `SHTDN_REASON_MAJOR_OTHER = &H00000000
%EQUATE `SHTDN_REASON_MAJOR_NONE = &H00000000
%EQUATE `SHTDN_REASON_MAJOR_HARDWARE = &H00010000
%EQUATE `SHTDN_REASON_MAJOR_OPERATINGSYSTEM = &H00020000
%EQUATE `SHTDN_REASON_MAJOR_SOFTWARE = &H00030000
%EQUATE `SHTDN_REASON_MAJOR_APPLICATION = &H00040000
%EQUATE `SHTDN_REASON_MAJOR_SYSTEM = &H00050000
%EQUATE `SHTDN_REASON_MAJOR_POWER = &H00060000
%EQUATE `SHTDN_REASON_MAJOR_LEGACY_API = &H00070000
'// Microsoft minor reasons.
%EQUATE `SHTDN_REASON_MINOR_OTHER = &H00000000
%EQUATE `SHTDN_REASON_MINOR_NONE = &H000000ff
%EQUATE `SHTDN_REASON_MINOR_MAINTENANCE = &H00000001
%EQUATE `SHTDN_REASON_MINOR_INSTALLATION = &H00000002
%EQUATE `SHTDN_REASON_MINOR_UPGRADE = &H00000003
%EQUATE `SHTDN_REASON_MINOR_RECONFIG = &H00000004
%EQUATE `SHTDN_REASON_MINOR_HUNG = &H00000005
%EQUATE `SHTDN_REASON_MINOR_UNSTABLE = &H00000006
%EQUATE `SHTDN_REASON_MINOR_DISK = &H00000007
%EQUATE `SHTDN_REASON_MINOR_PROCESSOR = &H00000008
%EQUATE `SHTDN_REASON_MINOR_NETWORKCARD = &H00000009
%EQUATE `SHTDN_REASON_MINOR_POWER_SUPPLY = &H0000000a
%EQUATE `SHTDN_REASON_MINOR_CORDUNPLUGGED = &H0000000b
%EQUATE `SHTDN_REASON_MINOR_ENVIRONMENT = &H0000000c
%EQUATE `SHTDN_REASON_MINOR_HARDWARE_DRIVER = &H0000000d
%EQUATE `SHTDN_REASON_MINOR_OTHERDRIVER = &H0000000e
%EQUATE `SHTDN_REASON_MINOR_BLUESCREEN = &H0000000F
%EQUATE `SHTDN_REASON_MINOR_SERVICEPACK = &H00000010
%EQUATE `SHTDN_REASON_MINOR_HOTFIX = &H00000011
%EQUATE `SHTDN_REASON_MINOR_SECURITYFIX = &H00000012
%EQUATE `SHTDN_REASON_MINOR_SECURITY = &H00000013
%EQUATE `SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY = &H00000014
%EQUATE `SHTDN_REASON_MINOR_WMI = &H00000015
%EQUATE `SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL = &H00000016
%EQUATE `SHTDN_REASON_MINOR_HOTFIX_UNINSTALL = &H00000017
%EQUATE `SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL = &H00000018
%EQUATE `SHTDN_REASON_MINOR_MMC = &H00000019
%EQUATE `SHTDN_REASON_MINOR_SYSTEMRESTORE = &H0000001a
%EQUATE `SHTDN_REASON_MINOR_TERMSRV = &H00000020
%EQUATE `SHTDN_REASON_MINOR_DC_PROMOTION = &H00000021
%EQUATE `SHTDN_REASON_MINOR_DC_DEMOTION = &H00000022
%EQUATE `SHTDN_REASON_UNKNOWN = %SHTDN_REASON_MINOR_NONE
%EQUATE `SHTDN_REASON_LEGACY_API = %SHTDN_REASON_MAJOR_LEGACY_API OR %SHTDN_REASON_FLAG_PLANNED
'// This mask cuts out UI flags.
%EQUATE `SHTDN_REASON_VALID_BIT_MASK = &Hc0ffffff
'// Convenience flags.
%EQUATE `PCLEANUI = %SHTDN_REASON_FLAG_PLANNED OR %SHTDN_REASON_FLAG_CLEAN_UI
%EQUATE `UCLEANUI = %SHTDN_REASON_FLAG_CLEAN_UI
%EQUATE `PDIRTYUI = %SHTDN_REASON_FLAG_PLANNED OR %SHTDN_REASON_FLAG_DIRTY_UI
%EQUATE `UDIRTYUI = %SHTDN_REASON_FLAG_DIRTY_UI
'/*
' * Maximum character lengths for reason name, description, problem id, and
' * comment respectively.
' */
%EQUATE `MAX_REASON_NAME_LEN = 64
%EQUATE `MAX_REASON_DESC_LEN = 256
%EQUATE `MAX_REASON_BUGID_LEN = 32
%EQUATE `MAX_REASON_COMMENT_LEN = 512
%EQUATE `SHUTDOWN_TYPE_LEN = 32
'/*
' * S.E.T. policy value
' *
' */
%EQUATE `POLICY_SHOWREASONUI_NEVER = 0
%EQUATE `POLICY_SHOWREASONUI_ALWAYS = 1
%EQUATE `POLICY_SHOWREASONUI_WORKSTATIONONLY = 2
%EQUATE `POLICY_SHOWREASONUI_SERVERONLY = 3
'/*
' * Snapshot policy values
' */
%EQUATE `SNAPSHOT_POLICY_NEVER = 0
%EQUATE `SNAPSHOT_POLICY_ALWAYS = 1
%EQUATE `SNAPSHOT_POLICY_UNPLANNED = 2
'/*
' * Maximue user defined reasons
' */
%EQUATE `MAX_NUM_REASONS = 256
#ENDIF
