Artifact 5ab8056091eb475c60669b1e027a6ecdcd73e811:
- File
src/win32/reason.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
0000: 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a /*************** 0010: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0020: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0030: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0040: 2a 2a 2a 2a 2a 2a 2a 2a 5c 0d 0a 2a 20 20 20 20 ********\..* 0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0060: 20 20 20 20 20 20 20 20 20 20 20 20 72 65 61 73 reas 0070: 6f 6e 2e 64 20 20 20 20 20 20 20 20 20 20 20 20 on.d 0080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0090: 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 20 20 *..* 00a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 0d *. 00e0: 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .* 00f0: 20 20 20 20 20 20 20 20 20 57 69 6e 64 6f 77 73 Windows 0100: 20 41 50 49 20 68 65 61 64 65 72 20 6d 6f 64 75 API header modu 0110: 6c 65 20 20 20 20 20 20 20 20 20 20 20 20 20 20 le 0120: 20 20 20 20 20 20 20 20 20 2a 0d 0a 2a 20 20 20 *..* 0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0170: 20 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 20 *..* 0180: 20 20 20 20 20 20 20 20 20 54 72 61 6e 73 6c 61 Transla 0190: 74 65 64 20 66 72 6f 6d 20 4d 69 6e 47 57 20 57 ted from MinGW W 01a0: 69 6e 64 6f 77 73 20 68 65 61 64 65 72 73 20 20 indows headers 01b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a * 01c0: 0d 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 ..* 01d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 79 by 01e0: 20 53 74 65 77 61 72 74 20 47 6f 72 64 6f 6e 20 Stewart Gordon 01f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0200: 20 20 20 20 20 20 20 20 20 20 2a 0d 0a 2a 20 20 *..* 0210: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0220: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0230: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0240: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0250: 20 20 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 *..* 0260: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0270: 50 6c 61 63 65 64 20 69 6e 74 6f 20 70 75 62 6c Placed into publ 0280: 69 63 20 64 6f 6d 61 69 6e 20 20 20 20 20 20 20 ic domain 0290: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 02a0: 2a 0d 0a 5c 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a *..\************ 02b0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 02c0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 02d0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 02e0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2f 0d 0a 6d 6f ***********/..mo 02f0: 64 75 6c 65 20 77 69 6e 33 32 2e 72 65 61 73 6f dule win32.reaso 0300: 6e 3b 0d 0a 0d 0a 70 72 69 76 61 74 65 20 69 6d n;....private im 0310: 70 6f 72 74 20 77 69 6e 33 32 2e 77 33 32 61 70 port win32.w32ap 0320: 69 2c 20 77 69 6e 33 32 2e 77 69 6e 64 65 66 3b i, win32.windef; 0330: 0d 0a 0d 0a 73 74 61 74 69 63 20 61 73 73 65 72 ....static asser 0340: 74 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 t (_WIN32_WINNT 0350: 3e 3d 20 30 78 35 30 31 2c 0d 0a 20 20 22 77 69 >= 0x501,.. "wi 0360: 6e 33 32 2e 72 65 61 73 6f 6e 20 69 73 20 6f 6e n32.reason is on 0370: 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 ly available on 0380: 57 69 6e 64 6f 77 73 58 50 20 61 6e 64 20 6c 61 WindowsXP and la 0390: 74 65 72 22 29 3b 0d 0a 0d 0a 0d 0a 65 6e 75 6d ter");......enum 03a0: 20 3a 20 44 57 4f 52 44 20 7b 0d 0a 09 53 48 54 : DWORD {...SHT 03b0: 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f DN_REASON_MAJOR_ 03c0: 4f 54 48 45 52 20 20 20 20 20 20 20 20 20 20 20 OTHER 03d0: 3d 20 30 78 30 30 30 30 30 30 30 30 2c 0d 0a 09 = 0x00000000,... 03e0: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a SHTDN_REASON_MAJ 03f0: 4f 52 5f 48 41 52 44 57 41 52 45 20 20 20 20 20 OR_HARDWARE 0400: 20 20 20 3d 20 30 78 30 30 30 31 30 30 30 30 2c = 0x00010000, 0410: 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f ...SHTDN_REASON_ 0420: 4d 41 4a 4f 52 5f 4f 50 45 52 41 54 49 4e 47 53 MAJOR_OPERATINGS 0430: 59 53 54 45 4d 20 3d 20 30 78 30 30 30 32 30 30 YSTEM = 0x000200 0440: 30 30 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 00,...SHTDN_REAS 0450: 4f 4e 5f 4d 41 4a 4f 52 5f 53 4f 46 54 57 41 52 ON_MAJOR_SOFTWAR 0460: 45 20 20 20 20 20 20 20 20 3d 20 30 78 30 30 30 E = 0x000 0470: 33 30 30 30 30 2c 0d 0a 09 53 48 54 44 4e 5f 52 30000,...SHTDN_R 0480: 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 41 50 50 4c EASON_MAJOR_APPL 0490: 49 43 41 54 49 4f 4e 20 20 20 20 20 3d 20 30 78 ICATION = 0x 04a0: 30 30 30 34 30 30 30 30 2c 0d 0a 09 53 48 54 44 00040000,...SHTD 04b0: 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 53 N_REASON_MAJOR_S 04c0: 59 53 54 45 4d 20 20 20 20 20 20 20 20 20 20 3d YSTEM = 04d0: 20 30 78 30 30 30 35 30 30 30 30 2c 0d 0a 09 53 0x00050000,...S 04e0: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f HTDN_REASON_MAJO 04f0: 52 5f 50 4f 57 45 52 20 20 20 20 20 20 20 20 20 R_POWER 0500: 20 20 3d 20 30 78 30 30 30 36 30 30 30 30 2c 0d = 0x00060000,. 0510: 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d ..SHTDN_REASON_M 0520: 41 4a 4f 52 5f 4c 45 47 41 43 59 5f 41 50 49 20 AJOR_LEGACY_API 0530: 20 20 20 20 20 3d 20 30 78 30 30 30 37 30 30 30 = 0x0007000 0540: 30 0d 0a 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44 0..}....enum : D 0550: 57 4f 52 44 20 7b 0d 0a 09 53 48 54 44 4e 5f 52 WORD {...SHTDN_R 0560: 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 4f 54 48 45 EASON_MINOR_OTHE 0570: 52 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f R,...SHTDN_REASO 0580: 4e 5f 4d 49 4e 4f 52 5f 4d 41 49 4e 54 45 4e 41 N_MINOR_MAINTENA 0590: 4e 43 45 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 NCE,...SHTDN_REA 05a0: 53 4f 4e 5f 4d 49 4e 4f 52 5f 49 4e 53 54 41 4c SON_MINOR_INSTAL 05b0: 4c 41 54 49 4f 4e 2c 0d 0a 09 53 48 54 44 4e 5f LATION,...SHTDN_ 05c0: 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 55 50 47 REASON_MINOR_UPG 05d0: 52 41 44 45 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 RADE,...SHTDN_RE 05e0: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 52 45 43 4f 4e ASON_MINOR_RECON 05f0: 46 49 47 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 FIG,...SHTDN_REA 0600: 53 4f 4e 5f 4d 49 4e 4f 52 5f 48 55 4e 47 2c 0d SON_MINOR_HUNG,. 0610: 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d ..SHTDN_REASON_M 0620: 49 4e 4f 52 5f 55 4e 53 54 41 42 4c 45 2c 0d 0a INOR_UNSTABLE,.. 0630: 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 .SHTDN_REASON_MI 0640: 4e 4f 52 5f 44 49 53 4b 2c 0d 0a 09 53 48 54 44 NOR_DISK,...SHTD 0650: 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 50 N_REASON_MINOR_P 0660: 52 4f 43 45 53 53 4f 52 2c 0d 0a 09 53 48 54 44 ROCESSOR,...SHTD 0670: 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 4e N_REASON_MINOR_N 0680: 45 54 57 4f 52 4b 43 41 52 44 2c 0d 0a 09 53 48 ETWORKCARD,...SH 0690: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 TDN_REASON_MINOR 06a0: 5f 50 4f 57 45 52 5f 53 55 50 50 4c 59 2c 0d 0a _POWER_SUPPLY,.. 06b0: 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 .SHTDN_REASON_MI 06c0: 4e 4f 52 5f 43 4f 52 44 55 4e 50 4c 55 47 47 45 NOR_CORDUNPLUGGE 06d0: 44 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f D,...SHTDN_REASO 06e0: 4e 5f 4d 49 4e 4f 52 5f 45 4e 56 49 52 4f 4e 4d N_MINOR_ENVIRONM 06f0: 45 4e 54 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 ENT,...SHTDN_REA 0700: 53 4f 4e 5f 4d 49 4e 4f 52 5f 48 41 52 44 57 41 SON_MINOR_HARDWA 0710: 52 45 5f 44 52 49 56 45 52 2c 0d 0a 09 53 48 54 RE_DRIVER,...SHT 0720: 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f DN_REASON_MINOR_ 0730: 4f 54 48 45 52 44 52 49 56 45 52 2c 0d 0a 09 53 OTHERDRIVER,...S 0740: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f HTDN_REASON_MINO 0750: 52 5f 42 4c 55 45 53 43 52 45 45 4e 2c 0d 0a 09 R_BLUESCREEN,... 0760: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e SHTDN_REASON_MIN 0770: 4f 52 5f 53 45 52 56 49 43 45 50 41 43 4b 2c 0d OR_SERVICEPACK,. 0780: 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d ..SHTDN_REASON_M 0790: 49 4e 4f 52 5f 48 4f 54 46 49 58 2c 0d 0a 09 53 INOR_HOTFIX,...S 07a0: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f HTDN_REASON_MINO 07b0: 52 5f 53 45 43 55 52 49 54 59 46 49 58 2c 0d 0a R_SECURITYFIX,.. 07c0: 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 .SHTDN_REASON_MI 07d0: 4e 4f 52 5f 53 45 43 55 52 49 54 59 2c 0d 0a 09 NOR_SECURITY,... 07e0: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e SHTDN_REASON_MIN 07f0: 4f 52 5f 4e 45 54 57 4f 52 4b 5f 43 4f 4e 4e 45 OR_NETWORK_CONNE 0800: 43 54 49 56 49 54 59 2c 0d 0a 09 53 48 54 44 4e CTIVITY,...SHTDN 0810: 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 57 4d _REASON_MINOR_WM 0820: 49 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f I,...SHTDN_REASO 0830: 4e 5f 4d 49 4e 4f 52 5f 53 45 52 56 49 43 45 50 N_MINOR_SERVICEP 0840: 41 43 4b 5f 55 4e 49 4e 53 54 41 4c 4c 2c 0d 0a ACK_UNINSTALL,.. 0850: 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 .SHTDN_REASON_MI 0860: 4e 4f 52 5f 48 4f 54 46 49 58 5f 55 4e 49 4e 53 NOR_HOTFIX_UNINS 0870: 54 41 4c 4c 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 TALL,...SHTDN_RE 0880: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 53 45 43 55 52 ASON_MINOR_SECUR 0890: 49 54 59 46 49 58 5f 55 4e 49 4e 53 54 41 4c 4c ITYFIX_UNINSTALL 08a0: 2c 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 4f 4e ,...SHTDN_REASON 08b0: 5f 4d 49 4e 4f 52 5f 4d 4d 43 2c 20 20 20 20 20 _MINOR_MMC, 08c0: 20 20 20 20 2f 2f 20 3d 20 30 78 30 30 30 30 30 // = 0x00000 08d0: 30 31 39 0d 0a 09 53 48 54 44 4e 5f 52 45 41 53 019...SHTDN_REAS 08e0: 4f 4e 5f 4d 49 4e 4f 52 5f 54 45 52 4d 53 52 56 ON_MINOR_TERMSRV 08f0: 20 20 20 20 20 20 20 20 20 3d 20 30 78 30 30 30 = 0x000 0900: 30 30 30 32 30 0d 0a 7d 0d 0a 0d 0a 65 6e 75 6d 00020..}....enum 0910: 20 3a 20 44 57 4f 52 44 20 7b 0d 0a 09 53 48 54 : DWORD {...SHT 0920: 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47 5f 55 DN_REASON_FLAG_U 0930: 53 45 52 5f 44 45 46 49 4e 45 44 20 20 20 20 20 SER_DEFINED 0940: 3d 20 30 78 34 30 30 30 30 30 30 30 2c 0d 0a 09 = 0x40000000,... 0950: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 SHTDN_REASON_FLA 0960: 47 5f 50 4c 41 4e 4e 45 44 20 20 20 20 20 20 20 G_PLANNED 0970: 20 20 20 3d 20 30 78 38 30 30 30 30 30 30 30 0d = 0x80000000. 0980: 0a 7d 0d 0a .}..