1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW API for MS-Windows 4.0
5  *
6  * Authors: Stewart Gordon
7  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
8  * Source: $(DRUNTIMESRC core/sys/windows/_w32api.d)
9  */
10 /// Automatically imported and edited from the druntime module
11 /// core.sys.windows.w32api for the auto-generated win32 package.
12 module win32.w32api;
13 //version (Windows):
14 @system:
15 
16 version (ANSI) {} else version = Unicode;
17 
18 enum __W32API_VERSION = 3.17;
19 enum __W32API_MAJOR_VERSION = 3;
20 enum __W32API_MINOR_VERSION = 17;
21 
22 /*  These version identifiers are used to specify the minimum version of Windows that an
23  *  application will support.
24  *
25  *  Previously the minimum Windows 9x and Windows NT versions could be specified.  However, since
26  *  Windows 9x is no longer supported, either by Microsoft or by DMD, this distinction has been
27  *  removed in order to simplify the bindings.
28  */
29  version (Windows10) {
30     enum uint _WIN32_WINNT = 0xA00;
31 } else version (Windows8_1) {    // also Windows2012R2
32     enum uint _WIN32_WINNT = 0x603;
33 } else version (Windows8) {      // also Windows2012
34     enum uint _WIN32_WINNT = 0x602;
35 } else version (Windows7) {      // also Windows2008R2
36     enum uint _WIN32_WINNT = 0x601;
37 } else version (WindowsVista) {  // also Windows2008
38     enum uint _WIN32_WINNT = 0x600;
39 } else version (Windows2003) {   // also WindowsHomeServer, WindowsXP64
40     enum uint _WIN32_WINNT = 0x502;
41 } else version (WindowsXP) {
42     enum uint _WIN32_WINNT = 0x501;
43 } else version (Windows2000) {
44     // Current DMD doesn't support any version of Windows older than XP,
45     // but third-party compilers could use this
46     enum uint _WIN32_WINNT = 0x500;
47 } else {
48     enum uint _WIN32_WINNT = 0x501;
49 }
50 
51 version (IE11) {
52     enum uint _WIN32_IE = 0xA00;
53 } else version (IE10) {
54     enum uint _WIN32_IE = 0xA00;
55 } else version (IE9) {
56     enum uint _WIN32_IE = 0x900;
57 } else version (IE8) {
58     enum uint _WIN32_IE = 0x800;
59 } else version (IE7) {
60     enum uint _WIN32_IE = 0x700;
61 } else version (IE602) {
62     enum uint _WIN32_IE = 0x603;
63 } else version (IE601) {
64     enum uint _WIN32_IE = 0x601;
65 } else version (IE6) {
66     enum uint _WIN32_IE = 0x600;
67 } else version (IE56) {
68     enum uint _WIN32_IE = 0x560;
69 } else version (IE55) {
70     enum uint _WIN32_IE = 0x550;
71 } else version (IE501) {
72     enum uint _WIN32_IE = 0x501;
73 } else version (IE5) {
74     enum uint _WIN32_IE = 0x500;
75 } else version (IE401) {
76     enum uint _WIN32_IE = 0x401;
77 } else version (IE4) {
78     enum uint _WIN32_IE = 0x400;
79 } else version (IE3) {
80     enum uint _WIN32_IE = 0x300;
81 } else static if (_WIN32_WINNT >= 0x500) {
82     enum uint _WIN32_IE = 0x600;
83 } else static if (_WIN32_WINNT >= 0x410) {
84     enum uint _WIN32_IE = 0x400;
85 } else {
86     enum uint _WIN32_IE = 0;
87 }
88 
89 debug (WindowsUnitTest) {
90     unittest {
91         printf("Windows NT version: %03x\n", _WIN32_WINNT);
92         printf("IE version:         %03x\n", _WIN32_IE);
93     }
94 }
95 
96 version (Unicode) {
97     enum bool _WIN32_UNICODE = true;
98     package template DECLARE_AW(string name) {
99         mixin("alias " ~ name ~ "W " ~ name ~ ";");
100     }
101 } else {
102     enum bool _WIN32_UNICODE = false;
103     package template DECLARE_AW(string name) {
104         mixin("alias " ~ name ~ "A " ~ name ~ ";");
105     }
106 }