[metadata] Fix leaks when handling a few attributes (#16675)
[mono-project.git] / mono / metadata / w32subset.h
blob7cfdcab9e8fe8b34dc6f9f3335c26e020c9ebba4
1 /**
2 * \file
3 * Define Win32 API subset defaults.
4 * Other subsetters can fork this file, or
5 * define symbols ahead of it, or after it (with undef).
7 * Note that #if of an undefined symbols is defined as if 0,
8 * so that an implicit default here.
10 * Copyright 2018 Microsoft
11 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
14 #ifndef HAVE_API_SUPPORT_WIN32_GET_COMPUTER_NAME
15 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
16 #define HAVE_API_SUPPORT_WIN32_GET_COMPUTER_NAME 1
17 #else
18 #define HAVE_API_SUPPORT_WIN32_GET_COMPUTER_NAME 0
19 #endif
20 #endif
22 #ifndef HAVE_API_SUPPORT_WIN32_GET_DRIVE_TYPE
23 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
24 #define HAVE_API_SUPPORT_WIN32_GET_DRIVE_TYPE 1
25 #else
26 #define HAVE_API_SUPPORT_WIN32_GET_DRIVE_TYPE 0
27 #endif
28 #endif
30 #ifndef HAVE_API_SUPPORT_WIN32_REPLACE_FILE
31 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
32 #define HAVE_API_SUPPORT_WIN32_REPLACE_FILE 1
33 #else
34 #define HAVE_API_SUPPORT_WIN32_REPLACE_FILE 0
35 #endif
36 #endif
38 #ifndef HAVE_API_SUPPORT_WIN32_COPY_FILE
39 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
40 #define HAVE_API_SUPPORT_WIN32_COPY_FILE 1
41 #else
42 #define HAVE_API_SUPPORT_WIN32_COPY_FILE 0
43 #endif
44 #endif
46 #ifndef HAVE_API_SUPPORT_WIN32_COPY_FILE2 // not on Windows7
47 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
48 #define HAVE_API_SUPPORT_WIN32_COPY_FILE2 1
49 #else
50 #define HAVE_API_SUPPORT_WIN32_COPY_FILE2 0
51 #endif
52 #endif
54 #ifndef HAVE_API_SUPPORT_WIN32_LOCK_FILE
55 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
56 #define HAVE_API_SUPPORT_WIN32_LOCK_FILE 1
57 #else
58 #define HAVE_API_SUPPORT_WIN32_LOCK_FILE 0
59 #endif
60 #endif
62 #ifndef HAVE_API_SUPPORT_WIN32_UNLOCK_FILE
63 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
64 #define HAVE_API_SUPPORT_WIN32_UNLOCK_FILE 1
65 #else
66 #define HAVE_API_SUPPORT_WIN32_UNLOCK_FILE 0
67 #endif
68 #endif
70 #ifndef HAVE_API_SUPPORT_WIN32_MOVE_FILE
71 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
72 #define HAVE_API_SUPPORT_WIN32_MOVE_FILE 1
73 #else
74 #define HAVE_API_SUPPORT_WIN32_MOVE_FILE 0
75 #endif
76 #endif
78 #ifndef HAVE_API_SUPPORT_WIN32_MOVE_FILE_EX
79 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
80 #define HAVE_API_SUPPORT_WIN32_MOVE_FILE_EX 1
81 #else
82 #define HAVE_API_SUPPORT_WIN32_MOVE_FILE_EX 0
83 #endif
84 #endif
86 #ifndef HAVE_API_SUPPORT_WIN32_GET_STD_HANDLE
87 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
88 #define HAVE_API_SUPPORT_WIN32_GET_STD_HANDLE 1
89 #else
90 #define HAVE_API_SUPPORT_WIN32_GET_STD_HANDLE 0
91 #endif
92 #endif
94 #ifndef HAVE_API_SUPPORT_WIN32_GET_FILE_SIZE_EX
95 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) || G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
96 #define HAVE_API_SUPPORT_WIN32_GET_FILE_SIZE_EX 1
97 #else
98 #define HAVE_API_SUPPORT_WIN32_GET_FILE_SIZE_EX 0
99 #endif
100 #endif
102 #ifndef HAVE_API_SUPPORT_WIN32_GET_LOGICAL_DRIVE_STRINGS
103 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
104 #define HAVE_API_SUPPORT_WIN32_GET_LOGICAL_DRIVE_STRINGS 1
105 #else
106 #define HAVE_API_SUPPORT_WIN32_GET_LOGICAL_DRIVE_STRINGS 0
107 #endif
108 #endif
110 #ifndef HAVE_API_SUPPORT_WIN32_SH_GET_FOLDER_PATH
111 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
112 #define HAVE_API_SUPPORT_WIN32_SH_GET_FOLDER_PATH 1
113 #else
114 #define HAVE_API_SUPPORT_WIN32_SH_GET_FOLDER_PATH 0
115 #endif
116 #endif
118 #ifndef HAVE_API_SUPPORT_WIN32_SEND_MESSAGE_TIMEOUT
119 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
120 #define HAVE_API_SUPPORT_WIN32_SEND_MESSAGE_TIMEOUT 1
121 #else
122 #define HAVE_API_SUPPORT_WIN32_SEND_MESSAGE_TIMEOUT 0
123 #endif
124 #endif
126 #ifndef HAVE_API_SUPPORT_WIN32_WAIT_FOR_INPUT_IDLE
127 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
128 #define HAVE_API_SUPPORT_WIN32_WAIT_FOR_INPUT_IDLE 1
129 #else
130 #define HAVE_API_SUPPORT_WIN32_WAIT_FOR_INPUT_IDLE 0
131 #endif
132 #endif
134 #ifndef HAVE_API_SUPPORT_WIN32_SIGNAL_OBJECT_AND_WAIT
135 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
136 #define HAVE_API_SUPPORT_WIN32_SIGNAL_OBJECT_AND_WAIT 1
137 #else
138 #define HAVE_API_SUPPORT_WIN32_SIGNAL_OBJECT_AND_WAIT 0
139 #endif
140 #endif
142 #ifndef HAVE_API_SUPPORT_WIN32_MSG_WAIT_FOR_MULTIPLE_OBJECTS
143 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
144 #define HAVE_API_SUPPORT_WIN32_MSG_WAIT_FOR_MULTIPLE_OBJECTS 1
145 #else
146 #define HAVE_API_SUPPORT_WIN32_MSG_WAIT_FOR_MULTIPLE_OBJECTS 0
147 #endif
148 #endif
150 #ifndef HAVE_API_SUPPORT_WIN32_SET_ERROR_MODE
151 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
152 #define HAVE_API_SUPPORT_WIN32_SET_ERROR_MODE 1
153 #else
154 #define HAVE_API_SUPPORT_WIN32_SET_ERROR_MODE 0
155 #endif
156 #endif
158 #ifndef HAVE_API_SUPPORT_WIN32_LOAD_LIBRARY
159 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
160 #define HAVE_API_SUPPORT_WIN32_LOAD_LIBRARY 1
161 #else
162 #define HAVE_API_SUPPORT_WIN32_LOAD_LIBRARY 0
163 #endif
164 #endif
166 #ifndef HAVE_API_SUPPORT_WIN32_LOAD_PACKAGED_LIBRARY
167 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
168 #define HAVE_API_SUPPORT_WIN32_LOAD_PACKAGED_LIBRARY 1
169 #else
170 #define HAVE_API_SUPPORT_WIN32_LOAD_PACKAGED_LIBRARY 0
171 #endif
172 #endif
174 #ifndef HAVE_API_SUPPORT_WIN32_GET_MODULE_HANDLE
175 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
176 #define HAVE_API_SUPPORT_WIN32_GET_MODULE_HANDLE 1
177 #else
178 #define HAVE_API_SUPPORT_WIN32_GET_MODULE_HANDLE 0
179 #endif
180 #endif
182 #ifndef HAVE_API_SUPPORT_WIN32_SET_THREAD_CONTEXT
183 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
184 #define HAVE_API_SUPPORT_WIN32_SET_THREAD_CONTEXT 1
185 #else
186 #define HAVE_API_SUPPORT_WIN32_SET_THREAD_CONTEXT 0
187 #endif
188 #endif
190 #ifndef HAVE_API_SUPPORT_WIN32_CANCEL_SYNCHRONOUS_IO
191 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
192 #define HAVE_API_SUPPORT_WIN32_CANCEL_SYNCHRONOUS_IO 1
193 #else
194 #define HAVE_API_SUPPORT_WIN32_CANCEL_SYNCHRONOUS_IO 0
195 #endif
196 #endif
198 #ifndef HAVE_API_SUPPORT_WIN32_OPEN_THREAD
199 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
200 #define HAVE_API_SUPPORT_WIN32_OPEN_THREAD 1
201 #else
202 #define HAVE_API_SUPPORT_WIN32_OPEN_THREAD 0
203 #endif
204 #endif
206 #ifndef HAVE_API_SUPPORT_WIN32_IS_WOW64_PROCESS
207 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
208 #define HAVE_API_SUPPORT_WIN32_IS_WOW64_PROCESS 1
209 #else
210 #define HAVE_API_SUPPORT_WIN32_IS_WOW64_PROCESS 0
211 #endif
212 #endif
214 #ifndef HAVE_SET_THREAD_DESCRIPTION
215 #define HAVE_SET_THREAD_DESCRIPTION 0
216 #endif
218 #ifndef HAVE_SET_THREAD_NAME
219 // https://github.com/microsoft/xbox-live-api/blob/90b38b434d9c13ce4916c116cd28a98b239e38e2/InProgressSamples/Kits/ATGTK/ThreadHelpers.h#L21
220 #if defined(_XBOX_ONE) && defined(_TITLE)
221 #define HAVE_SET_THREAD_NAME 1
222 #else
223 #define HAVE_SET_THREAD_NAME 0
224 #endif
225 #endif