1 // Copyright © 2015, Peter Atashian 2 // Licensed under the MIT License <LICENSE.md> 3 // Flags used by the various UIs 4 pub const SHTDN_REASON_FLAG_COMMENT_REQUIRED: ::DWORD = 0x01000000; 5 pub const SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED: ::DWORD = 0x02000000; 6 pub const SHTDN_REASON_FLAG_CLEAN_UI: ::DWORD = 0x04000000; 7 pub const SHTDN_REASON_FLAG_DIRTY_UI: ::DWORD = 0x08000000; 8 // Flags that end up in the event log code. 9 pub const SHTDN_REASON_FLAG_USER_DEFINED: ::DWORD = 0x40000000; 10 pub const SHTDN_REASON_FLAG_PLANNED: ::DWORD = 0x80000000; 11 // Microsoft major reasons. 12 pub const SHTDN_REASON_MAJOR_OTHER: ::DWORD = 0x00000000; 13 pub const SHTDN_REASON_MAJOR_NONE: ::DWORD = 0x00000000; 14 pub const SHTDN_REASON_MAJOR_HARDWARE: ::DWORD = 0x00010000; 15 pub const SHTDN_REASON_MAJOR_OPERATINGSYSTEM: ::DWORD = 0x00020000; 16 pub const SHTDN_REASON_MAJOR_SOFTWARE: ::DWORD = 0x00030000; 17 pub const SHTDN_REASON_MAJOR_APPLICATION: ::DWORD = 0x00040000; 18 pub const SHTDN_REASON_MAJOR_SYSTEM: ::DWORD = 0x00050000; 19 pub const SHTDN_REASON_MAJOR_POWER: ::DWORD = 0x00060000; 20 pub const SHTDN_REASON_MAJOR_LEGACY_API: ::DWORD = 0x00070000; 21 // Microsoft minor reasons. 22 pub const SHTDN_REASON_MINOR_OTHER: ::DWORD = 0x00000000; 23 pub const SHTDN_REASON_MINOR_NONE: ::DWORD = 0x000000ff; 24 pub const SHTDN_REASON_MINOR_MAINTENANCE: ::DWORD = 0x00000001; 25 pub const SHTDN_REASON_MINOR_INSTALLATION: ::DWORD = 0x00000002; 26 pub const SHTDN_REASON_MINOR_UPGRADE: ::DWORD = 0x00000003; 27 pub const SHTDN_REASON_MINOR_RECONFIG: ::DWORD = 0x00000004; 28 pub const SHTDN_REASON_MINOR_HUNG: ::DWORD = 0x00000005; 29 pub const SHTDN_REASON_MINOR_UNSTABLE: ::DWORD = 0x00000006; 30 pub const SHTDN_REASON_MINOR_DISK: ::DWORD = 0x00000007; 31 pub const SHTDN_REASON_MINOR_PROCESSOR: ::DWORD = 0x00000008; 32 pub const SHTDN_REASON_MINOR_NETWORKCARD: ::DWORD = 0x00000009; 33 pub const SHTDN_REASON_MINOR_POWER_SUPPLY: ::DWORD = 0x0000000a; 34 pub const SHTDN_REASON_MINOR_CORDUNPLUGGED: ::DWORD = 0x0000000b; 35 pub const SHTDN_REASON_MINOR_ENVIRONMENT: ::DWORD = 0x0000000c; 36 pub const SHTDN_REASON_MINOR_HARDWARE_DRIVER: ::DWORD = 0x0000000d; 37 pub const SHTDN_REASON_MINOR_OTHERDRIVER: ::DWORD = 0x0000000e; 38 pub const SHTDN_REASON_MINOR_BLUESCREEN: ::DWORD = 0x0000000F; 39 pub const SHTDN_REASON_MINOR_SERVICEPACK: ::DWORD = 0x00000010; 40 pub const SHTDN_REASON_MINOR_HOTFIX: ::DWORD = 0x00000011; 41 pub const SHTDN_REASON_MINOR_SECURITYFIX: ::DWORD = 0x00000012; 42 pub const SHTDN_REASON_MINOR_SECURITY: ::DWORD = 0x00000013; 43 pub const SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY: ::DWORD = 0x00000014; 44 pub const SHTDN_REASON_MINOR_WMI: ::DWORD = 0x00000015; 45 pub const SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL: ::DWORD = 0x00000016; 46 pub const SHTDN_REASON_MINOR_HOTFIX_UNINSTALL: ::DWORD = 0x00000017; 47 pub const SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL: ::DWORD = 0x00000018; 48 pub const SHTDN_REASON_MINOR_MMC: ::DWORD = 0x00000019; 49 pub const SHTDN_REASON_MINOR_SYSTEMRESTORE: ::DWORD = 0x0000001a; 50 pub const SHTDN_REASON_MINOR_TERMSRV: ::DWORD = 0x00000020; 51 pub const SHTDN_REASON_MINOR_DC_PROMOTION: ::DWORD = 0x00000021; 52 pub const SHTDN_REASON_MINOR_DC_DEMOTION: ::DWORD = 0x00000022; 53 pub const SHTDN_REASON_UNKNOWN: ::DWORD = SHTDN_REASON_MINOR_NONE; 54 pub const SHTDN_REASON_LEGACY_API: ::DWORD = 55 (SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED); 56 // This mask cuts out UI flags. 57 pub const SHTDN_REASON_VALID_BIT_MASK: ::DWORD = 0xc0ffffff; 58 // Convenience flags. 59 pub const PCLEANUI: ::DWORD = (SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_CLEAN_UI); 60 pub const UCLEANUI: ::DWORD = (SHTDN_REASON_FLAG_CLEAN_UI); 61 pub const PDIRTYUI: ::DWORD = (SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_DIRTY_UI); 62 pub const UDIRTYUI: ::DWORD = (SHTDN_REASON_FLAG_DIRTY_UI); 63 //89 64