Differences From Artifact [a45ec6a241aff65f]:
- File
src/win32/w32api.d
- 2015-04-21 10:46:55 - part of checkin [4e2933c620] on branch trunk - Rebased to the latest verson dmd 2.067. Not yet verified the outcome. (user: kinaba) [annotate]
To Artifact [02649da4f1c3ff63]:
- File
src/win32/w32api.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.
1 /***********************************************************************\ 1 /***********************************************************************\
2 * w32api.d * 2 * w32api.d *
3 * * 3 * *
4 * Windows API header module * 4 * Windows API header module *
5 * * 5 * *
6 * Translated from MinGW API for MS-Windows 3.12 * | 6 * Translated from MinGW API for MS-Windows 4.0 *
7 * by Stewart Gordon * 7 * by Stewart Gordon *
8 * * 8 * *
9 * Placed into public domain * 9 * Placed into public domain *
10 \***********************************************************************/ 10 \***********************************************************************/
11 module win32.w32api; 11 module win32.w32api;
12 12
13 const __W32API_VERSION = 3.12; | 13 enum __W32API_VERSION = 3.17;
14 const __W32API_MAJOR_VERSION = 3; | 14 enum __W32API_MAJOR_VERSION = 3;
15 const __W32API_MINOR_VERSION = 12; | 15 enum __W32API_MINOR_VERSION = 17;
16 16
17 /* These version identifiers are used to specify the minimum version of | 17 /* These version identifiers are used to specify the minimum version of Win
18 * Windows that an application will support. | 18 * application will support.
19 * 19 *
20 * The programmer should set two version identifiers: one for the | 20 * Previously the minimum Windows 9x and Windows NT versions could be speci
21 * minimum Windows NT version and one for the minimum Windows 9x | 21 * Windows 9x is no longer supported, either by Microsoft or by DMD, this d
22 * version. If no Windows NT version is specified, Windows NT 4 is | 22 * removed in order to simplify the bindings.
23 * assumed. If no Windows 9x version is specified, Windows 95 is <
24 * assumed, unless WindowsNTonly, WindowsXP, Windows2003 or WindowsVista <
25 * is specified, implying that the application supports only the NT line of <
26 * versions. <
27 */ 23 */
28 <
29 /* For Windows XP and later, assume no Windows 9x support. <
30 * API features new to Windows Vista are not yet included in this <
31 * translation or in MinGW, but this is here ready to start adding them. <
32 */ <
33 version (WindowsVista) { | 24 version (Windows10) {
34 const uint <
35 _WIN32_WINNT = 0x600, | 25 enum uint _WIN32_WINNT = 0x604;
> 26 } else version (Windows8_1) { // also Windows2012R2
36 _WIN32_WINDOWS = uint.max; | 27 enum uint _WIN32_WINNT = 0x603;
37 <
38 } else version (Windows2003) { | 28 } else version (Windows8) { // also Windows2012
39 const uint <
40 _WIN32_WINNT = 0x502, | 29 enum uint _WIN32_WINNT = 0x602;
> 30 } else version (Windows7) { // also Windows2008R2
41 _WIN32_WINDOWS = uint.max; | 31 enum uint _WIN32_WINNT = 0x601;
42 <
> 32 } else version (WindowsVista) { // also Windows2008
> 33 enum uint _WIN32_WINNT = 0x600;
> 34 } else version (Windows2003) { // also WindowsHomeServer, WindowsXP64
> 35 enum uint _WIN32_WINNT = 0x502;
43 } else version (WindowsXP) { 36 } else version (WindowsXP) {
44 const uint | 37 enum uint _WIN32_WINNT = 0x501;
> 38 } else version (Windows2000) {
45 _WIN32_WINNT = 0x501, | 39 enum uint _WIN32_WINNT = 0x500;
> 40 } else {
46 _WIN32_WINDOWS = uint.max; | 41 enum uint _WIN32_WINNT = 0x501;
> 42 }
47 43
> 44 version (IE10) {
> 45 enum uint _WIN32_IE = 0xA00;
> 46 } else version (IE9) {
> 47 enum uint _WIN32_IE = 0x900;
> 48 } else version (IE8) {
> 49 enum uint _WIN32_IE = 0x800;
> 50 } else version (IE7) {
> 51 enum uint _WIN32_IE = 0x700;
> 52 } else version (IE602) {
> 53 enum uint _WIN32_IE = 0x603;
> 54 } else version (IE601) {
> 55 enum uint _WIN32_IE = 0x601;
> 56 } else version (IE6) {
> 57 enum uint _WIN32_IE = 0x600;
> 58 } else version (IE56) {
> 59 enum uint _WIN32_IE = 0x560;
> 60 } else version (IE501) {
> 61 enum uint _WIN32_IE = 0x501;
> 62 } else version (IE5) {
> 63 enum uint _WIN32_IE = 0x500;
> 64 } else version (IE401) {
> 65 enum uint _WIN32_IE = 0x401;
> 66 } else version (IE4) {
> 67 enum uint _WIN32_IE = 0x400;
> 68 } else version (IE3) {
> 69 enum uint _WIN32_IE = 0x300;
> 70 } else static if (_WIN32_WINNT >= 0x410) {
> 71 enum uint _WIN32_IE = 0x400;
48 } else { 72 } else {
49 /* for earlier Windows versions, separate version identifiers into <
50 * the NT and 9x lines <
51 */ <
52 version (Windows2000) { <
53 const uint _WIN32_WINNT = 0x500; | 73 enum uint _WIN32_IE = 0;
54 } else { <
55 const uint _WIN32_WINNT = 0x400; <
56 } | 74 }
57 75
58 version (WindowsNTonly) { | 76 debug (WindowsUnitTest) {
59 const uint _WIN32_WINDOWS = uint.max; | 77 unittest {
60 } else version (WindowsME) { | 78 printf("Windows NT version: %03x\n", _WIN32_WINNT);
61 const uint _WIN32_WINDOWS = 0x500; | 79 printf("IE version: %03x\n", _WIN32_IE);
62 } else version (Windows98) { <
63 const uint _WIN32_WINDOWS = 0x410; <
64 } else { <
65 const uint _WIN32_WINDOWS = 0x400; <
66 } 80 }
67 } 81 }
68 82
69 // Just a bit of syntactic sugar for the static ifs | 83 version (Unicode) {
70 const uint WINVER = _WIN32_WINDOWS < _WIN32_WINNT ? | 84 enum bool _WIN32_UNICODE = true;
71 _WIN32_WINDOWS : _WIN32_WINNT; | 85 package template DECLARE_AW(string name) {
72 const bool _WIN32_WINNT_ONLY = _WIN32_WINDOWS == uint.max; | 86 mixin("alias " ~ name ~ "W " ~ name ~ ";");
73 | 87 }
74 version (IE7) { <
75 const uint _WIN32_IE = 0x700; <
76 } else version (IE602) { <
77 const uint _WIN32_IE = 0x603; <
78 } else version (IE601) { <
79 const uint _WIN32_IE = 0x601; <
80 } else version (IE6) { <
81 const uint _WIN32_IE = 0x600; <
82 } else version (IE56) { <
83 const uint _WIN32_IE = 0x560; <
84 } else version (IE501) { <
85 const uint _WIN32_IE = 0x501; <
86 } else version (IE5) { <
87 const uint _WIN32_IE = 0x500; <
88 } else version (IE401) { <
89 const uint _WIN32_IE = 0x401; <
90 } else version (IE4) { <
91 const uint _WIN32_IE = 0x400; <
92 } else version (IE3) { <
93 const uint _WIN32_IE = 0x300; <
94 } else static if (WINVER >= 0x410) { <
95 const uint _WIN32_IE = 0x400; <
96 } else { 88 } else {
97 const uint _WIN32_IE = 0; | 89 enum bool _WIN32_UNICODE = false;
98 } <
99 <
100 debug (WindowsUnitTest) { <
101 unittest { <
102 printf("Windows NT version: %03x\n", _WIN32_WINNT); <
103 printf("Windows 9x version: %03x\n", _WIN32_WINDOWS); <
104 printf("IE version: %03x\n", _WIN32_IE); <
> 90 package template DECLARE_AW(string name) {
> 91 mixin("alias " ~ name ~ "A " ~ name ~ ";");
105 } 92 }
106 } 93 }