2017-11-27 12:18:01 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Vanara.PInvoke
|
|
|
|
|
{
|
|
|
|
|
/// <summary>Flags used in the ExitWindowsEx, InitiateShutdown and InitiateSystemShutdownEx functions.</summary>
|
2019-09-05 21:59:25 -04:00
|
|
|
|
[PInvokeData("reason.h")]
|
2017-11-27 12:18:01 -05:00
|
|
|
|
[Flags]
|
|
|
|
|
public enum SystemShutDownReason : uint
|
|
|
|
|
{
|
|
|
|
|
/// <summary>The SHTDN reason flag comment required</summary>
|
|
|
|
|
SHTDN_REASON_FLAG_COMMENT_REQUIRED = 0x01000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The SHTDN reason flag dirty problem identifier required</summary>
|
|
|
|
|
SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = 0x02000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The SHTDN reason flag clean UI</summary>
|
|
|
|
|
SHTDN_REASON_FLAG_CLEAN_UI = 0x04000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The SHTDN reason flag dirty UI</summary>
|
|
|
|
|
SHTDN_REASON_FLAG_DIRTY_UI = 0x08000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The SHTDN reason flag mobile UI reserved</summary>
|
|
|
|
|
SHTDN_REASON_FLAG_MOBILE_UI_RESERVED = 0x10000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>
|
2018-11-19 23:18:50 -05:00
|
|
|
|
/// 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.
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
SHTDN_REASON_FLAG_USER_DEFINED = 0x40000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>
|
2018-11-19 23:18:50 -05:00
|
|
|
|
/// 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.
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <para>
|
2018-11-19 23:18:50 -05:00
|
|
|
|
/// 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.
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
SHTDN_REASON_FLAG_PLANNED = 0x80000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Other issue.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_OTHER = 0x00000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>No issue.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_NONE = 0x00000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Hardware issue.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_HARDWARE = 0x00010000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Operating system issue.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_OPERATINGSYSTEM = 0x00020000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Software issue.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_SOFTWARE = 0x00030000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Application issue.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_APPLICATION = 0x00040000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>System failure.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_SYSTEM = 0x00050000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Power failure.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_POWER = 0x00060000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The InitiateSystemShutdown function was used instead of InitiateSystemShutdownEx.</summary>
|
|
|
|
|
SHTDN_REASON_MAJOR_LEGACY_API = 0x00070000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Other issue.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_OTHER = 0x00000000,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The SHTDN reason minor none</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_NONE = 0x000000ff,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Maintenance.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_MAINTENANCE = 0x00000001,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Installation.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_INSTALLATION = 0x00000002,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Upgrade.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_UPGRADE = 0x00000003,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Reconfigure.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_RECONFIG = 0x00000004,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Unresponsive.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_HUNG = 0x00000005,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Unstable.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_UNSTABLE = 0x00000006,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Disk.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_DISK = 0x00000007,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Processor.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_PROCESSOR = 0x00000008,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Network card.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_NETWORKCARD = 0x00000009,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Power supply.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_POWER_SUPPLY = 0x0000000a,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Unplugged.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_CORDUNPLUGGED = 0x0000000b,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Environment.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_ENVIRONMENT = 0x0000000c,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Driver.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_HARDWARE_DRIVER = 0x0000000d,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Other driver event.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_OTHERDRIVER = 0x0000000e,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Blue screen crash event.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_BLUESCREEN = 0x0000000F,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Service pack.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_SERVICEPACK = 0x00000010,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Hot fix.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_HOTFIX = 0x00000011,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Security patch.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_SECURITYFIX = 0x00000012,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Security issue.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_SECURITY = 0x00000013,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Network connectivity.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY = 0x00000014,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>WMI issue.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_WMI = 0x00000015,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Service pack uninstallation.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL = 0x00000016,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Hot fix uninstallation.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_HOTFIX_UNINSTALL = 0x00000017,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Security patch uninstallation.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL = 0x00000018,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>MMC issue.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_MMC = 0x00000019,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>System restore.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_SYSTEMRESTORE = 0x0000001a,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Terminal Services.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_TERMSRV = 0x00000020,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>DC promotion.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_DC_PROMOTION = 0x00000021,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>DC demotion.</summary>
|
|
|
|
|
SHTDN_REASON_MINOR_DC_DEMOTION = 0x00000022,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>Unknown.</summary>
|
|
|
|
|
SHTDN_REASON_UNKNOWN = SHTDN_REASON_MINOR_NONE,
|
2018-11-19 23:18:50 -05:00
|
|
|
|
|
2017-11-27 12:18:01 -05:00
|
|
|
|
/// <summary>The InitiateSystemShutdown function was used instead of InitiateSystemShutdownEx.</summary>
|
|
|
|
|
SHTDN_REASON_LEGACY_API = SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED
|
|
|
|
|
}
|
|
|
|
|
}
|