using System; namespace Vanara.PInvoke { /// Flags used in the ExitWindowsEx, InitiateShutdown and InitiateSystemShutdownEx functions. [PInvokeData("reason.h")] [Flags] public enum SystemShutDownReason : uint { /// The SHTDN reason flag comment required SHTDN_REASON_FLAG_COMMENT_REQUIRED = 0x01000000, /// The SHTDN reason flag dirty problem identifier required SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = 0x02000000, /// The SHTDN reason flag clean UI SHTDN_REASON_FLAG_CLEAN_UI = 0x04000000, /// The SHTDN reason flag dirty UI SHTDN_REASON_FLAG_DIRTY_UI = 0x08000000, /// The SHTDN reason flag mobile UI reserved SHTDN_REASON_FLAG_MOBILE_UI_RESERVED = 0x10000000, /// /// The reason code is defined by the user. For more information, see Defining a Custom Reason Code. If this flag is not present, the /// reason code is defined by the system. /// SHTDN_REASON_FLAG_USER_DEFINED = 0x40000000, /// /// The shutdown was planned. The system generates a System State Data (SSD) file. This file contains system state information such /// as the processes, threads, memory usage, and configuration. /// /// If this flag is not present, the shutdown was unplanned. Notification and reporting options are controlled by a set of policies. /// For example, after logging in, the system displays a dialog box reporting the unplanned shutdown if the policy has been enabled. /// An SSD file is created only if the SSD policy is enabled on the system. The administrator can use Windows Error Reporting to send /// the SSD data to a central location, or to Microsoft. /// /// SHTDN_REASON_FLAG_PLANNED = 0x80000000, /// Other issue. SHTDN_REASON_MAJOR_OTHER = 0x00000000, /// No issue. SHTDN_REASON_MAJOR_NONE = 0x00000000, /// Hardware issue. SHTDN_REASON_MAJOR_HARDWARE = 0x00010000, /// Operating system issue. SHTDN_REASON_MAJOR_OPERATINGSYSTEM = 0x00020000, /// Software issue. SHTDN_REASON_MAJOR_SOFTWARE = 0x00030000, /// Application issue. SHTDN_REASON_MAJOR_APPLICATION = 0x00040000, /// System failure. SHTDN_REASON_MAJOR_SYSTEM = 0x00050000, /// Power failure. SHTDN_REASON_MAJOR_POWER = 0x00060000, /// The InitiateSystemShutdown function was used instead of InitiateSystemShutdownEx. SHTDN_REASON_MAJOR_LEGACY_API = 0x00070000, /// Other issue. SHTDN_REASON_MINOR_OTHER = 0x00000000, /// The SHTDN reason minor none SHTDN_REASON_MINOR_NONE = 0x000000ff, /// Maintenance. SHTDN_REASON_MINOR_MAINTENANCE = 0x00000001, /// Installation. SHTDN_REASON_MINOR_INSTALLATION = 0x00000002, /// Upgrade. SHTDN_REASON_MINOR_UPGRADE = 0x00000003, /// Reconfigure. SHTDN_REASON_MINOR_RECONFIG = 0x00000004, /// Unresponsive. SHTDN_REASON_MINOR_HUNG = 0x00000005, /// Unstable. SHTDN_REASON_MINOR_UNSTABLE = 0x00000006, /// Disk. SHTDN_REASON_MINOR_DISK = 0x00000007, /// Processor. SHTDN_REASON_MINOR_PROCESSOR = 0x00000008, /// Network card. SHTDN_REASON_MINOR_NETWORKCARD = 0x00000009, /// Power supply. SHTDN_REASON_MINOR_POWER_SUPPLY = 0x0000000a, /// Unplugged. SHTDN_REASON_MINOR_CORDUNPLUGGED = 0x0000000b, /// Environment. SHTDN_REASON_MINOR_ENVIRONMENT = 0x0000000c, /// Driver. SHTDN_REASON_MINOR_HARDWARE_DRIVER = 0x0000000d, /// Other driver event. SHTDN_REASON_MINOR_OTHERDRIVER = 0x0000000e, /// Blue screen crash event. SHTDN_REASON_MINOR_BLUESCREEN = 0x0000000F, /// Service pack. SHTDN_REASON_MINOR_SERVICEPACK = 0x00000010, /// Hot fix. SHTDN_REASON_MINOR_HOTFIX = 0x00000011, /// Security patch. SHTDN_REASON_MINOR_SECURITYFIX = 0x00000012, /// Security issue. SHTDN_REASON_MINOR_SECURITY = 0x00000013, /// Network connectivity. SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY = 0x00000014, /// WMI issue. SHTDN_REASON_MINOR_WMI = 0x00000015, /// Service pack uninstallation. SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL = 0x00000016, /// Hot fix uninstallation. SHTDN_REASON_MINOR_HOTFIX_UNINSTALL = 0x00000017, /// Security patch uninstallation. SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL = 0x00000018, /// MMC issue. SHTDN_REASON_MINOR_MMC = 0x00000019, /// System restore. SHTDN_REASON_MINOR_SYSTEMRESTORE = 0x0000001a, /// Terminal Services. SHTDN_REASON_MINOR_TERMSRV = 0x00000020, /// DC promotion. SHTDN_REASON_MINOR_DC_PROMOTION = 0x00000021, /// DC demotion. SHTDN_REASON_MINOR_DC_DEMOTION = 0x00000022, /// Unknown. SHTDN_REASON_UNKNOWN = SHTDN_REASON_MINOR_NONE, /// The InitiateSystemShutdown function was used instead of InitiateSystemShutdownEx. SHTDN_REASON_LEGACY_API = SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED } }