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