• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * This file is part of the mingw-w64 runtime package.
3  * No warranty is given; refer to the file DISCLAIMER within this package.
4  */
5 #ifndef _WINBASE_
6 #define _WINBASE_
7 
8 #include <_mingw_unicode.h>
9 
10 #include <apisetcconv.h>
11 #include <winapifamily.h>
12 
13 #include <minwinbase.h>
14 #include <bemapiset.h>
15 #include <debugapi.h>
16 #include <errhandlingapi.h>
17 #include <fibersapi.h>
18 #include <fileapi.h>
19 #include <handleapi.h>
20 #include <heapapi.h>
21 #include <ioapiset.h>
22 #include <interlockedapi.h>
23 #include <jobapi.h>
24 #include <libloaderapi.h>
25 #include <memoryapi.h>
26 #include <namedpipeapi.h>
27 #include <namespaceapi.h>
28 #include <processenv.h>
29 #include <processthreadsapi.h>
30 #include <processtopologyapi.h>
31 #include <profileapi.h>
32 #include <realtimeapiset.h>
33 #include <securityappcontainer.h>
34 #include <securitybaseapi.h>
35 #include <synchapi.h>
36 #include <sysinfoapi.h>
37 #include <systemtopologyapi.h>
38 #include <threadpoolapiset.h>
39 #include <threadpoollegacyapiset.h>
40 #include <utilapiset.h>
41 #include <wow64apiset.h>
42 
43 #ifdef __WIDL__
44 #define NOWINBASEINTERLOCK 1
45 #endif
46 
47 #ifndef NOWINBASEINTERLOCK
48 #define __INTRINSIC_GROUP_WINBASE /* only define the intrinsics in this file */
49 #include <psdk_inc/intrin-impl.h>
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
57 #define GetCurrentTime() GetTickCount ()
58 #endif
59 
60 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
61 #define DefineHandleTable(w) ( { (VOID)(w); TRUE; } )
62 #define LimitEmsPages(dw)
63 #define SetSwapAreaSize(w) (w)
64 #define LockSegment(w) GlobalFix((HANDLE)(w))
65 #define UnlockSegment(w) GlobalUnfix((HANDLE)(w))
66 
67 #define Yield()
68 
69 #define FILE_BEGIN 0
70 #define FILE_CURRENT 1
71 #define FILE_END 2
72 
73 #define WAIT_FAILED ((DWORD)0xffffffff)
74 #define WAIT_OBJECT_0 ((STATUS_WAIT_0) + 0)
75 
76 #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0) + 0)
77 #define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0) + 0)
78 
79 #define WAIT_IO_COMPLETION STATUS_USER_APC
80 
81 #define SecureZeroMemory RtlSecureZeroMemory
82 #define CaptureStackBackTrace RtlCaptureStackBackTrace
83 
84 #define FILE_FLAG_WRITE_THROUGH 0x80000000
85 #define FILE_FLAG_OVERLAPPED 0x40000000
86 #define FILE_FLAG_NO_BUFFERING 0x20000000
87 #define FILE_FLAG_RANDOM_ACCESS 0x10000000
88 #define FILE_FLAG_SEQUENTIAL_SCAN 0x8000000
89 #define FILE_FLAG_DELETE_ON_CLOSE 0x4000000
90 #define FILE_FLAG_BACKUP_SEMANTICS 0x2000000
91 #define FILE_FLAG_POSIX_SEMANTICS 0x1000000
92 #define FILE_FLAG_SESSION_AWARE 0x800000
93 #define FILE_FLAG_OPEN_REPARSE_POINT 0x200000
94 #define FILE_FLAG_OPEN_NO_RECALL 0x100000
95 #define FILE_FLAG_FIRST_PIPE_INSTANCE 0x80000
96 #if _WIN32_WINNT >= 0x0602
97 #define FILE_FLAG_OPEN_REQUIRING_OPLOCK 0x40000
98 #endif
99 
100 #define PROGRESS_CONTINUE 0
101 #define PROGRESS_CANCEL 1
102 #define PROGRESS_STOP 2
103 #define PROGRESS_QUIET 3
104 
105 #define CALLBACK_CHUNK_FINISHED 0x0
106 #define CALLBACK_STREAM_SWITCH 0x1
107 
108 #define COPY_FILE_FAIL_IF_EXISTS 0x1
109 #define COPY_FILE_RESTARTABLE 0x2
110 #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x4
111 #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x8
112 #if _WIN32_WINNT >= 0x0600
113 #define COPY_FILE_COPY_SYMLINK 0x800
114 #define COPY_FILE_NO_BUFFERING 0x1000
115 #endif
116 #if _WIN32_WINNT >= 0x0602
117 #define COPY_FILE_REQUEST_SECURITY_PRIVILEGES 0x2000
118 #define COPY_FILE_RESUME_FROM_PAUSE 0x4000
119 #define COPY_FILE_NO_OFFLOAD 0x40000
120 #endif
121 
122 #define REPLACEFILE_WRITE_THROUGH 0x1
123 #define REPLACEFILE_IGNORE_MERGE_ERRORS 0x2
124 #if _WIN32_WINNT >= 0x0600
125 #define REPLACEFILE_IGNORE_ACL_ERRORS 0x4
126 #endif
127 
128 #define PIPE_ACCESS_INBOUND 0x1
129 #define PIPE_ACCESS_OUTBOUND 0x2
130 #define PIPE_ACCESS_DUPLEX 0x3
131 
132 #define PIPE_CLIENT_END 0x0
133 #define PIPE_SERVER_END 0x1
134 
135 #define PIPE_WAIT 0x0
136 #define PIPE_NOWAIT 0x1
137 #define PIPE_READMODE_BYTE 0x0
138 #define PIPE_READMODE_MESSAGE 0x2
139 #define PIPE_TYPE_BYTE 0x0
140 #define PIPE_TYPE_MESSAGE 0x4
141 #define PIPE_ACCEPT_REMOTE_CLIENTS 0x0
142 #define PIPE_REJECT_REMOTE_CLIENTS 0x8
143 
144 #define PIPE_UNLIMITED_INSTANCES 255
145 
146 #define SECURITY_ANONYMOUS (SecurityAnonymous << 16)
147 #define SECURITY_IDENTIFICATION (SecurityIdentification << 16)
148 #define SECURITY_IMPERSONATION (SecurityImpersonation << 16)
149 #define SECURITY_DELEGATION (SecurityDelegation << 16)
150 
151 #define SECURITY_CONTEXT_TRACKING 0x40000
152 #define SECURITY_EFFECTIVE_ONLY 0x80000
153 
154 #define SECURITY_SQOS_PRESENT 0x100000
155 #define SECURITY_VALID_SQOS_FLAGS 0x1f0000
156 
157 #define FAIL_FAST_GENERATE_EXCEPTION_ADDRESS 0x1
158 #define FAIL_FAST_NO_HARD_ERROR_DLG 0x2
159 
160   typedef VOID (WINAPI *PFIBER_START_ROUTINE) (LPVOID lpFiberParameter);
161   typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
162 
163 #if defined (__i386__)
164   typedef PLDT_ENTRY LPLDT_ENTRY;
165 #else
166   typedef LPVOID LPLDT_ENTRY;
167 #endif
168 
169 #define SP_SERIALCOMM ((DWORD)0x1)
170 #define PST_UNSPECIFIED ((DWORD)0x0)
171 #define PST_RS232 ((DWORD)0x1)
172 #define PST_PARALLELPORT ((DWORD)0x2)
173 #define PST_RS422 ((DWORD)0x3)
174 #define PST_RS423 ((DWORD)0x4)
175 #define PST_RS449 ((DWORD)0x5)
176 #define PST_MODEM ((DWORD)0x6)
177 #define PST_FAX ((DWORD)0x21)
178 #define PST_SCANNER ((DWORD)0x22)
179 #define PST_NETWORK_BRIDGE ((DWORD)0x100)
180 #define PST_LAT ((DWORD)0x101)
181 #define PST_TCPIP_TELNET ((DWORD)0x102)
182 #define PST_X25 ((DWORD)0x103)
183 
184 #define PCF_DTRDSR ((DWORD)0x1)
185 #define PCF_RTSCTS ((DWORD)0x2)
186 #define PCF_RLSD ((DWORD)0x4)
187 #define PCF_PARITY_CHECK ((DWORD)0x8)
188 #define PCF_XONXOFF ((DWORD)0x10)
189 #define PCF_SETXCHAR ((DWORD)0x20)
190 #define PCF_TOTALTIMEOUTS ((DWORD)0x40)
191 #define PCF_INTTIMEOUTS ((DWORD)0x80)
192 #define PCF_SPECIALCHARS ((DWORD)0x100)
193 #define PCF_16BITMODE ((DWORD)0x200)
194 
195 #define SP_PARITY ((DWORD)0x1)
196 #define SP_BAUD ((DWORD)0x2)
197 #define SP_DATABITS ((DWORD)0x4)
198 #define SP_STOPBITS ((DWORD)0x8)
199 #define SP_HANDSHAKING ((DWORD)0x10)
200 #define SP_PARITY_CHECK ((DWORD)0x20)
201 #define SP_RLSD ((DWORD)0x40)
202 
203 #define BAUD_075 ((DWORD)0x1)
204 #define BAUD_110 ((DWORD)0x2)
205 #define BAUD_134_5 ((DWORD)0x4)
206 #define BAUD_150 ((DWORD)0x8)
207 #define BAUD_300 ((DWORD)0x10)
208 #define BAUD_600 ((DWORD)0x20)
209 #define BAUD_1200 ((DWORD)0x40)
210 #define BAUD_1800 ((DWORD)0x80)
211 #define BAUD_2400 ((DWORD)0x100)
212 #define BAUD_4800 ((DWORD)0x200)
213 #define BAUD_7200 ((DWORD)0x400)
214 #define BAUD_9600 ((DWORD)0x800)
215 #define BAUD_14400 ((DWORD)0x1000)
216 #define BAUD_19200 ((DWORD)0x2000)
217 #define BAUD_38400 ((DWORD)0x4000)
218 #define BAUD_56K ((DWORD)0x8000)
219 #define BAUD_128K ((DWORD)0x10000)
220 #define BAUD_115200 ((DWORD)0x20000)
221 #define BAUD_57600 ((DWORD)0x40000)
222 #define BAUD_USER ((DWORD)0x10000000)
223 
224 #define DATABITS_5 ((WORD)0x1)
225 #define DATABITS_6 ((WORD)0x2)
226 #define DATABITS_7 ((WORD)0x4)
227 #define DATABITS_8 ((WORD)0x8)
228 #define DATABITS_16 ((WORD)0x10)
229 #define DATABITS_16X ((WORD)0x20)
230 
231 #define STOPBITS_10 ((WORD)0x1)
232 #define STOPBITS_15 ((WORD)0x2)
233 #define STOPBITS_20 ((WORD)0x4)
234 #define PARITY_NONE ((WORD)0x100)
235 #define PARITY_ODD ((WORD)0x200)
236 #define PARITY_EVEN ((WORD)0x400)
237 #define PARITY_MARK ((WORD)0x800)
238 #define PARITY_SPACE ((WORD)0x1000)
239 
240   typedef struct _COMMPROP {
241     WORD wPacketLength;
242     WORD wPacketVersion;
243     DWORD dwServiceMask;
244     DWORD dwReserved1;
245     DWORD dwMaxTxQueue;
246     DWORD dwMaxRxQueue;
247     DWORD dwMaxBaud;
248     DWORD dwProvSubType;
249     DWORD dwProvCapabilities;
250     DWORD dwSettableParams;
251     DWORD dwSettableBaud;
252     WORD wSettableData;
253     WORD wSettableStopParity;
254     DWORD dwCurrentTxQueue;
255     DWORD dwCurrentRxQueue;
256     DWORD dwProvSpec1;
257     DWORD dwProvSpec2;
258     WCHAR wcProvChar[1];
259   } COMMPROP,*LPCOMMPROP;
260 
261 #define COMMPROP_INITIALIZED ((DWORD)0xe73cf52e)
262 
263   typedef struct _COMSTAT {
264     DWORD fCtsHold : 1;
265     DWORD fDsrHold : 1;
266     DWORD fRlsdHold : 1;
267     DWORD fXoffHold : 1;
268     DWORD fXoffSent : 1;
269     DWORD fEof : 1;
270     DWORD fTxim : 1;
271     DWORD fReserved : 25;
272     DWORD cbInQue;
273     DWORD cbOutQue;
274   } COMSTAT,*LPCOMSTAT;
275 
276 #define DTR_CONTROL_DISABLE 0x0
277 #define DTR_CONTROL_ENABLE 0x1
278 #define DTR_CONTROL_HANDSHAKE 0x2
279 
280 #define RTS_CONTROL_DISABLE 0x0
281 #define RTS_CONTROL_ENABLE 0x1
282 #define RTS_CONTROL_HANDSHAKE 0x2
283 #define RTS_CONTROL_TOGGLE 0x3
284 
285   typedef struct _DCB {
286     DWORD DCBlength;
287     DWORD BaudRate;
288     DWORD fBinary: 1;
289     DWORD fParity: 1;
290     DWORD fOutxCtsFlow:1;
291     DWORD fOutxDsrFlow:1;
292     DWORD fDtrControl:2;
293     DWORD fDsrSensitivity:1;
294     DWORD fTXContinueOnXoff: 1;
295     DWORD fOutX: 1;
296     DWORD fInX: 1;
297     DWORD fErrorChar: 1;
298     DWORD fNull: 1;
299     DWORD fRtsControl:2;
300     DWORD fAbortOnError:1;
301     DWORD fDummy2:17;
302     WORD wReserved;
303     WORD XonLim;
304     WORD XoffLim;
305     BYTE ByteSize;
306     BYTE Parity;
307     BYTE StopBits;
308     char XonChar;
309     char XoffChar;
310     char ErrorChar;
311     char EofChar;
312     char EvtChar;
313     WORD wReserved1;
314   } DCB,*LPDCB;
315 
316   typedef struct _COMMTIMEOUTS {
317     DWORD ReadIntervalTimeout;
318     DWORD ReadTotalTimeoutMultiplier;
319     DWORD ReadTotalTimeoutConstant;
320     DWORD WriteTotalTimeoutMultiplier;
321     DWORD WriteTotalTimeoutConstant;
322   } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
323 
324   typedef struct _COMMCONFIG {
325     DWORD dwSize;
326     WORD wVersion;
327     WORD wReserved;
328     DCB dcb;
329     DWORD dwProviderSubType;
330     DWORD dwProviderOffset;
331     DWORD dwProviderSize;
332     WCHAR wcProviderData[1];
333   } COMMCONFIG,*LPCOMMCONFIG;
334 
335 #define FreeModule(hLibModule) FreeLibrary((hLibModule))
336 #define MakeProcInstance(lpProc,hInstance) (lpProc)
337 #define FreeProcInstance(lpProc) (lpProc)
338 
339 #define GMEM_FIXED 0x0
340 #define GMEM_MOVEABLE 0x2
341 #define GMEM_NOCOMPACT 0x10
342 #define GMEM_NODISCARD 0x20
343 #define GMEM_ZEROINIT 0x40
344 #define GMEM_MODIFY 0x80
345 #define GMEM_DISCARDABLE 0x100
346 #define GMEM_NOT_BANKED 0x1000
347 #define GMEM_SHARE 0x2000
348 #define GMEM_DDESHARE 0x2000
349 #define GMEM_NOTIFY 0x4000
350 #define GMEM_LOWER GMEM_NOT_BANKED
351 #define GMEM_VALID_FLAGS 0x7f72
352 #define GMEM_INVALID_HANDLE 0x8000
353 
354 #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
355 #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
356 
357 #define GlobalLRUNewest(h) ((HANDLE)(h))
358 #define GlobalLRUOldest(h) ((HANDLE)(h))
359 #define GlobalDiscard(h) GlobalReAlloc ((h), 0, GMEM_MOVEABLE)
360 
361 #define GMEM_DISCARDED 0x4000
362 #define GMEM_LOCKCOUNT 0x00ff
363 
364   typedef struct _MEMORYSTATUS {
365     DWORD dwLength;
366     DWORD dwMemoryLoad;
367     SIZE_T dwTotalPhys;
368     SIZE_T dwAvailPhys;
369     SIZE_T dwTotalPageFile;
370     SIZE_T dwAvailPageFile;
371     SIZE_T dwTotalVirtual;
372     SIZE_T dwAvailVirtual;
373   } MEMORYSTATUS,*LPMEMORYSTATUS;
374 
375 #define NUMA_NO_PREFERRED_NODE ((DWORD) -1)
376 
377 #define DEBUG_PROCESS 0x1
378 #define DEBUG_ONLY_THIS_PROCESS 0x2
379 #define CREATE_SUSPENDED 0x4
380 #define DETACHED_PROCESS 0x8
381 #define CREATE_NEW_CONSOLE 0x10
382 #define NORMAL_PRIORITY_CLASS 0x20
383 #define IDLE_PRIORITY_CLASS 0x40
384 #define HIGH_PRIORITY_CLASS 0x80
385 #define REALTIME_PRIORITY_CLASS 0x100
386 #define CREATE_NEW_PROCESS_GROUP 0x200
387 #define CREATE_UNICODE_ENVIRONMENT 0x400
388 #define CREATE_SEPARATE_WOW_VDM 0x800
389 #define CREATE_SHARED_WOW_VDM 0x1000
390 #define CREATE_FORCEDOS 0x2000
391 #define BELOW_NORMAL_PRIORITY_CLASS 0x4000
392 #define ABOVE_NORMAL_PRIORITY_CLASS 0x8000
393 #define INHERIT_PARENT_AFFINITY 0x10000
394 #define INHERIT_CALLER_PRIORITY 0x20000
395 #define CREATE_PROTECTED_PROCESS 0x40000
396 #define EXTENDED_STARTUPINFO_PRESENT 0x80000
397 #define PROCESS_MODE_BACKGROUND_BEGIN 0x100000
398 #define PROCESS_MODE_BACKGROUND_END 0x200000
399 #define CREATE_BREAKAWAY_FROM_JOB 0x1000000
400 #define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x2000000
401 #define CREATE_DEFAULT_ERROR_MODE 0x4000000
402 #define CREATE_NO_WINDOW 0x8000000
403 #define PROFILE_USER 0x10000000
404 #define PROFILE_KERNEL 0x20000000
405 #define PROFILE_SERVER 0x40000000
406 #define CREATE_IGNORE_SYSTEM_DEFAULT 0x80000000
407 
408 #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x10000
409 
410 #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
411 #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
412 #define THREAD_PRIORITY_NORMAL 0
413 #define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
414 #define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
415 #define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)
416 
417 #define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
418 #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
419 
420 #define THREAD_MODE_BACKGROUND_BEGIN 0x00010000
421 #define THREAD_MODE_BACKGROUND_END 0x00020000
422 
423 #define VOLUME_NAME_DOS 0x0
424 #define VOLUME_NAME_GUID 0x1
425 #define VOLUME_NAME_NT 0x2
426 #define VOLUME_NAME_NONE 0x4
427 
428 #define FILE_NAME_NORMALIZED 0x0
429 #define FILE_NAME_OPENED 0x8
430 
431   typedef struct _JIT_DEBUG_INFO {
432     DWORD dwSize;
433     DWORD dwProcessorArchitecture;
434     DWORD dwThreadID;
435     DWORD dwReserved0;
436     ULONG64 lpExceptionAddress;
437     ULONG64 lpExceptionRecord;
438     ULONG64 lpContextRecord;
439   } JIT_DEBUG_INFO,*LPJIT_DEBUG_INFO;
440 
441   typedef JIT_DEBUG_INFO JIT_DEBUG_INFO32, *LPJIT_DEBUG_INFO32;
442   typedef JIT_DEBUG_INFO JIT_DEBUG_INFO64, *LPJIT_DEBUG_INFO64;
443 
444 #ifndef __WIDL__
445   typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
446   typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
447 #endif
448 
449 #define DRIVE_UNKNOWN 0
450 #define DRIVE_NO_ROOT_DIR 1
451 #define DRIVE_REMOVABLE 2
452 #define DRIVE_FIXED 3
453 #define DRIVE_REMOTE 4
454 #define DRIVE_CDROM 5
455 #define DRIVE_RAMDISK 6
456 
457 #define GetFreeSpace(w) (__MSABI_LONG(0x100000))
458 
459 #define FILE_TYPE_UNKNOWN 0x0
460 #define FILE_TYPE_DISK 0x1
461 #define FILE_TYPE_CHAR 0x2
462 #define FILE_TYPE_PIPE 0x3
463 #define FILE_TYPE_REMOTE 0x8000
464 
465 #define STD_INPUT_HANDLE ((DWORD)-10)
466 #define STD_OUTPUT_HANDLE ((DWORD)-11)
467 #define STD_ERROR_HANDLE ((DWORD)-12)
468 
469 #define NOPARITY 0
470 #define ODDPARITY 1
471 #define EVENPARITY 2
472 #define MARKPARITY 3
473 #define SPACEPARITY 4
474 
475 #define ONESTOPBIT 0
476 #define ONE5STOPBITS 1
477 #define TWOSTOPBITS 2
478 
479 #define IGNORE 0
480 #define INFINITE 0xffffffff
481 
482 #define CBR_110 110
483 #define CBR_300 300
484 #define CBR_600 600
485 #define CBR_1200 1200
486 #define CBR_2400 2400
487 #define CBR_4800 4800
488 #define CBR_9600 9600
489 #define CBR_14400 14400
490 #define CBR_19200 19200
491 #define CBR_38400 38400
492 #define CBR_56000 56000
493 #define CBR_57600 57600
494 #define CBR_115200 115200
495 #define CBR_128000 128000
496 #define CBR_256000 256000
497 
498 #define CE_RXOVER 0x1
499 #define CE_OVERRUN 0x2
500 #define CE_RXPARITY 0x4
501 #define CE_FRAME 0x8
502 #define CE_BREAK 0x10
503 #define CE_TXFULL 0x100
504 #define CE_PTO 0x200
505 #define CE_IOE 0x400
506 #define CE_DNS 0x800
507 #define CE_OOP 0x1000
508 #define CE_MODE 0x8000
509 
510 #define IE_BADID (-1)
511 #define IE_OPEN (-2)
512 #define IE_NOPEN (-3)
513 #define IE_MEMORY (-4)
514 #define IE_DEFAULT (-5)
515 #define IE_HARDWARE (-10)
516 #define IE_BYTESIZE (-11)
517 #define IE_BAUDRATE (-12)
518 
519 #define EV_RXCHAR 0x1
520 #define EV_RXFLAG 0x2
521 #define EV_TXEMPTY 0x4
522 #define EV_CTS 0x8
523 #define EV_DSR 0x10
524 #define EV_RLSD 0x20
525 #define EV_BREAK 0x40
526 #define EV_ERR 0x80
527 #define EV_RING 0x100
528 #define EV_PERR 0x200
529 #define EV_RX80FULL 0x400
530 #define EV_EVENT1 0x800
531 #define EV_EVENT2 0x1000
532 
533 #define SETXOFF 1
534 #define SETXON 2
535 #define SETRTS 3
536 #define CLRRTS 4
537 #define SETDTR 5
538 #define CLRDTR 6
539 #define RESETDEV 7
540 #define SETBREAK 8
541 #define CLRBREAK 9
542 
543 #define PURGE_TXABORT 0x1
544 #define PURGE_RXABORT 0x2
545 #define PURGE_TXCLEAR 0x4
546 #define PURGE_RXCLEAR 0x8
547 
548 #define LPTx 0x80
549 
550 #define MS_CTS_ON ((DWORD)0x10)
551 #define MS_DSR_ON ((DWORD)0x20)
552 #define MS_RING_ON ((DWORD)0x40)
553 #define MS_RLSD_ON ((DWORD)0x80)
554 
555 #define S_QUEUEEMPTY 0
556 #define S_THRESHOLD 1
557 #define S_ALLTHRESHOLD 2
558 
559 #define S_NORMAL 0
560 #define S_LEGATO 1
561 #define S_STACCATO 2
562 
563 #define S_PERIOD512 0
564 #define S_PERIOD1024 1
565 #define S_PERIOD2048 2
566 #define S_PERIODVOICE 3
567 #define S_WHITE512 4
568 #define S_WHITE1024 5
569 #define S_WHITE2048 6
570 #define S_WHITEVOICE 7
571 
572 #define S_SERDVNA (-1)
573 #define S_SEROFM (-2)
574 #define S_SERMACT (-3)
575 #define S_SERQFUL (-4)
576 #define S_SERBDNT (-5)
577 #define S_SERDLN (-6)
578 #define S_SERDCC (-7)
579 #define S_SERDTP (-8)
580 #define S_SERDVL (-9)
581 #define S_SERDMD (-10)
582 #define S_SERDSH (-11)
583 #define S_SERDPT (-12)
584 #define S_SERDFQ (-13)
585 #define S_SERDDR (-14)
586 #define S_SERDSR (-15)
587 #define S_SERDST (-16)
588 
589 #define NMPWAIT_WAIT_FOREVER 0xffffffff
590 #define NMPWAIT_NOWAIT 0x1
591 #define NMPWAIT_USE_DEFAULT_WAIT 0x0
592 
593 #define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
594 #define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
595 #define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
596 #define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS
597 #define FS_VOL_IS_COMPRESSED FILE_VOLUME_IS_COMPRESSED
598 #define FS_FILE_COMPRESSION FILE_FILE_COMPRESSION
599 #define FS_FILE_ENCRYPTION FILE_SUPPORTS_ENCRYPTION
600 
601 #define OF_READ 0x0
602 #define OF_WRITE 0x1
603 #define OF_READWRITE 0x2
604 #define OF_SHARE_COMPAT 0x0
605 #define OF_SHARE_EXCLUSIVE 0x10
606 #define OF_SHARE_DENY_WRITE 0x20
607 #define OF_SHARE_DENY_READ 0x30
608 #define OF_SHARE_DENY_NONE 0x40
609 #define OF_PARSE 0x100
610 #define OF_DELETE 0x200
611 #define OF_VERIFY 0x400
612 #define OF_CANCEL 0x800
613 #define OF_CREATE 0x1000
614 #define OF_PROMPT 0x2000
615 #define OF_EXIST 0x4000
616 #define OF_REOPEN 0x8000
617 
618 #define OFS_MAXPATHNAME 128
619 
620   typedef struct _OFSTRUCT {
621     BYTE cBytes;
622     BYTE fFixedDisk;
623     WORD nErrCode;
624     WORD Reserved1;
625     WORD Reserved2;
626     CHAR szPathName[OFS_MAXPATHNAME];
627   } OFSTRUCT, *LPOFSTRUCT,*POFSTRUCT;
628 
629 #ifndef NOWINBASEINTERLOCK
630 #ifndef _NTOS_
631 #if defined (__ia64__) && !defined (RC_INVOKED)
632 
633 #define InterlockedIncrement _InterlockedIncrement
634 #define InterlockedIncrementAcquire _InterlockedIncrement_acq
635 #define InterlockedIncrementRelease _InterlockedIncrement_rel
636 #define InterlockedDecrement _InterlockedDecrement
637 #define InterlockedDecrementAcquire _InterlockedDecrement_acq
638 #define InterlockedDecrementRelease _InterlockedDecrement_rel
639 #define InterlockedExchange _InterlockedExchange
640 #define InterlockedExchangeAdd _InterlockedExchangeAdd
641 #define InterlockedCompareExchange _InterlockedCompareExchange
642 #define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq
643 #define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel
644 #define InterlockedExchangePointer _InterlockedExchangePointer
645 #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
646 #define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer_rel
647 #define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer_acq
648 
649 #define InterlockedIncrement64 _InterlockedIncrement64
650 #define InterlockedDecrement64 _InterlockedDecrement64
651 #define InterlockedExchange64 _InterlockedExchange64
652 #define InterlockedExchangeAcquire64 _InterlockedExchange64_acq
653 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
654 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
655 #define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq
656 #define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel
657 #define InterlockedCompare64Exchange128 _InterlockedCompare64Exchange128
658 #define InterlockedCompare64ExchangeAcquire128 _InterlockedCompare64Exchange128_acq
659 #define InterlockedCompare64ExchangeRelease128 _InterlockedCompare64Exchange128_rel
660 
661 #define InterlockedOr _InterlockedOr
662 #define InterlockedOrAcquire _InterlockedOr_acq
663 #define InterlockedOrRelease _InterlockedOr_rel
664 #define InterlockedOr8 _InterlockedOr8
665 #define InterlockedOr8Acquire _InterlockedOr8_acq
666 #define InterlockedOr8Release _InterlockedOr8_rel
667 #define InterlockedOr16 _InterlockedOr16
668 #define InterlockedOr16Acquire _InterlockedOr16_acq
669 #define InterlockedOr16Release _InterlockedOr16_rel
670 #define InterlockedOr64 _InterlockedOr64
671 #define InterlockedOr64Acquire _InterlockedOr64_acq
672 #define InterlockedOr64Release _InterlockedOr64_rel
673 #define InterlockedXor _InterlockedXor
674 #define InterlockedXorAcquire _InterlockedXor_acq
675 #define InterlockedXorRelease _InterlockedXor_rel
676 #define InterlockedXor8 _InterlockedXor8
677 #define InterlockedXor8Acquire _InterlockedXor8_acq
678 #define InterlockedXor8Release _InterlockedXor8_rel
679 #define InterlockedXor16 _InterlockedXor16
680 #define InterlockedXor16Acquire _InterlockedXor16_acq
681 #define InterlockedXor16Release _InterlockedXor16_rel
682 #define InterlockedXor64 _InterlockedXor64
683 #define InterlockedXor64Acquire _InterlockedXor64_acq
684 #define InterlockedXor64Release _InterlockedXor64_rel
685 #define InterlockedAnd _InterlockedAnd
686 #define InterlockedAndAcquire _InterlockedAnd_acq
687 #define InterlockedAndRelease _InterlockedAnd_rel
688 #define InterlockedAnd8 _InterlockedAnd8
689 #define InterlockedAnd8Acquire _InterlockedAnd8_acq
690 #define InterlockedAnd8Release _InterlockedAnd8_rel
691 #define InterlockedAnd16 _InterlockedAnd16
692 #define InterlockedAnd16Acquire _InterlockedAnd16_acq
693 #define InterlockedAnd16Release _InterlockedAnd16_rel
694 #define InterlockedAnd64 _InterlockedAnd64
695 #define InterlockedAnd64Acquire _InterlockedAnd64_acq
696 #define InterlockedAnd64Release _InterlockedAnd64_rel
697 
698   LONG __cdecl InterlockedOr (LONG volatile *Destination, LONG Value);
699   LONG __cdecl InterlockedOrAcquire (LONG volatile *Destination, LONG Value);
700   LONG __cdecl InterlockedOrRelease (LONG volatile *Destination, LONG Value);
701   char __cdecl InterlockedOr8 (char volatile *Destination, char Value);
702   char __cdecl InterlockedOr8Acquire (char volatile *Destination, char Value);
703   char __cdecl InterlockedOr8Release (char volatile *Destination, char Value);
704   SHORT __cdecl InterlockedOr16 (SHORT volatile *Destination, SHORT Value);
705   SHORT __cdecl InterlockedOr16Acquire (SHORT volatile *Destination, SHORT Value);
706   SHORT __cdecl InterlockedOr16Release (SHORT volatile *Destination, SHORT Value);
707   LONGLONG __cdecl InterlockedOr64 (LONGLONG volatile *Destination, LONGLONG Value);
708   LONGLONG __cdecl InterlockedOr64Acquire (LONGLONG volatile *Destination, LONGLONG Value);
709   LONGLONG __cdecl InterlockedOr64Release (LONGLONG volatile *Destination, LONGLONG Value);
710   LONG __cdecl InterlockedXor (LONG volatile *Destination, LONG Value);
711   LONG __cdecl InterlockedXorAcquire (LONG volatile *Destination, LONG Value);
712   LONG __cdecl InterlockedXorRelease (LONG volatile *Destination, LONG Value);
713   char __cdecl InterlockedXor8 (char volatile *Destination, char Value);
714   char __cdecl InterlockedXor8Acquire (char volatile *Destination, char Value);
715   char __cdecl InterlockedXor8Release (char volatile *Destination, char Value);
716   SHORT __cdecl InterlockedXor16 (SHORT volatile *Destination, SHORT Value);
717   SHORT __cdecl InterlockedXor16Acquire (SHORT volatile *Destination, SHORT Value);
718   SHORT __cdecl InterlockedXor16Release (SHORT volatile *Destination, SHORT Value);
719   LONGLONG __cdecl InterlockedXor64 (LONGLONG volatile *Destination, LONGLONG Value);
720   LONGLONG __cdecl InterlockedXor64Acquire (LONGLONG volatile *Destination, LONGLONG Value);
721   LONGLONG __cdecl InterlockedXor64Release (LONGLONG volatile *Destination, LONGLONG Value);
722   LONG __cdecl InterlockedAnd (LONG volatile *Destination, LONG Value);
723   LONG __cdecl InterlockedAndAcquire (LONG volatile *Destination, LONG Value);
724   LONG __cdecl InterlockedAndRelease (LONG volatile *Destination, LONG Value);
725   char __cdecl InterlockedAnd8 (char volatile *Destination, char Value);
726   char __cdecl InterlockedAnd8Acquire (char volatile *Destination, char Value);
727   char __cdecl InterlockedAnd8Release (char volatile *Destination, char Value);
728   SHORT __cdecl InterlockedAnd16 (SHORT volatile *Destination, SHORT Value);
729   SHORT __cdecl InterlockedAnd16Acquire (SHORT volatile *Destination, SHORT Value);
730   SHORT __cdecl InterlockedAnd16Release (SHORT volatile *Destination, SHORT Value);
731   LONGLONG __cdecl InterlockedAnd64 (LONGLONG volatile *Destination, LONGLONG Value);
732   LONGLONG __cdecl InterlockedAnd64Acquire (LONGLONG volatile *Destination, LONGLONG Value);
733   LONGLONG __cdecl InterlockedAnd64Release (LONGLONG volatile *Destination, LONGLONG Value);
734   LONGLONG __cdecl InterlockedIncrement64 (LONGLONG volatile *Addend);
735   LONGLONG __cdecl InterlockedDecrement64 (LONGLONG volatile *Addend);
736   LONG __cdecl InterlockedIncrementAcquire (LONG volatile *Addend);
737   LONG __cdecl InterlockedDecrementAcquire (LONG volatile *Addend);
738   LONG __cdecl InterlockedIncrementRelease (LONG volatile *Addend);
739   LONG __cdecl InterlockedDecrementRelease (LONG volatile *Addend);
740   LONGLONG __cdecl InterlockedExchange64 (LONGLONG volatile *Target, LONGLONG Value);
741   LONGLONG __cdecl InterlockedExchangeAcquire64 (LONGLONG volatile *Target, LONGLONG Value);
742   LONGLONG __cdecl InterlockedExchangeAdd64 (LONGLONG volatile *Addend, LONGLONG Value);
743   LONGLONG __cdecl InterlockedCompareExchange64 (LONGLONG volatile *Destination, LONGLONG ExChange, LONGLONG Comperand);
744   LONGLONG __cdecl InterlockedCompareExchangeAcquire64 (LONGLONG volatile *Destination, LONGLONG ExChange, LONGLONG Comperand);
745   LONGLONG __cdecl InterlockedCompareExchangeRelease64 (LONGLONG volatile *Destination, LONGLONG ExChange, LONGLONG Comperand);
746   LONG64 __cdecl InterlockedCompare64Exchange128 (LONG64 volatile *Destination, LONG64 ExchangeHigh, LONG64 ExchangeLow, LONG64 Comperand);
747   LONG64 __cdecl InterlockedCompare64ExchangeAcquire128 (LONG64 volatile *Destination, LONG64 ExchangeHigh, LONG64 ExchangeLow, LONG64 Comperand);
748   LONG64 __cdecl InterlockedCompare64ExchangeRelease128 (LONG64 volatile *Destination, LONG64 ExchangeHigh, LONG64 ExchangeLow, LONG64 Comperand);
749   LONG __cdecl InterlockedIncrement (LONG volatile *lpAddend);
750   LONG __cdecl InterlockedDecrement (LONG volatile *lpAddend);
751   LONG __cdecl InterlockedExchange (LONG volatile *Target, LONG Value);
752   LONG __cdecl InterlockedExchangeAdd (LONG volatile *Addend, LONG Value);
753   LONG __cdecl InterlockedCompareExchange (LONG volatile *Destination, LONG ExChange, LONG Comperand);
754   LONG __cdecl InterlockedCompareExchangeRelease (LONG volatile *Destination, LONG ExChange, LONG Comperand);
755   LONG __cdecl InterlockedCompareExchangeAcquire (LONG volatile *Destination, LONG ExChange, LONG Comperand);
756   PVOID __cdecl InterlockedExchangePointer (PVOID volatile *Target, PVOID Value);
757   PVOID __cdecl InterlockedCompareExchangePointer (PVOID volatile *Destination, PVOID ExChange, PVOID Comperand);
758   PVOID __cdecl InterlockedCompareExchangePointerAcquire (PVOID volatile *Destination, PVOID Exchange, PVOID Comperand);
759   PVOID __cdecl InterlockedCompareExchangePointerRelease (PVOID volatile *Destination, PVOID Exchange, PVOID Comperand);
760 
761 #if !defined(__WIDL__) && !defined(__CRT__NO_INLINE)
762 #ifndef InterlockedAnd
763 #define InterlockedAnd InterlockedAnd_Inline
764 
InterlockedAnd_Inline(LONG volatile * Target,LONG Set)765   FORCEINLINE LONG InterlockedAnd_Inline(LONG volatile *Target, LONG Set) {
766     LONG i, j = *Target;
767 
768     do {
769       i = j;
770       j = InterlockedCompareExchange (Target, i &Set, i);
771     } while (i != j);
772     return j;
773   }
774 #endif
775 
776 #ifndef InterlockedOr
777 #define InterlockedOr InterlockedOr_Inline
778 
InterlockedOr_Inline(LONG volatile * Target,LONG Set)779   FORCEINLINE LONG InterlockedOr_Inline(LONG volatile *Target, LONG Set) {
780     LONG i, j = *Target;
781 
782     do {
783       i = j;
784       j = InterlockedCompareExchange (Target, i | Set, i);
785     } while (i != j);
786     return j;
787   }
788 #endif
789 
790 #ifndef InterlockedXor
791 #define InterlockedXor InterlockedXor_Inline
792 
InterlockedXor_Inline(LONG volatile * Target,LONG Set)793   FORCEINLINE LONG InterlockedXor_Inline(LONG volatile *Target, LONG Set) {
794     LONG i, j = *Target;
795 
796     do {
797       i = j;
798       j = InterlockedCompareExchange (Target, i ^ Set, i);
799     } while (i != j);
800     return j;
801   }
802 #endif
803 
804 #ifndef InterlockedAnd64
805 #define InterlockedAnd64 InterlockedAnd64_Inline
806 
InterlockedAnd64_Inline(LONGLONG volatile * Destination,LONGLONG Value)807   FORCEINLINE LONGLONG InterlockedAnd64_Inline(LONGLONG volatile *Destination, LONGLONG Value) {
808     LONGLONG Old;
809 
810     do {
811       Old = *Destination;
812     } while (InterlockedCompareExchange64 (Destination, Old &Value, Old) != Old);
813     return Old;
814   }
815 #endif
816 
817 #ifndef InterlockedOr64
818 #define InterlockedOr64 InterlockedOr64_Inline
819 
InterlockedOr64_Inline(LONGLONG volatile * Destination,LONGLONG Value)820   FORCEINLINE LONGLONG InterlockedOr64_Inline(LONGLONG volatile *Destination, LONGLONG Value) {
821     LONGLONG Old;
822 
823     do {
824       Old = *Destination;
825     } while (InterlockedCompareExchange64 (Destination, Old | Value, Old) != Old);
826     return Old;
827   }
828 #endif
829 
830 #ifndef InterlockedXor64
831 #define InterlockedXor64 InterlockedXor64_Inline
832 
InterlockedXor64_Inline(LONGLONG volatile * Destination,LONGLONG Value)833   FORCEINLINE LONGLONG InterlockedXor64_Inline(LONGLONG volatile *Destination, LONGLONG Value) {
834     LONGLONG Old;
835 
836     do {
837       Old = *Destination;
838     } while (InterlockedCompareExchange64 (Destination, Old ^ Value, Old) != Old);
839     return Old;
840   }
841 #endif
842 
843 #ifndef InterlockedBitTestAndSet
844 #define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline
845 
InterlockedBitTestAndSet_Inline(LONG volatile * Base,LONG Bit)846   FORCEINLINE BOOLEAN InterlockedBitTestAndSet_Inline(LONG volatile *Base, LONG Bit) {
847     LONG tBit = 1 << (Bit & (sizeof (*Base) * 8 - 1));
848 
849     return (BOOLEAN) ((InterlockedOr (&Base[Bit / (sizeof (*Base) * 8)], tBit) & tBit) != 0);
850   }
851 #endif
852 
853 #ifndef InterlockedBitTestAndReset
854 #define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline
855 
InterlockedBitTestAndReset_Inline(LONG volatile * Base,LONG Bit)856   FORCEINLINE BOOLEAN InterlockedBitTestAndReset_Inline(LONG volatile *Base, LONG Bit) {
857     LONG tBit = 1 << (Bit & (sizeof (*Base) * 8 - 1));
858 
859     return (BOOLEAN) ((InterlockedAnd (&Base[Bit / (sizeof (*Base) * 8)], ~tBit) & tBit) != 0);
860   }
861 #endif
862 
863 #ifndef InterlockedBitTestAndComplement
864 #define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline
865 
InterlockedBitTestAndComplement_Inline(LONG volatile * Base,LONG Bit)866   FORCEINLINE BOOLEAN InterlockedBitTestAndComplement_Inline(LONG volatile *Base, LONG Bit) {
867     LONG tBit = 1 << (Bit & (sizeof (*Base) * 8 - 1));
868 
869     return (BOOLEAN) ((InterlockedXor (&Base[Bit / (sizeof (*Base) * 8)], tBit) & tBit) != 0);
870   }
871 #endif
872 #endif
873 
874 #elif defined (__x86_64__) && !defined (RC_INVOKED)
875 #define InterlockedIncrement _InterlockedIncrement
876 #define InterlockedIncrementAcquire InterlockedIncrement
877 #define InterlockedIncrementRelease InterlockedIncrement
878 #define InterlockedDecrement _InterlockedDecrement
879 #define InterlockedDecrementAcquire InterlockedDecrement
880 #define InterlockedDecrementRelease InterlockedDecrement
881 #define InterlockedExchange _InterlockedExchange
882 #define InterlockedExchangeAdd _InterlockedExchangeAdd
883 #define InterlockedCompareExchange _InterlockedCompareExchange
884 #define InterlockedCompareExchangeAcquire InterlockedCompareExchange
885 #define InterlockedCompareExchangeRelease InterlockedCompareExchange
886 #define InterlockedExchangePointer _InterlockedExchangePointer
887 #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
888 #define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer
889 #define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer
890 #define InterlockedAnd64 _InterlockedAnd64
891 #define InterlockedOr64 _InterlockedOr64
892 #define InterlockedXor64 _InterlockedXor64
893 #define InterlockedIncrement64 _InterlockedIncrement64
894 #define InterlockedDecrement64 _InterlockedDecrement64
895 #define InterlockedExchange64 _InterlockedExchange64
896 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
897 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
898 #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
899 #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
900 
901 #define InterlockedAnd8 _InterlockedAnd8
902 #define InterlockedOr8 _InterlockedOr8
903 #define InterlockedXor8 _InterlockedXor8
904 #define InterlockedAnd16 _InterlockedAnd16
905 #define InterlockedOr16 _InterlockedOr16
906 #define InterlockedXor16 _InterlockedXor16
907 
908   LONG __cdecl InterlockedAnd(LONG volatile *Destination, LONG Value);
909   LONG __cdecl InterlockedOr(LONG volatile *Destination, LONG Value);
910   LONG __cdecl InterlockedXor(LONG volatile *Destination, LONG Value);
911   /* moved to psdk_inc/intrin-impl.h
912   LONG __cdecl InterlockedIncrement(LONG volatile *Addend);
913   LONG __cdecl InterlockedDecrement(LONG volatile *Addend);
914   LONG __cdecl InterlockedExchange(LONG volatile *Target, LONG Value);
915   LONG __cdecl InterlockedExchangeAdd(LONG volatile *Addend, LONG Value);
916   LONG __cdecl InterlockedCompareExchange(LONG volatile *Destination, LONG ExChange, LONG Comperand);
917   PVOID __cdecl InterlockedCompareExchangePointer(PVOID volatile *Destination, PVOID Exchange, PVOID Comperand);
918   PVOID __cdecl InterlockedExchangePointer(PVOID volatile *Target, PVOID Value);
919   LONG64 __cdecl InterlockedAnd64(LONG64 volatile *Destination, LONG64 Value);
920   LONG64 __cdecl InterlockedOr64(LONG64 volatile *Destination, LONG64 Value);
921   LONG64 __cdecl InterlockedXor64(LONG64 volatile *Destination, LONG64 Value);
922   LONG64 __cdecl InterlockedIncrement64(LONG64 volatile *Addend);
923   LONG64 __cdecl InterlockedDecrement64(LONG64 volatile *Addend);
924   LONG64 __cdecl InterlockedExchange64(LONG64 volatile *Target, LONG64 Value);
925   LONG64 __cdecl InterlockedExchangeAdd64(LONG64 volatile *Addend, LONG64 Value);
926   LONG64 __cdecl InterlockedCompareExchange64(LONG64 volatile *Destination, LONG64 ExChange, LONG64 Comperand); */
927 
928   char __cdecl InterlockedAnd8(char volatile *Destination, char Value);
929   char __cdecl InterlockedOr8(char volatile *Destination, char Value);
930   char __cdecl InterlockedXor8(char volatile *Destination, char Value);
931   SHORT __cdecl InterlockedAnd16(SHORT volatile *Destination, SHORT Value);
932   SHORT __cdecl InterlockedOr16(SHORT volatile *Destination, SHORT Value);
933   SHORT __cdecl InterlockedXor16(SHORT volatile *Destination, SHORT Value);
934 
935 #elif defined (__aarch64__) && !defined (RC_INVOKED)
936 #define InterlockedAnd _InterlockedAnd
937 #define InterlockedOr _InterlockedOr
938 #define InterlockedXor _InterlockedXor
939 #define InterlockedIncrement _InterlockedIncrement
940 #define InterlockedDecrement _InterlockedDecrement
941 #define InterlockedExchange _InterlockedExchange
942 #define InterlockedExchangeAdd _InterlockedExchangeAdd
943 #define InterlockedExchangePointer _InterlockedExchangePointer
944 #define InterlockedCompareExchange _InterlockedCompareExchange
945 #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
946 #define InterlockedAnd64 _InterlockedAnd64
947 #define InterlockedOr64 _InterlockedOr64
948 #define InterlockedXor64 _InterlockedXor64
949 #define InterlockedIncrement64 _InterlockedIncrement64
950 #define InterlockedDecrement64 _InterlockedDecrement64
951 #define InterlockedExchange64 _InterlockedExchange64
952 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
953 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
954 
955   LONG InterlockedIncrement (LONG volatile *Addend);
956   LONG InterlockedDecrement (LONG volatile *Addend);
957   LONG InterlockedExchange (LONG volatile *Target, LONG Value);
958   LONG InterlockedExchangeAdd (LONG volatile *Addend, LONG Value);
959   LONG InterlockedCompareExchange (LONG volatile *Destination, LONG ExChange, LONG Comperand);
960   PVOID InterlockedCompareExchangePointer (PVOID volatile *Destination, PVOID Exchange, PVOID Comperand);
961   PVOID InterlockedExchangePointer (PVOID volatile *Target, PVOID Value);
962   LONG64 InterlockedAnd64 (LONG64 volatile *Destination, LONG64 Value);
963   LONG64 InterlockedOr64 (LONG64 volatile *Destination, LONG64 Value);
964   LONG64 InterlockedXor64 (LONG64 volatile *Destination, LONG64 Value);
965   LONG64 InterlockedIncrement64 (LONG64 volatile *Addend);
966   LONG64 InterlockedDecrement64 (LONG64 volatile *Addend);
967   LONG64 InterlockedExchange64 (LONG64 volatile *Target, LONG64 Value);
968   LONG64 InterlockedExchangeAdd64 (LONG64 volatile *Addend, LONG64 Value);
969   LONG64 InterlockedCompareExchange64 (LONG64 volatile *Destination, LONG64 ExChange, LONG64 Comperand);
970 #else
971 #if !defined (__WIDL__) && defined (__MINGW_INTRIN_INLINE)
972 
973 /* Clang has support for some MSVC builtins if building with -fms-extensions,
974  * GCC doesn't. */
975 #pragma push_macro("__has_builtin")
976 #ifndef __has_builtin
977   #define __has_builtin(x) 0
978 #endif
979 
980 #if !__has_builtin(_InterlockedAnd64)
InterlockedAnd64(LONGLONG volatile * Destination,LONGLONG Value)981   FORCEINLINE LONGLONG InterlockedAnd64 (LONGLONG volatile *Destination, LONGLONG Value) {
982     LONGLONG Old;
983 
984     do {
985       Old = *Destination;
986     } while (InterlockedCompareExchange64 (Destination, Old &Value, Old) != Old);
987     return Old;
988   }
989 #endif
990 
991 #if !__has_builtin(_InterlockedOr64)
InterlockedOr64(LONGLONG volatile * Destination,LONGLONG Value)992   FORCEINLINE LONGLONG InterlockedOr64 (LONGLONG volatile *Destination, LONGLONG Value) {
993     LONGLONG Old;
994 
995     do {
996       Old = *Destination;
997     } while (InterlockedCompareExchange64 (Destination, Old | Value, Old) != Old);
998     return Old;
999   }
1000 #endif
1001 
1002 #if !__has_builtin(_InterlockedXor64)
InterlockedXor64(LONGLONG volatile * Destination,LONGLONG Value)1003   FORCEINLINE LONGLONG InterlockedXor64 (LONGLONG volatile *Destination, LONGLONG Value) {
1004     LONGLONG Old;
1005 
1006     do {
1007       Old = *Destination;
1008     } while (InterlockedCompareExchange64 (Destination, Old ^ Value, Old) != Old);
1009     return Old;
1010   }
1011 #endif
1012 
1013 #if !__has_builtin(_InterlockedIncrement64)
InterlockedIncrement64(LONGLONG volatile * Addend)1014   FORCEINLINE LONGLONG InterlockedIncrement64 (LONGLONG volatile *Addend) {
1015     LONGLONG Old;
1016 
1017     do {
1018       Old = *Addend;
1019     } while (InterlockedCompareExchange64 (Addend, Old + 1, Old) != Old);
1020     return Old + 1;
1021   }
1022 #endif
1023 
1024 #if !__has_builtin(_InterlockedDecrement64)
InterlockedDecrement64(LONGLONG volatile * Addend)1025   FORCEINLINE LONGLONG InterlockedDecrement64 (LONGLONG volatile *Addend) {
1026     LONGLONG Old;
1027 
1028     do {
1029       Old = *Addend;
1030     } while (InterlockedCompareExchange64 (Addend, Old - 1, Old) != Old);
1031     return Old - 1;
1032   }
1033 #endif
1034 
1035 #if !__has_builtin(_InterlockedExchange64)
InterlockedExchange64(LONGLONG volatile * Target,LONGLONG Value)1036   FORCEINLINE LONGLONG InterlockedExchange64 (LONGLONG volatile *Target, LONGLONG Value) {
1037     LONGLONG Old;
1038 
1039     do {
1040       Old = *Target;
1041     } while (InterlockedCompareExchange64 (Target, Value, Old) != Old);
1042     return Old;
1043   }
1044 #endif
1045 
1046 #if !__has_builtin(_InterlockedExchangeAdd64)
InterlockedExchangeAdd64(LONGLONG volatile * Addend,LONGLONG Value)1047   FORCEINLINE LONGLONG InterlockedExchangeAdd64 (LONGLONG volatile *Addend, LONGLONG Value) {
1048     LONGLONG Old;
1049 
1050     do {
1051       Old = *Addend;
1052     } while (InterlockedCompareExchange64 (Addend, Old + Value, Old) != Old);
1053     return Old;
1054   }
1055 #endif
1056 
1057 #pragma pop_macro("__has_builtin")
1058 
1059 #endif
1060 
1061 #ifdef __cplusplus
__InlineInterlockedCompareExchangePointer(PVOID volatile * Destination,PVOID ExChange,PVOID Comperand)1062   FORCEINLINE PVOID __cdecl __InlineInterlockedCompareExchangePointer (PVOID volatile *Destination, PVOID ExChange, PVOID Comperand) {
1063     return ((PVOID) (LONG_PTR)InterlockedCompareExchange ((LONG volatile *)Destination,(LONG) (LONG_PTR)ExChange,(LONG) (LONG_PTR)Comperand));
1064   }
1065 
1066 #define InterlockedCompareExchangePointer __InlineInterlockedCompareExchangePointer
1067 #else
1068 #define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) (PVOID) (LONG_PTR)InterlockedCompareExchange ((LONG volatile *) (Destination),(LONG) (LONG_PTR) (ExChange),(LONG) (LONG_PTR) (Comperand))
1069 #endif
1070 
1071 #define InterlockedIncrementAcquire InterlockedIncrement
1072 #define InterlockedIncrementRelease InterlockedIncrement
1073 #define InterlockedDecrementAcquire InterlockedDecrement
1074 #define InterlockedDecrementRelease InterlockedDecrement
1075 #define InterlockedIncrementAcquire InterlockedIncrement
1076 #define InterlockedIncrementRelease InterlockedIncrement
1077 #define InterlockedCompareExchangeAcquire InterlockedCompareExchange
1078 #define InterlockedCompareExchangeRelease InterlockedCompareExchange
1079 #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
1080 #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
1081 #define InterlockedCompareExchangePointerAcquire InterlockedCompareExchangePointer
1082 #define InterlockedCompareExchangePointerRelease InterlockedCompareExchangePointer
1083 #endif
1084 #endif
1085 #endif
1086 
1087 #define UnlockResource(hResData) ( { (VOID)(hResData); 0; } )
1088 #define MAXINTATOM 0xc000
1089 #define MAKEINTATOM(i) (LPTSTR) ((ULONG_PTR)((WORD)(i)))
1090 #define INVALID_ATOM ((ATOM)0)
1091 #endif
1092 
1093 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
1094   WINBASEAPI HLOCAL WINAPI LocalAlloc (UINT uFlags, SIZE_T uBytes);
1095   WINBASEAPI HLOCAL WINAPI LocalFree (HLOCAL hMem);
1096 #endif
1097 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1098   int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
1099   int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd);
1100   WINBASEAPI HGLOBAL WINAPI GlobalAlloc (UINT uFlags, SIZE_T dwBytes);
1101   WINBASEAPI HGLOBAL WINAPI GlobalReAlloc (HGLOBAL hMem, SIZE_T dwBytes, UINT uFlags);
1102   WINBASEAPI SIZE_T WINAPI GlobalSize (HGLOBAL hMem);
1103   WINBASEAPI UINT WINAPI GlobalFlags (HGLOBAL hMem);
1104   WINBASEAPI LPVOID WINAPI GlobalLock (HGLOBAL hMem);
1105   WINBASEAPI HGLOBAL WINAPI GlobalHandle (LPCVOID pMem);
1106   WINBASEAPI WINBOOL WINAPI GlobalUnlock (HGLOBAL hMem);
1107   WINBASEAPI HGLOBAL WINAPI GlobalFree (HGLOBAL hMem);
1108   WINBASEAPI SIZE_T WINAPI GlobalCompact (DWORD dwMinFree);
1109   WINBASEAPI VOID WINAPI GlobalFix (HGLOBAL hMem);
1110   WINBASEAPI VOID WINAPI GlobalUnfix (HGLOBAL hMem);
1111   WINBASEAPI LPVOID WINAPI GlobalWire (HGLOBAL hMem);
1112   WINBASEAPI WINBOOL WINAPI GlobalUnWire (HGLOBAL hMem);
1113   WINBASEAPI VOID WINAPI GlobalMemoryStatus (LPMEMORYSTATUS lpBuffer);
1114   WINBASEAPI HLOCAL WINAPI LocalReAlloc (HLOCAL hMem, SIZE_T uBytes, UINT uFlags);
1115   WINBASEAPI LPVOID WINAPI LocalLock (HLOCAL hMem);
1116   WINBASEAPI HLOCAL WINAPI LocalHandle (LPCVOID pMem);
1117   WINBASEAPI WINBOOL WINAPI LocalUnlock (HLOCAL hMem);
1118   WINBASEAPI SIZE_T WINAPI LocalSize (HLOCAL hMem);
1119   WINBASEAPI UINT WINAPI LocalFlags (HLOCAL hMem);
1120   WINBASEAPI SIZE_T WINAPI LocalShrink (HLOCAL hMem, UINT cbNewSize);
1121   WINBASEAPI SIZE_T WINAPI LocalCompact (UINT uMinFree);
1122 #if _WIN32_WINNT >= 0x0600
1123   WINBASEAPI LPVOID WINAPI VirtualAllocExNuma (HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect, DWORD nndPreferred);
1124 #endif
1125 #if _WIN32_WINNT >= 0x0601
1126   WINBASEAPI WINBOOL WINAPI GetProcessorSystemCycleTime (USHORT Group, PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION Buffer, PDWORD ReturnedLength);
1127   WINBASEAPI WINBOOL WINAPI GetPhysicallyInstalledSystemMemory (PULONGLONG TotalMemoryInKilobytes);
1128 #endif
1129 
1130 #define SCS_32BIT_BINARY 0
1131 #define SCS_DOS_BINARY 1
1132 #define SCS_WOW_BINARY 2
1133 #define SCS_PIF_BINARY 3
1134 #define SCS_POSIX_BINARY 4
1135 #define SCS_OS216_BINARY 5
1136 #define SCS_64BIT_BINARY 6
1137 
1138 #ifdef _WIN64
1139 #define SCS_THIS_PLATFORM_BINARY SCS_64BIT_BINARY
1140 #else
1141 #define SCS_THIS_PLATFORM_BINARY SCS_32BIT_BINARY
1142 #endif
1143 
1144   WINBASEAPI WINBOOL WINAPI GetBinaryTypeA (LPCSTR lpApplicationName, LPDWORD lpBinaryType);
1145   WINBASEAPI WINBOOL WINAPI GetBinaryTypeW (LPCWSTR lpApplicationName, LPDWORD lpBinaryType);
1146   WINBASEAPI DWORD WINAPI GetShortPathNameA (LPCSTR lpszLongPath, LPSTR lpszShortPath, DWORD cchBuffer);
1147 #if _WIN32_WINNT >= 0x0600
1148   WINBASEAPI DWORD WINAPI GetLongPathNameTransactedA (LPCSTR lpszShortPath, LPSTR lpszLongPath, DWORD cchBuffer, HANDLE hTransaction);
1149   WINBASEAPI DWORD WINAPI GetLongPathNameTransactedW (LPCWSTR lpszShortPath, LPWSTR lpszLongPath, DWORD cchBuffer, HANDLE hTransaction);
1150 #endif
1151   WINBASEAPI WINBOOL WINAPI GetProcessAffinityMask (HANDLE hProcess, PDWORD_PTR lpProcessAffinityMask, PDWORD_PTR lpSystemAffinityMask);
1152   WINBASEAPI WINBOOL WINAPI SetProcessAffinityMask (HANDLE hProcess, DWORD_PTR dwProcessAffinityMask);
1153   WINBASEAPI WINBOOL WINAPI GetProcessIoCounters (HANDLE hProcess, PIO_COUNTERS lpIoCounters);
1154   WINBASEAPI WINBOOL WINAPI GetProcessWorkingSetSize (HANDLE hProcess, PSIZE_T lpMinimumWorkingSetSize, PSIZE_T lpMaximumWorkingSetSize);
1155   WINBASEAPI WINBOOL WINAPI SetProcessWorkingSetSize (HANDLE hProcess, SIZE_T dwMinimumWorkingSetSize, SIZE_T dwMaximumWorkingSetSize);
1156   WINBASEAPI VOID WINAPI FatalExit (int ExitCode);
1157   WINBASEAPI WINBOOL WINAPI SetEnvironmentStringsA (LPCH NewEnvironment);
1158 
1159 #ifndef UNICODE
1160 #define SetEnvironmentStrings SetEnvironmentStringsA
1161 #define GetShortPathName GetShortPathNameA
1162 #endif
1163 
1164 #define GetBinaryType __MINGW_NAME_AW(GetBinaryType)
1165 #if _WIN32_WINNT >= 0x0600
1166 #define GetLongPathNameTransacted __MINGW_NAME_AW(GetLongPathNameTransacted)
1167 #endif
1168 
1169 #endif
1170 
1171 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
1172   WINBASEAPI VOID WINAPI RaiseFailFastException (PEXCEPTION_RECORD pExceptionRecord, PCONTEXT pContextRecord, DWORD dwFlags);
1173   WINBASEAPI DWORD WINAPI SetThreadIdealProcessor (HANDLE hThread, DWORD dwIdealProcessor);
1174 #endif
1175 
1176 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1177 
1178 #define FIBER_FLAG_FLOAT_SWITCH 0x1
1179 
1180   WINBASEAPI LPVOID WINAPI CreateFiber (SIZE_T dwStackSize, LPFIBER_START_ROUTINE lpStartAddress, LPVOID lpParameter);
1181   WINBASEAPI LPVOID WINAPI CreateFiberEx (SIZE_T dwStackCommitSize, SIZE_T dwStackReserveSize, DWORD dwFlags, LPFIBER_START_ROUTINE lpStartAddress, LPVOID lpParameter);
1182   WINBASEAPI VOID WINAPI DeleteFiber (LPVOID lpFiber);
1183   WINBASEAPI LPVOID WINAPI ConvertThreadToFiber (LPVOID lpParameter);
1184   WINBASEAPI LPVOID WINAPI ConvertThreadToFiberEx (LPVOID lpParameter, DWORD dwFlags);
1185   WINBASEAPI WINBOOL WINAPI ConvertFiberToThread (VOID);
1186   WINBASEAPI VOID WINAPI SwitchToFiber (LPVOID lpFiber);
1187   WINBASEAPI DWORD_PTR WINAPI SetThreadAffinityMask (HANDLE hThread, DWORD_PTR dwThreadAffinityMask);
1188 
1189   /* TODO: Add RTL_UMS... to winnt.h header and add UMS-base API.  */
1190 
1191   typedef enum _THREAD_INFORMATION_CLASS {
1192     ThreadMemoryPriority,
1193     ThreadAbsoluteCpuPriority,
1194     ThreadInformationClassMax
1195   } THREAD_INFORMATION_CLASS;
1196 
1197   typedef enum _PROCESS_INFORMATION_CLASS {
1198     ProcessMemoryPriority,
1199     ProcessInformationClassMax
1200   } PROCESS_INFORMATION_CLASS;
1201 
1202 #if _WIN32_WINNT >= 0x0602
1203   WINBASEAPI WINBOOL WINAPI GetThreadInformation (HANDLE hThread, THREAD_INFORMATION_CLASS ThreadInformationClass, LPVOID ThreadInformation, DWORD ThreadInformationSize);
1204   WINBASEAPI WINBOOL WINAPI SetThreadInformation (HANDLE hThread, THREAD_INFORMATION_CLASS ThreadInformationClass, LPVOID ThreadInformation, DWORD ThreadInformationSize);
1205   WINBASEAPI WINBOOL WINAPI GetProcessInformation (HANDLE hProcess, PROCESS_INFORMATION_CLASS ProcessInformationClass, LPVOID ProcessInformation, DWORD ProcessInformationSize);
1206   WINBASEAPI WINBOOL WINAPI SetProcessInformation (HANDLE hProcess, PROCESS_INFORMATION_CLASS ProcessInformationClass, LPVOID ProcessInformation, DWORD ProcessInformationSize);
1207 #endif
1208 
1209 #if _WIN32_WINNT >= 0x0600
1210 #define PROCESS_DEP_ENABLE 0x00000001
1211 #define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
1212 
1213   WINBASEAPI WINBOOL WINAPI SetProcessDEPPolicy (DWORD dwFlags);
1214   WINBASEAPI WINBOOL WINAPI GetProcessDEPPolicy (HANDLE hProcess, LPDWORD lpFlags, PBOOL lpPermanent);
1215 #endif
1216 
1217   WINBASEAPI WINBOOL WINAPI SetProcessPriorityBoost (HANDLE hProcess, WINBOOL bDisablePriorityBoost);
1218   WINBASEAPI WINBOOL WINAPI GetProcessPriorityBoost (HANDLE hProcess, PBOOL pDisablePriorityBoost);
1219   WINBASEAPI WINBOOL WINAPI RequestWakeupLatency (LATENCY_TIME latency);
1220   WINBASEAPI WINBOOL WINAPI IsSystemResumeAutomatic (VOID);
1221   WINBASEAPI WINBOOL WINAPI GetThreadIOPendingFlag (HANDLE hThread, PBOOL lpIOIsPending);
1222   WINBASEAPI WINBOOL WINAPI GetThreadSelectorEntry (HANDLE hThread, DWORD dwSelector, LPLDT_ENTRY lpSelectorEntry);
1223   WINBASEAPI EXECUTION_STATE WINAPI SetThreadExecutionState (EXECUTION_STATE esFlags);
1224 
1225 #if _WIN32_WINNT >= 0x0601
1226   typedef REASON_CONTEXT POWER_REQUEST_CONTEXT,*PPOWER_REQUEST_CONTEXT,*LPPOWER_REQUEST_CONTEXT;
1227 
1228   WINBASEAPI HANDLE WINAPI PowerCreateRequest (PREASON_CONTEXT Context);
1229   WINBASEAPI WINBOOL WINAPI PowerSetRequest (HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType);
1230   WINBASEAPI WINBOOL WINAPI PowerClearRequest (HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType);
1231 #endif
1232 #endif
1233 
1234 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1235 #if !defined (RC_INVOKED) && defined (WINBASE_DECLARE_RESTORE_LAST_ERROR)
1236   WINBASEAPI VOID WINAPI RestoreLastError (DWORD dwErrCode);
1237 
1238   typedef VOID (WINAPI *PRESTORE_LAST_ERROR) (DWORD);
1239 
1240 #define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
1241 #define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
1242 #define RESTORE_LAST_ERROR_NAME TEXT ("RestoreLastError")
1243 #endif
1244 
1245 #define HasOverlappedIoCompleted(lpOverlapped) (((DWORD) (lpOverlapped)->Internal) != STATUS_PENDING)
1246 
1247 #if _WIN32_WINNT >= 0x0600
1248 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
1249 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
1250 
1251   WINBASEAPI WINBOOL WINAPI SetFileCompletionNotificationModes (HANDLE FileHandle, UCHAR Flags);
1252   WINBASEAPI WINBOOL WINAPI SetFileIoOverlappedRange (HANDLE FileHandle, PUCHAR OverlappedRangeStart, ULONG Length);
1253 #endif
1254 
1255 #define SEM_FAILCRITICALERRORS 0x0001
1256 #define SEM_NOGPFAULTERRORBOX 0x0002
1257 #define SEM_NOALIGNMENTFAULTEXCEPT 0x0004
1258 #define SEM_NOOPENFILEERRORBOX 0x8000
1259 
1260   WINBASEAPI DWORD WINAPI GetThreadErrorMode (VOID);
1261   WINBASEAPI WINBOOL WINAPI SetThreadErrorMode (DWORD dwNewMode, LPDWORD lpOldMode);
1262 
1263 #if !defined (__WIDL__) && _WIN32_WINNT >= 0x0600
1264   WINBASEAPI WINBOOL WINAPI Wow64GetThreadContext (HANDLE hThread, PWOW64_CONTEXT lpContext);
1265   WINBASEAPI WINBOOL WINAPI Wow64SetThreadContext (HANDLE hThread, CONST WOW64_CONTEXT *lpContext);
1266 #if _WIN32_WINNT >= 0x0601
1267   WINBASEAPI WINBOOL WINAPI Wow64GetThreadSelectorEntry (HANDLE hThread, DWORD dwSelector, PWOW64_LDT_ENTRY lpSelectorEntry);
1268 #endif
1269 #endif
1270 
1271 #if _WIN32_WINNT >= 0x0600
1272   WINBASEAPI DWORD WINAPI Wow64SuspendThread (HANDLE hThread);
1273 #endif
1274   WINBASEAPI WINBOOL WINAPI DebugSetProcessKillOnExit (WINBOOL KillOnExit);
1275   WINBASEAPI WINBOOL WINAPI DebugBreakProcess (HANDLE Process);
1276 #endif
1277 
1278 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
1279 #define CRITICAL_SECTION_NO_DEBUG_INFO RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO
1280 #endif
1281 
1282 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
1283   WINBASEAPI DWORD WINAPI WaitForMultipleObjects (DWORD nCount, CONST HANDLE *lpHandles, WINBOOL bWaitAll, DWORD dwMilliseconds);
1284 #endif
1285 
1286 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1287   typedef enum _DEP_SYSTEM_POLICY_TYPE {
1288     DEPPolicyAlwaysOff = 0,
1289     DEPPolicyAlwaysOn,
1290     DEPPolicyOptIn,
1291     DEPPolicyOptOut,
1292     DEPTotalPolicyCount
1293   } DEP_SYSTEM_POLICY_TYPE;
1294 
1295 #define HANDLE_FLAG_INHERIT 0x1
1296 #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x2
1297 
1298 #define HINSTANCE_ERROR 32
1299 
1300 #define GET_TAPE_MEDIA_INFORMATION 0
1301 #define GET_TAPE_DRIVE_INFORMATION 1
1302 
1303 #define SET_TAPE_MEDIA_INFORMATION 0
1304 #define SET_TAPE_DRIVE_INFORMATION 1
1305 
1306   WINBASEAPI WINBOOL WINAPI PulseEvent (HANDLE hEvent);
1307   WINBASEAPI ATOM WINAPI GlobalDeleteAtom (ATOM nAtom);
1308   WINBASEAPI WINBOOL WINAPI InitAtomTable (DWORD nSize);
1309   WINBASEAPI ATOM WINAPI DeleteAtom (ATOM nAtom);
1310   WINBASEAPI UINT WINAPI SetHandleCount (UINT uNumber);
1311   WINBASEAPI WINBOOL WINAPI RequestDeviceWakeup (HANDLE hDevice);
1312   WINBASEAPI WINBOOL WINAPI CancelDeviceWakeupRequest (HANDLE hDevice);
1313   WINBASEAPI WINBOOL WINAPI GetDevicePowerState (HANDLE hDevice, WINBOOL *pfOn);
1314   WINBASEAPI WINBOOL WINAPI SetMessageWaitingIndicator (HANDLE hMsgIndicator, ULONG ulMsgCount);
1315   WINBASEAPI WINBOOL WINAPI SetFileShortNameA (HANDLE hFile, LPCSTR lpShortName);
1316   WINBASEAPI WINBOOL WINAPI SetFileShortNameW (HANDLE hFile, LPCWSTR lpShortName);
1317   WINBASEAPI DWORD WINAPI LoadModule (LPCSTR lpModuleName, LPVOID lpParameterBlock);
1318   WINBASEAPI UINT WINAPI WinExec (LPCSTR lpCmdLine, UINT uCmdShow);
1319   WINBASEAPI WINBOOL WINAPI ClearCommBreak (HANDLE hFile);
1320   WINBASEAPI WINBOOL WINAPI ClearCommError (HANDLE hFile, LPDWORD lpErrors, LPCOMSTAT lpStat);
1321   WINBASEAPI WINBOOL WINAPI SetupComm (HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue);
1322   WINBASEAPI WINBOOL WINAPI EscapeCommFunction (HANDLE hFile, DWORD dwFunc);
1323   WINBASEAPI WINBOOL WINAPI GetCommConfig (HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);
1324   WINBASEAPI WINBOOL WINAPI GetCommMask (HANDLE hFile, LPDWORD lpEvtMask);
1325   WINBASEAPI WINBOOL WINAPI GetCommProperties (HANDLE hFile, LPCOMMPROP lpCommProp);
1326   WINBASEAPI WINBOOL WINAPI GetCommModemStatus (HANDLE hFile, LPDWORD lpModemStat);
1327   WINBASEAPI WINBOOL WINAPI GetCommState (HANDLE hFile, LPDCB lpDCB);
1328   WINBASEAPI WINBOOL WINAPI GetCommTimeouts (HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts);
1329   WINBASEAPI WINBOOL WINAPI PurgeComm (HANDLE hFile, DWORD dwFlags);
1330   WINBASEAPI WINBOOL WINAPI SetCommBreak (HANDLE hFile);
1331   WINBASEAPI WINBOOL WINAPI SetCommConfig (HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize);
1332   WINBASEAPI WINBOOL WINAPI SetCommMask (HANDLE hFile, DWORD dwEvtMask);
1333   WINBASEAPI WINBOOL WINAPI SetCommState (HANDLE hFile, LPDCB lpDCB);
1334   WINBASEAPI WINBOOL WINAPI SetCommTimeouts (HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts);
1335   WINBASEAPI WINBOOL WINAPI TransmitCommChar (HANDLE hFile, char cChar);
1336   WINBASEAPI WINBOOL WINAPI WaitCommEvent (HANDLE hFile, LPDWORD lpEvtMask, LPOVERLAPPED lpOverlapped);
1337   WINBASEAPI DWORD WINAPI SetTapePosition (HANDLE hDevice, DWORD dwPositionMethod, DWORD dwPartition, DWORD dwOffsetLow, DWORD dwOffsetHigh, WINBOOL bImmediate);
1338   WINBASEAPI DWORD WINAPI GetTapePosition (HANDLE hDevice, DWORD dwPositionType, LPDWORD lpdwPartition, LPDWORD lpdwOffsetLow, LPDWORD lpdwOffsetHigh);
1339   WINBASEAPI DWORD WINAPI PrepareTape (HANDLE hDevice, DWORD dwOperation, WINBOOL bImmediate);
1340   WINBASEAPI DWORD WINAPI EraseTape (HANDLE hDevice, DWORD dwEraseType, WINBOOL bImmediate);
1341   WINBASEAPI DWORD WINAPI CreateTapePartition (HANDLE hDevice, DWORD dwPartitionMethod, DWORD dwCount, DWORD dwSize);
1342   WINBASEAPI DWORD WINAPI WriteTapemark (HANDLE hDevice, DWORD dwTapemarkType, DWORD dwTapemarkCount, WINBOOL bImmediate);
1343   WINBASEAPI DWORD WINAPI GetTapeStatus (HANDLE hDevice);
1344   WINBASEAPI DWORD WINAPI GetTapeParameters (HANDLE hDevice, DWORD dwOperation, LPDWORD lpdwSize, LPVOID lpTapeInformation);
1345   WINBASEAPI DWORD WINAPI SetTapeParameters (HANDLE hDevice, DWORD dwOperation, LPVOID lpTapeInformation);
1346   WINBASEAPI DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy (VOID);
1347   WINBASEAPI WINBOOL WINAPI GetSystemRegistryQuota (PDWORD pdwQuotaAllowed, PDWORD pdwQuotaUsed);
1348   WINBOOL WINAPI GetSystemTimes (LPFILETIME lpIdleTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime);
1349   WINBASEAPI WINBOOL WINAPI FileTimeToDosDateTime (CONST FILETIME *lpFileTime, LPWORD lpFatDate, LPWORD lpFatTime);
1350   WINBASEAPI WINBOOL WINAPI DosDateTimeToFileTime (WORD wFatDate, WORD wFatTime, LPFILETIME lpFileTime);
1351   WINBASEAPI WINBOOL WINAPI SetSystemTimeAdjustment (DWORD dwTimeAdjustment, WINBOOL bTimeAdjustmentDisabled);
1352 
1353 #define SetFileShortName __MINGW_NAME_AW(SetFileShortName)
1354 
1355 #endif
1356 
1357 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
1358   WINBASEAPI int WINAPI MulDiv (int nNumber, int nNumerator, int nDenominator);
1359 
1360 #ifndef __WIDL__
1361   WINBASEAPI DWORD WINAPI FormatMessageA (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, va_list *Arguments);
1362   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments);
1363 
1364 #define FormatMessage __MINGW_NAME_AW(FormatMessage)
1365 #endif
1366 
1367 #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
1368 #define FORMAT_MESSAGE_FROM_STRING 0x00000400
1369 #define FORMAT_MESSAGE_FROM_HMODULE 0x00000800
1370 #define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000
1371 #define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000
1372 #define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000ff
1373 #endif
1374 
1375 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1376   typedef DWORD (WINAPI *PFE_EXPORT_FUNC) (PBYTE pbData, PVOID pvCallbackContext, ULONG ulLength);
1377   typedef DWORD (WINAPI *PFE_IMPORT_FUNC) (PBYTE pbData, PVOID pvCallbackContext, PULONG ulLength);
1378 
1379 #define FILE_ENCRYPTABLE 0
1380 #define FILE_IS_ENCRYPTED 1
1381 #define FILE_SYSTEM_ATTR 2
1382 #define FILE_ROOT_DIR 3
1383 #define FILE_SYSTEM_DIR 4
1384 #define FILE_UNKNOWN 5
1385 #define FILE_SYSTEM_NOT_SUPPORT 6
1386 #define FILE_USER_DISALLOWED 7
1387 #define FILE_READ_ONLY 8
1388 #define FILE_DIR_DISALLOWED 9
1389 
1390 #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
1391 
1392 #define EFS_USE_RECOVERY_KEYS (0x1)
1393 
1394 #define CREATE_FOR_IMPORT (1)
1395 #define CREATE_FOR_DIR (2)
1396 #define OVERWRITE_HIDDEN (4)
1397 #define EFSRPC_SECURE_ONLY (8)
1398 
1399   WINBASEAPI WINBOOL WINAPI GetNamedPipeInfo (HANDLE hNamedPipe, LPDWORD lpFlags, LPDWORD lpOutBufferSize, LPDWORD lpInBufferSize, LPDWORD lpMaxInstances);
1400   WINBASEAPI HANDLE WINAPI CreateMailslotA (LPCSTR lpName, DWORD nMaxMessageSize, DWORD lReadTimeout, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1401   WINBASEAPI HANDLE WINAPI CreateMailslotW (LPCWSTR lpName, DWORD nMaxMessageSize, DWORD lReadTimeout, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1402   WINBASEAPI WINBOOL WINAPI GetMailslotInfo (HANDLE hMailslot, LPDWORD lpMaxMessageSize, LPDWORD lpNextSize, LPDWORD lpMessageCount, LPDWORD lpReadTimeout);
1403   WINBASEAPI WINBOOL WINAPI SetMailslotInfo (HANDLE hMailslot, DWORD lReadTimeout);
1404   WINADVAPI WINBOOL WINAPI EncryptFileA (LPCSTR lpFileName);
1405   WINADVAPI WINBOOL WINAPI EncryptFileW (LPCWSTR lpFileName);
1406   WINADVAPI WINBOOL WINAPI DecryptFileA (LPCSTR lpFileName, DWORD dwReserved);
1407   WINADVAPI WINBOOL WINAPI DecryptFileW (LPCWSTR lpFileName, DWORD dwReserved);
1408   WINADVAPI WINBOOL WINAPI FileEncryptionStatusA (LPCSTR lpFileName, LPDWORD lpStatus);
1409   WINADVAPI WINBOOL WINAPI FileEncryptionStatusW (LPCWSTR lpFileName, LPDWORD lpStatus);
1410   WINADVAPI DWORD WINAPI OpenEncryptedFileRawA (LPCSTR lpFileName, ULONG ulFlags, PVOID *pvContext);
1411   WINADVAPI DWORD WINAPI OpenEncryptedFileRawW (LPCWSTR lpFileName, ULONG ulFlags, PVOID *pvContext);
1412   WINADVAPI DWORD WINAPI ReadEncryptedFileRaw (PFE_EXPORT_FUNC pfExportCallback, PVOID pvCallbackContext, PVOID pvContext);
1413   WINADVAPI DWORD WINAPI WriteEncryptedFileRaw (PFE_IMPORT_FUNC pfImportCallback, PVOID pvCallbackContext, PVOID pvContext);
1414   WINADVAPI VOID WINAPI CloseEncryptedFileRaw (PVOID pvContext);
1415   WINBASEAPI int WINAPI lstrcmpA (LPCSTR lpString1, LPCSTR lpString2);
1416   WINBASEAPI int WINAPI lstrcmpW (LPCWSTR lpString1, LPCWSTR lpString2);
1417   WINBASEAPI int WINAPI lstrcmpiA (LPCSTR lpString1, LPCSTR lpString2);
1418   WINBASEAPI int WINAPI lstrcmpiW (LPCWSTR lpString1, LPCWSTR lpString2);
1419   WINBASEAPI LPSTR WINAPI lstrcpynA (LPSTR lpString1, LPCSTR lpString2, int iMaxLength);
1420   WINBASEAPI LPWSTR WINAPI lstrcpynW (LPWSTR lpString1, LPCWSTR lpString2, int iMaxLength);
1421   WINBASEAPI LPSTR WINAPI lstrcpyA (LPSTR lpString1, LPCSTR lpString2);
1422   WINBASEAPI LPWSTR WINAPI lstrcpyW (LPWSTR lpString1, LPCWSTR lpString2);
1423   WINBASEAPI LPSTR WINAPI lstrcatA (LPSTR lpString1, LPCSTR lpString2);
1424   WINBASEAPI LPWSTR WINAPI lstrcatW (LPWSTR lpString1, LPCWSTR lpString2);
1425   WINBASEAPI int WINAPI lstrlenA (LPCSTR lpString);
1426   WINBASEAPI int WINAPI lstrlenW (LPCWSTR lpString);
1427   WINBASEAPI HFILE WINAPI OpenFile (LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle);
1428   WINBASEAPI HFILE WINAPI _lopen (LPCSTR lpPathName, int iReadWrite);
1429   WINBASEAPI HFILE WINAPI _lcreat (LPCSTR lpPathName, int iAttribute);
1430   WINBASEAPI UINT WINAPI _lread (HFILE hFile, LPVOID lpBuffer, UINT uBytes);
1431   WINBASEAPI UINT WINAPI _lwrite (HFILE hFile, LPCCH lpBuffer, UINT uBytes);
1432   WINBASEAPI __LONG32 WINAPI _hread (HFILE hFile, LPVOID lpBuffer, __LONG32 lBytes);
1433   WINBASEAPI __LONG32 WINAPI _hwrite (HFILE hFile, LPCCH lpBuffer, __LONG32 lBytes);
1434   WINBASEAPI HFILE WINAPI _lclose (HFILE hFile);
1435   WINBASEAPI LONG WINAPI _llseek (HFILE hFile, LONG lOffset, int iOrigin);
1436   WINADVAPI WINBOOL WINAPI IsTextUnicode (CONST VOID *lpv, int iSize, LPINT lpiResult);
1437   WINBASEAPI DWORD WINAPI SignalObjectAndWait (HANDLE hObjectToSignal, HANDLE hObjectToWaitOn, DWORD dwMilliseconds, WINBOOL bAlertable);
1438   WINBASEAPI WINBOOL WINAPI BackupRead (HANDLE hFile, LPBYTE lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, WINBOOL bAbort, WINBOOL bProcessSecurity, LPVOID *lpContext);
1439   WINBASEAPI WINBOOL WINAPI BackupSeek (HANDLE hFile, DWORD dwLowBytesToSeek, DWORD dwHighBytesToSeek, LPDWORD lpdwLowByteSeeked, LPDWORD lpdwHighByteSeeked, LPVOID *lpContext);
1440   WINBASEAPI WINBOOL WINAPI BackupWrite (HANDLE hFile, LPBYTE lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, WINBOOL bAbort, WINBOOL bProcessSecurity, LPVOID *lpContext);
1441 
1442 #define CreateMailslot __MINGW_NAME_AW(CreateMailslot)
1443 #define EncryptFile __MINGW_NAME_AW(EncryptFile)
1444 #define DecryptFile __MINGW_NAME_AW(DecryptFile)
1445 #define FileEncryptionStatus __MINGW_NAME_AW(FileEncryptionStatus)
1446 #define OpenEncryptedFileRaw __MINGW_NAME_AW(OpenEncryptedFileRaw)
1447 #define lstrcmp __MINGW_NAME_AW(lstrcmp)
1448 #define lstrcmpi __MINGW_NAME_AW(lstrcmpi)
1449 #define lstrcpyn __MINGW_NAME_AW(lstrcpyn)
1450 #define lstrcpy __MINGW_NAME_AW(lstrcpy)
1451 #define lstrcat __MINGW_NAME_AW(lstrcat)
1452 #define lstrlen __MINGW_NAME_AW(lstrlen)
1453 
1454   typedef struct _WIN32_STREAM_ID {
1455     DWORD dwStreamId;
1456     DWORD dwStreamAttributes;
1457     LARGE_INTEGER Size;
1458     DWORD dwStreamNameSize;
1459     WCHAR cStreamName[ANYSIZE_ARRAY];
1460   } WIN32_STREAM_ID,*LPWIN32_STREAM_ID;
1461 
1462 #define BACKUP_INVALID 0x00000000
1463 #define BACKUP_DATA 0x00000001
1464 #define BACKUP_EA_DATA 0x00000002
1465 #define BACKUP_SECURITY_DATA 0x00000003
1466 #define BACKUP_ALTERNATE_DATA 0x00000004
1467 #define BACKUP_LINK 0x00000005
1468 #define BACKUP_PROPERTY_DATA 0x00000006
1469 #define BACKUP_OBJECT_ID 0x00000007
1470 #define BACKUP_REPARSE_DATA 0x00000008
1471 #define BACKUP_SPARSE_BLOCK 0x00000009
1472 #define BACKUP_TXFS_DATA 0x0000000a
1473 
1474 #define STREAM_NORMAL_ATTRIBUTE 0x00000000
1475 #define STREAM_MODIFIED_WHEN_READ 0x00000001
1476 #define STREAM_CONTAINS_SECURITY 0x00000002
1477 #define STREAM_CONTAINS_PROPERTIES 0x00000004
1478 #define STREAM_SPARSE_ATTRIBUTE 0x00000008
1479 
1480 #define STARTF_USESHOWWINDOW 0x00000001
1481 #define STARTF_USESIZE 0x00000002
1482 #define STARTF_USEPOSITION 0x00000004
1483 #define STARTF_USECOUNTCHARS 0x00000008
1484 #define STARTF_USEFILLATTRIBUTE 0x00000010
1485 #define STARTF_RUNFULLSCREEN 0x00000020
1486 #define STARTF_FORCEONFEEDBACK 0x00000040
1487 #define STARTF_FORCEOFFFEEDBACK 0x00000080
1488 #define STARTF_USESTDHANDLES 0x00000100
1489 
1490 #define STARTF_USEHOTKEY 0x00000200
1491 #define STARTF_TITLEISLINKNAME 0x00000800
1492 #define STARTF_TITLEISAPPID 0x00001000
1493 #define STARTF_PREVENTPINNING 0x00002000
1494 
1495 #if _WIN32_WINNT >= 0x0600
1496   typedef struct _STARTUPINFOEXA {
1497     STARTUPINFOA StartupInfo;
1498     LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList;
1499   } STARTUPINFOEXA,*LPSTARTUPINFOEXA;
1500 
1501   typedef struct _STARTUPINFOEXW {
1502     STARTUPINFOW StartupInfo;
1503     LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList;
1504   } STARTUPINFOEXW,*LPSTARTUPINFOEXW;
1505 
1506   __MINGW_TYPEDEF_AW(STARTUPINFOEX)
1507   __MINGW_TYPEDEF_AW(LPSTARTUPINFOEX)
1508 #endif
1509 
1510 #define SHUTDOWN_NORETRY 0x1
1511 #endif
1512 
1513 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
1514 #define CreateSemaphore __MINGW_NAME_AW(CreateSemaphore)
1515   WINBASEAPI HANDLE WINAPI CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName);
1516 #define LoadLibrary __MINGW_NAME_AW(LoadLibrary)
1517   WINBASEAPI HMODULE WINAPI LoadLibraryW (LPCWSTR lpLibFileName);
1518 #endif
1519 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1520   WINBASEAPI HANDLE WINAPI OpenMutexA (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCSTR lpName);
1521   WINBASEAPI HANDLE WINAPI CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName);
1522   WINBASEAPI HANDLE WINAPI OpenSemaphoreA (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCSTR lpName);
1523   WINBASEAPI HANDLE WINAPI CreateWaitableTimerA (LPSECURITY_ATTRIBUTES lpTimerAttributes, WINBOOL bManualReset, LPCSTR lpTimerName);
1524   WINBASEAPI HANDLE WINAPI CreateWaitableTimerW (LPSECURITY_ATTRIBUTES lpTimerAttributes, WINBOOL bManualReset, LPCWSTR lpTimerName);
1525   WINBASEAPI HANDLE WINAPI OpenWaitableTimerA (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCSTR lpTimerName);
1526   WINBASEAPI HANDLE WINAPI CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName);
1527 #if _WIN32_WINNT >= 0x0600
1528   WINBASEAPI HANDLE WINAPI CreateSemaphoreExA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess);
1529   WINBASEAPI HANDLE WINAPI CreateWaitableTimerExA (LPSECURITY_ATTRIBUTES lpTimerAttributes, LPCSTR lpTimerName, DWORD dwFlags, DWORD dwDesiredAccess);
1530   WINBASEAPI HANDLE WINAPI CreateFileMappingNumaA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName, DWORD nndPreferred);
1531 #endif
1532   WINBASEAPI HANDLE WINAPI OpenFileMappingA (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCSTR lpName);
1533   WINBASEAPI DWORD WINAPI GetLogicalDriveStringsA (DWORD nBufferLength, LPSTR lpBuffer);
1534   WINBASEAPI HMODULE WINAPI LoadLibraryA (LPCSTR lpLibFileName);
1535 
1536 #ifndef UNICODE
1537 #define OpenMutex OpenMutexA
1538 #define OpenSemaphore OpenSemaphoreA
1539 #define OpenWaitableTimer OpenWaitableTimerA
1540 #define CreateFileMapping CreateFileMappingA
1541 #define OpenFileMapping OpenFileMappingA
1542 #define GetLogicalDriveStrings GetLogicalDriveStringsA
1543 #endif
1544 
1545 #define CreateWaitableTimer __MINGW_NAME_AW(CreateWaitableTimer)
1546 #define LoadLibrary __MINGW_NAME_AW(LoadLibrary)
1547 
1548 #if _WIN32_WINNT >= 0x0600
1549 #ifndef UNICODE
1550 #define CreateSemaphoreEx CreateSemaphoreExA
1551 #define CreateWaitableTimerEx CreateWaitableTimerExA
1552 #define CreateFileMappingNuma CreateFileMappingNumaA
1553 #endif
1554 #endif
1555 #endif
1556 
1557 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) && _WIN32_WINNT >= 0x0602
1558   WINBASEAPI HMODULE WINAPI LoadPackagedLibrary (LPCWSTR lpwLibFileName, DWORD Reserved);
1559 #endif
1560 
1561 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1562 #if _WIN32_WINNT >= 0x0600
1563 
1564 #define PROCESS_NAME_NATIVE 0x00000001
1565 
1566   WINBASEAPI WINBOOL WINAPI QueryFullProcessImageNameA (HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD lpdwSize);
1567   WINBASEAPI WINBOOL WINAPI QueryFullProcessImageNameW (HANDLE hProcess, DWORD dwFlags, LPWSTR lpExeName, PDWORD lpdwSize);
1568 
1569 #define QueryFullProcessImageName __MINGW_NAME_AW(QueryFullProcessImageName)
1570 
1571 #define PROC_THREAD_ATTRIBUTE_NUMBER 0x0000ffff
1572 #define PROC_THREAD_ATTRIBUTE_THREAD 0x00010000
1573 #define PROC_THREAD_ATTRIBUTE_INPUT 0x00020000
1574 #define PROC_THREAD_ATTRIBUTE_ADDITIVE 0x00040000
1575 
1576 #ifndef _USE_FULL_PROC_THREAD_ATTRIBUTE
1577   typedef enum _PROC_THREAD_ATTRIBUTE_NUM {
1578     ProcThreadAttributeParentProcess = 0,
1579     ProcThreadAttributeHandleList = 2
1580 #if _WIN32_WINNT >= 0x0601
1581     ,ProcThreadAttributeGroupAffinity = 3,
1582     ProcThreadAttributePreferredNode = 4,
1583     ProcThreadAttributeIdealProcessor = 5,
1584     ProcThreadAttributeUmsThread = 6,
1585     ProcThreadAttributeMitigationPolicy = 7
1586 #endif
1587 #if _WIN32_WINNT >= 0x0602
1588     ,ProcThreadAttributeSecurityCapabilities = 9
1589 #endif
1590     ,ProcThreadAttributeProtectionLevel = 11
1591 #if _WIN32_WINNT >= 0x0603
1592 #endif
1593 #if _WIN32_WINNT >= 0x0A00
1594     ,ProcThreadAttributeJobList = 13
1595     ,ProcThreadAttributeChildProcessPolicy = 14
1596     ,ProcThreadAttributeAllApplicationPackagesPolicy = 15
1597     ,ProcThreadAttributeWin32kFilter = 16
1598 #endif
1599 #if NTDDI_VERSION >= 0x0A000002
1600     ,ProcThreadAttributeSafeOpenPromptOriginClaim = 17
1601 #endif
1602 #if NTDDI_VERSION >= 0x0A000003
1603     ,ProcThreadAttributeDesktopAppPolicy = 18
1604 #endif
1605 #if NTDDI_VERSION >= 0x0A000006
1606     ,ProcThreadAttributePseudoConsole = 22
1607 #endif
1608   } PROC_THREAD_ATTRIBUTE_NUM;
1609 #endif
1610 
1611 #define ProcThreadAttributeValue(Number, Thread, Input, Additive) (((Number) &PROC_THREAD_ATTRIBUTE_NUMBER) | ((Thread != FALSE) ? PROC_THREAD_ATTRIBUTE_THREAD : 0) | ((Input != FALSE) ? PROC_THREAD_ATTRIBUTE_INPUT : 0) | ((Additive != FALSE) ? PROC_THREAD_ATTRIBUTE_ADDITIVE : 0))
1612 
1613 #define PROC_THREAD_ATTRIBUTE_PARENT_PROCESS ProcThreadAttributeValue (ProcThreadAttributeParentProcess, FALSE, TRUE, FALSE)
1614 #define PROC_THREAD_ATTRIBUTE_HANDLE_LIST ProcThreadAttributeValue (ProcThreadAttributeHandleList, FALSE, TRUE, FALSE)
1615 #endif
1616 
1617 #if _WIN32_WINNT >= 0x0601
1618 #define PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY ProcThreadAttributeValue (ProcThreadAttributeGroupAffinity, TRUE, TRUE, FALSE)
1619 #define PROC_THREAD_ATTRIBUTE_PREFERRED_NODE ProcThreadAttributeValue (ProcThreadAttributePreferredNode, FALSE, TRUE, FALSE)
1620 #define PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR ProcThreadAttributeValue (ProcThreadAttributeIdealProcessor, TRUE, TRUE, FALSE)
1621 #define PROC_THREAD_ATTRIBUTE_UMS_THREAD ProcThreadAttributeValue (ProcThreadAttributeUmsThread, TRUE, TRUE, FALSE)
1622 #define PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY ProcThreadAttributeValue (ProcThreadAttributeMitigationPolicy, FALSE, TRUE, FALSE)
1623 #endif
1624 
1625 #if _WIN32_WINNT >= 0x0602
1626 #define PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES ProcThreadAttributeValue (ProcThreadAttributeSecurityCapabilities, FALSE, TRUE, FALSE)
1627 #endif
1628 
1629 #define PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL ProcThreadAttributeValue (ProcThreadAttributeProtectionLevel, FALSE, TRUE, FALSE)
1630 
1631 #if _WIN32_WINNT >= 0x0603
1632 #endif
1633 
1634 #if NTDDI_VERSION >= 0x0A000006
1635 #define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE ProcThreadAttributeValue (ProcThreadAttributePseudoConsole, FALSE, TRUE, FALSE)
1636 #endif
1637 
1638 #if _WIN32_WINNT >= 0x0601
1639 #define PROCESS_CREATION_MITIGATION_POLICY_DEP_ENABLE 0x01
1640 #define PROCESS_CREATION_MITIGATION_POLICY_DEP_ATL_THUNK_ENABLE 0x02
1641 #define PROCESS_CREATION_MITIGATION_POLICY_SEHOP_ENABLE 0x04
1642 #endif
1643 
1644 #if _WIN32_WINNT >= 0x0602
1645 #define PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES ProcThreadAttributeValue (ProcThreadAttributeSecurityCapabilities, FALSE, TRUE, FALSE)
1646 
1647 #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_MASK (0x00000003 << 8)
1648 #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_DEFER (0x00000000 << 8)
1649 #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_ON (0x00000001 << 8)
1650 #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_OFF (0x00000002 << 8)
1651 #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_ON_REQ_RELOCS (0x00000003 << 8)
1652 
1653 #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_MASK (0x00000003 << 12)
1654 #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_DEFER (0x00000000 << 12)
1655 #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_ALWAYS_ON (0x00000001 << 12)
1656 #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_ALWAYS_OFF (0x00000002 << 12)
1657 #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_RESERVED (0x00000003 << 12)
1658 
1659 #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_MASK (0x00000003 << 16)
1660 #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_DEFER (0x00000000 << 16)
1661 #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_ALWAYS_ON (0x00000001 << 16)
1662 #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_ALWAYS_OFF (0x00000002 << 16)
1663 #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_RESERVED (0x00000003 << 16)
1664 
1665 #define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_MASK (0x00000003 << 20)
1666 #define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_DEFER (0x00000000 << 20)
1667 #define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_ALWAYS_ON (0x00000001 << 20)
1668 #define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_ALWAYS_OFF (0x00000002 << 20)
1669 #define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_RESERVED (0x00000003 << 20)
1670 
1671 #define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_MASK (0x00000003 << 24)
1672 #define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_DEFER (0x00000000 << 24)
1673 #define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_ALWAYS_ON (0x00000001 << 24)
1674 #define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_ALWAYS_OFF (0x00000002 << 24)
1675 #define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_RESERVED (0x00000003 << 24)
1676 
1677 #define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_MASK (0x00000003 << 28)
1678 #define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_DEFER (0x00000000 << 28)
1679 #define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON (0x00000001 << 28)
1680 #define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_OFF (0x00000002 << 28)
1681 #define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_RESERVED (0x00000003 << 28)
1682 
1683 #define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_MASK (0x00000003ULL << 32)
1684 #define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_DEFER (0x00000000ULL << 32)
1685 #define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_ALWAYS_ON (0x00000001ULL << 32)
1686 #define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_ALWAYS_OFF (0x00000002ULL << 32)
1687 #define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_RESERVED (0x00000003ULL << 32)
1688 
1689 #define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_MASK (0x0003ULL << 36)
1690 #define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_DEFER (0x0000ULL << 36)
1691 #define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_ON (0x0001ULL << 36)
1692 #define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_OFF (0x0002ULL << 36)
1693 #define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_ON_ALLOW_OPT_OUT (0x0003ULL << 36)
1694 
1695 #define PROCESS_CREATION_MITIGATION_POLICY_CONTROL_FLOW_GUARD_MASK (0x0003ULL << 40)
1696 #define PROCESS_CREATION_MITIGATION_POLICY_CONTROL_FLOW_GUARD_DEFER (0x0000ULL << 40)
1697 #define PROCESS_CREATION_MITIGATION_POLICY_CONTROL_FLOW_GUARD_ALWAYS_ON (0x0001ULL << 40)
1698 #define PROCESS_CREATION_MITIGATION_POLICY_CONTROL_FLOW_GUARD_ALWAYS_OFF (0x0002ULL << 40)
1699 #define PROCESS_CREATION_MITIGATION_POLICY_CONTROL_FLOW_GUARD_EXPORT_SUPPRESSION (0x0003ULL << 40)
1700 
1701 #define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_MASK (0x0003ULL << 44)
1702 #define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_DEFER (0x0000ULL << 44)
1703 #define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON (0x0001ULL << 44)
1704 #define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_OFF (0x0002ULL << 44)
1705 #define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALLOW_STORE (0x0003ULL << 44)
1706 
1707 #define PROCESS_CREATION_MITIGATION_POLICY_FONT_DISABLE_MASK (0x0003ULL << 48)
1708 #define PROCESS_CREATION_MITIGATION_POLICY_FONT_DISABLE_DEFER (0x0000ULL << 48)
1709 #define PROCESS_CREATION_MITIGATION_POLICY_FONT_DISABLE_ALWAYS_ON (0x0001ULL << 48)
1710 #define PROCESS_CREATION_MITIGATION_POLICY_FONT_DISABLE_ALWAYS_OFF (0x0002ULL << 48)
1711 #define PROCESS_CREATION_MITIGATION_POLICY_AUDIT_NONSYSTEM_FONTS (0x0003ULL << 48)
1712 
1713 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_REMOTE_MASK (0x0003ULL << 52)
1714 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_REMOTE_DEFER (0x0000ULL << 52)
1715 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_REMOTE_ALWAYS_ON (0x0001ULL << 52)
1716 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_REMOTE_ALWAYS_OFF (0x0002ULL << 52)
1717 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_REMOTE_RESERVED (0x0003ULL << 52)
1718 
1719 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_LOW_LABEL_MASK (0x0003ULL << 56)
1720 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_LOW_LABEL_DEFER (0x0000ULL << 56)
1721 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_LOW_LABEL_ALWAYS_ON (0x0001ULL << 56)
1722 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_LOW_LABEL_ALWAYS_OFF (0x0002ULL << 56)
1723 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_NO_LOW_LABEL_RESERVED (0x0003ULL << 56)
1724 
1725 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_MASK (0x0003ULL << 60)
1726 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_DEFER (0x0000ULL << 60)
1727 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_ALWAYS_ON (0x0001ULL << 60)
1728 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_ALWAYS_OFF (0x0002ULL << 60)
1729 #define PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_RESERVED (0x0003ULL << 60)
1730 
1731 #define PROCESS_CREATION_MITIGATION_POLICY2_LOADER_INTEGRITY_CONTINUITY_MASK (0x0003ULL << 4)
1732 #define PROCESS_CREATION_MITIGATION_POLICY2_LOADER_INTEGRITY_CONTINUITY_DEFER (0x0000ULL << 4)
1733 #define PROCESS_CREATION_MITIGATION_POLICY2_LOADER_INTEGRITY_CONTINUITY_ALWAYS_ON (0x0001ULL << 4)
1734 #define PROCESS_CREATION_MITIGATION_POLICY2_LOADER_INTEGRITY_CONTINUITY_ALWAYS_OFF (0x0002ULL << 4)
1735 #define PROCESS_CREATION_MITIGATION_POLICY2_LOADER_INTEGRITY_CONTINUITY_AUDIT (0x0003ULL << 4)
1736 
1737 #define PROCESS_CREATION_MITIGATION_POLICY2_STRICT_CONTROL_FLOW_GUARD_MASK (0x0003ULL << 8)
1738 #define PROCESS_CREATION_MITIGATION_POLICY2_STRICT_CONTROL_FLOW_GUARD_DEFER (0x0000ULL << 8)
1739 #define PROCESS_CREATION_MITIGATION_POLICY2_STRICT_CONTROL_FLOW_GUARD_ALWAYS_ON (0x0001ULL << 8)
1740 #define PROCESS_CREATION_MITIGATION_POLICY2_STRICT_CONTROL_FLOW_GUARD_ALWAYS_OFF (0x0002ULL << 8)
1741 #define PROCESS_CREATION_MITIGATION_POLICY2_STRICT_CONTROL_FLOW_GUARD_RESERVED (0x0003ULL << 8)
1742 
1743 #define PROCESS_CREATION_MITIGATION_POLICY2_MODULE_TAMPERING_PROTECTION_MASK (0x0003ULL << 12)
1744 #define PROCESS_CREATION_MITIGATION_POLICY2_MODULE_TAMPERING_PROTECTION_DEFER (0x0000ULL << 12)
1745 #define PROCESS_CREATION_MITIGATION_POLICY2_MODULE_TAMPERING_PROTECTION_ALWAYS_ON (0x0001ULL << 12)
1746 #define PROCESS_CREATION_MITIGATION_POLICY2_MODULE_TAMPERING_PROTECTION_ALWAYS_OFF (0x0002ULL << 12)
1747 #define PROCESS_CREATION_MITIGATION_POLICY2_MODULE_TAMPERING_PROTECTION_NOINHERIT (0x0003ULL << 12)
1748 
1749 #endif
1750 
1751 #define ATOM_FLAG_GLOBAL 0x2
1752 
1753   WINBASEAPI WINBOOL WINAPI GetProcessShutdownParameters (LPDWORD lpdwLevel, LPDWORD lpdwFlags);
1754   WINBASEAPI VOID WINAPI FatalAppExitA (UINT uAction, LPCSTR lpMessageText);
1755   WINBASEAPI VOID WINAPI FatalAppExitW (UINT uAction, LPCWSTR lpMessageText);
1756   WINBASEAPI VOID WINAPI GetStartupInfoA (LPSTARTUPINFOA lpStartupInfo);
1757   WINBASEAPI DWORD WINAPI GetFirmwareEnvironmentVariableA (LPCSTR lpName, LPCSTR lpGuid, PVOID pBuffer, DWORD nSize);
1758   WINBASEAPI DWORD WINAPI GetFirmwareEnvironmentVariableW (LPCWSTR lpName, LPCWSTR lpGuid, PVOID pBuffer, DWORD nSize);
1759   WINBASEAPI WINBOOL WINAPI SetFirmwareEnvironmentVariableA (LPCSTR lpName, LPCSTR lpGuid, PVOID pValue, DWORD nSize);
1760   WINBASEAPI WINBOOL WINAPI SetFirmwareEnvironmentVariableW (LPCWSTR lpName, LPCWSTR lpGuid, PVOID pValue, DWORD nSize);
1761   WINBASEAPI HRSRC WINAPI FindResourceA (HMODULE hModule, LPCSTR lpName, LPCSTR lpType);
1762   WINBASEAPI HRSRC WINAPI FindResourceW (HMODULE hModule, LPCWSTR lpName, LPCWSTR lpType);
1763   WINBASEAPI HRSRC WINAPI FindResourceExA (HMODULE hModule, LPCSTR lpType, LPCSTR lpName, WORD wLanguage);
1764   WINBASEAPI WINBOOL WINAPI EnumResourceTypesA (HMODULE hModule, ENUMRESTYPEPROCA lpEnumFunc, LONG_PTR lParam);
1765   WINBASEAPI WINBOOL WINAPI EnumResourceTypesW (HMODULE hModule, ENUMRESTYPEPROCW lpEnumFunc, LONG_PTR lParam);
1766   WINBASEAPI WINBOOL WINAPI EnumResourceNamesA (HMODULE hModule, LPCSTR lpType, ENUMRESNAMEPROCA lpEnumFunc, LONG_PTR lParam);
1767   WINBASEAPI WINBOOL WINAPI EnumResourceNamesW (HMODULE hModule, LPCWSTR lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG_PTR lParam);
1768   WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesA (HMODULE hModule, LPCSTR lpType, LPCSTR lpName, ENUMRESLANGPROCA lpEnumFunc, LONG_PTR lParam);
1769   WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesW (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, ENUMRESLANGPROCW lpEnumFunc, LONG_PTR lParam);
1770   WINBASEAPI HANDLE WINAPI BeginUpdateResourceA (LPCSTR pFileName, WINBOOL bDeleteExistingResources);
1771   WINBASEAPI HANDLE WINAPI BeginUpdateResourceW (LPCWSTR pFileName, WINBOOL bDeleteExistingResources);
1772   WINBASEAPI WINBOOL WINAPI UpdateResourceA (HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, WORD wLanguage, LPVOID lpData, DWORD cb);
1773   WINBASEAPI WINBOOL WINAPI UpdateResourceW (HANDLE hUpdate, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage, LPVOID lpData, DWORD cb);
1774   WINBASEAPI WINBOOL WINAPI EndUpdateResourceA (HANDLE hUpdate, WINBOOL fDiscard);
1775   WINBASEAPI WINBOOL WINAPI EndUpdateResourceW (HANDLE hUpdate, WINBOOL fDiscard);
1776 #if _WIN32_WINNT >= 0x0602
1777   WINBASEAPI DWORD WINAPI GetFirmwareEnvironmentVariableExA (LPCSTR lpName, LPCSTR lpGuid, PVOID pBuffer, DWORD nSize, PDWORD pdwAttribubutes);
1778   WINBASEAPI DWORD WINAPI GetFirmwareEnvironmentVariableExW (LPCWSTR lpName, LPCWSTR lpGuid, PVOID pBuffer, DWORD nSize, PDWORD pdwAttribubutes);
1779   WINBASEAPI WINBOOL WINAPI SetFirmwareEnvironmentVariableExA (LPCSTR lpName, LPCSTR lpGuid, PVOID pValue, DWORD nSize, DWORD dwAttributes);
1780   WINBASEAPI WINBOOL WINAPI SetFirmwareEnvironmentVariableExW (LPCWSTR lpName, LPCWSTR lpGuid, PVOID pValue, DWORD nSize, DWORD dwAttributes);
1781   WINBASEAPI WINBOOL WINAPI GetFirmwareType (PFIRMWARE_TYPE FirmwareType);
1782   WINBASEAPI WINBOOL WINAPI IsNativeVhdBoot (PBOOL NativeVhdBoot);
1783 #endif
1784   WINBASEAPI ATOM WINAPI GlobalAddAtomA (LPCSTR lpString);
1785   WINBASEAPI ATOM WINAPI GlobalAddAtomW (LPCWSTR lpString);
1786   WINBASEAPI ATOM WINAPI GlobalAddAtomExA (LPCSTR lpString, DWORD Flags);
1787   WINBASEAPI ATOM WINAPI GlobalAddAtomExW (LPCWSTR lpString, DWORD Flags);
1788   WINBASEAPI ATOM WINAPI GlobalFindAtomA (LPCSTR lpString);
1789   WINBASEAPI ATOM WINAPI GlobalFindAtomW (LPCWSTR lpString);
1790   WINBASEAPI UINT WINAPI GlobalGetAtomNameA (ATOM nAtom, LPSTR lpBuffer, int nSize);
1791   WINBASEAPI UINT WINAPI GlobalGetAtomNameW (ATOM nAtom, LPWSTR lpBuffer, int nSize);
1792   WINBASEAPI ATOM WINAPI AddAtomA (LPCSTR lpString);
1793   WINBASEAPI ATOM WINAPI AddAtomW (LPCWSTR lpString);
1794   WINBASEAPI ATOM WINAPI FindAtomA (LPCSTR lpString);
1795   WINBASEAPI ATOM WINAPI FindAtomW (LPCWSTR lpString);
1796   WINBASEAPI UINT WINAPI GetAtomNameA (ATOM nAtom, LPSTR lpBuffer, int nSize);
1797   WINBASEAPI UINT WINAPI GetAtomNameW (ATOM nAtom, LPWSTR lpBuffer, int nSize);
1798   WINBASEAPI UINT WINAPI GetProfileIntA (LPCSTR lpAppName, LPCSTR lpKeyName, INT nDefault);
1799   WINBASEAPI UINT WINAPI GetProfileIntW (LPCWSTR lpAppName, LPCWSTR lpKeyName, INT nDefault);
1800   WINBASEAPI DWORD WINAPI GetProfileStringA (LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefault, LPSTR lpReturnedString, DWORD nSize);
1801   WINBASEAPI DWORD WINAPI GetProfileStringW (LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize);
1802   WINBASEAPI WINBOOL WINAPI WriteProfileStringA (LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpString);
1803   WINBASEAPI WINBOOL WINAPI WriteProfileStringW (LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpString);
1804   WINBASEAPI DWORD WINAPI GetProfileSectionA (LPCSTR lpAppName, LPSTR lpReturnedString, DWORD nSize);
1805   WINBASEAPI DWORD WINAPI GetProfileSectionW (LPCWSTR lpAppName, LPWSTR lpReturnedString, DWORD nSize);
1806   WINBASEAPI WINBOOL WINAPI WriteProfileSectionA (LPCSTR lpAppName, LPCSTR lpString);
1807   WINBASEAPI WINBOOL WINAPI WriteProfileSectionW (LPCWSTR lpAppName, LPCWSTR lpString);
1808   WINBASEAPI UINT WINAPI GetPrivateProfileIntA (LPCSTR lpAppName, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);
1809   WINBASEAPI UINT WINAPI GetPrivateProfileIntW (LPCWSTR lpAppName, LPCWSTR lpKeyName, INT nDefault, LPCWSTR lpFileName);
1810   WINBASEAPI DWORD WINAPI GetPrivateProfileStringA (LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefault, LPSTR lpReturnedString, DWORD nSize, LPCSTR lpFileName);
1811   WINBASEAPI DWORD WINAPI GetPrivateProfileStringW (LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName);
1812   WINBASEAPI WINBOOL WINAPI WritePrivateProfileStringA (LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpString, LPCSTR lpFileName);
1813   WINBASEAPI WINBOOL WINAPI WritePrivateProfileStringW (LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpString, LPCWSTR lpFileName);
1814   WINBASEAPI DWORD WINAPI GetPrivateProfileSectionA (LPCSTR lpAppName, LPSTR lpReturnedString, DWORD nSize, LPCSTR lpFileName);
1815   WINBASEAPI DWORD WINAPI GetPrivateProfileSectionW (LPCWSTR lpAppName, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName);
1816   WINBASEAPI WINBOOL WINAPI WritePrivateProfileSectionA (LPCSTR lpAppName, LPCSTR lpString, LPCSTR lpFileName);
1817   WINBASEAPI WINBOOL WINAPI WritePrivateProfileSectionW (LPCWSTR lpAppName, LPCWSTR lpString, LPCWSTR lpFileName);
1818   WINBASEAPI DWORD WINAPI GetPrivateProfileSectionNamesA (LPSTR lpszReturnBuffer, DWORD nSize, LPCSTR lpFileName);
1819   WINBASEAPI DWORD WINAPI GetPrivateProfileSectionNamesW (LPWSTR lpszReturnBuffer, DWORD nSize, LPCWSTR lpFileName);
1820   WINBASEAPI WINBOOL WINAPI GetPrivateProfileStructA (LPCSTR lpszSection, LPCSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCSTR szFile);
1821   WINBASEAPI WINBOOL WINAPI GetPrivateProfileStructW (LPCWSTR lpszSection, LPCWSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCWSTR szFile);
1822   WINBASEAPI WINBOOL WINAPI WritePrivateProfileStructA (LPCSTR lpszSection, LPCSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCSTR szFile);
1823   WINBASEAPI WINBOOL WINAPI WritePrivateProfileStructW (LPCWSTR lpszSection, LPCWSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCWSTR szFile);
1824 
1825 #ifndef UNICODE
1826 #define GetStartupInfo GetStartupInfoA
1827 #define FindResourceEx FindResourceExA
1828 #endif
1829 
1830 #define FatalAppExit __MINGW_NAME_AW(FatalAppExit)
1831 #define GetFirmwareEnvironmentVariable __MINGW_NAME_AW(GetFirmwareEnvironmentVariable)
1832 #define SetFirmwareEnvironmentVariable __MINGW_NAME_AW(SetFirmwareEnvironmentVariable)
1833 #define FindResource __MINGW_NAME_AW(FindResource)
1834 #define EnumResourceTypes __MINGW_NAME_AW(EnumResourceTypes)
1835 #define EnumResourceNames __MINGW_NAME_AW(EnumResourceNames)
1836 #define EnumResourceLanguages __MINGW_NAME_AW(EnumResourceLanguages)
1837 #define BeginUpdateResource __MINGW_NAME_AW(BeginUpdateResource)
1838 #define UpdateResource __MINGW_NAME_AW(UpdateResource)
1839 #define EndUpdateResource __MINGW_NAME_AW(EndUpdateResource)
1840 #define GlobalAddAtom __MINGW_NAME_AW(GlobalAddAtom)
1841 #define GlobalAddAtomEx __MINGW_NAME_AW(GlobalAddAtomEx)
1842 #define GlobalFindAtom __MINGW_NAME_AW(GlobalFindAtom)
1843 #define GlobalGetAtomName __MINGW_NAME_AW(GlobalGetAtomName)
1844 #define AddAtom __MINGW_NAME_AW(AddAtom)
1845 #define FindAtom __MINGW_NAME_AW(FindAtom)
1846 #define GetAtomName __MINGW_NAME_AW(GetAtomName)
1847 #define GetProfileInt __MINGW_NAME_AW(GetProfileInt)
1848 #define GetProfileString __MINGW_NAME_AW(GetProfileString)
1849 #define WriteProfileString __MINGW_NAME_AW(WriteProfileString)
1850 #define GetProfileSection __MINGW_NAME_AW(GetProfileSection)
1851 #define WriteProfileSection __MINGW_NAME_AW(WriteProfileSection)
1852 #define GetPrivateProfileInt __MINGW_NAME_AW(GetPrivateProfileInt)
1853 #define GetPrivateProfileString __MINGW_NAME_AW(GetPrivateProfileString)
1854 #define WritePrivateProfileString __MINGW_NAME_AW(WritePrivateProfileString)
1855 #define GetPrivateProfileSection __MINGW_NAME_AW(GetPrivateProfileSection)
1856 #define WritePrivateProfileSection __MINGW_NAME_AW(WritePrivateProfileSection)
1857 #define GetPrivateProfileSectionNames __MINGW_NAME_AW(GetPrivateProfileSectionNames)
1858 #define GetPrivateProfileStruct __MINGW_NAME_AW(GetPrivateProfileStruct)
1859 #define WritePrivateProfileStruct __MINGW_NAME_AW(WritePrivateProfileStruct)
1860 
1861 #if _WIN32_WINNT >= 0x0602
1862 #define GetFirmwareEnvironmentVariableEx __MINGW_NAME_AW(GetFirmwareEnvironmentVariableEx)
1863 #define SetFirmwareEnvironmentVariableEx __MINGW_NAME_AW(SetFirmwareEnvironmentVariableEx)
1864 #endif
1865 
1866 #ifndef RC_INVOKED
1867   WINBASEAPI UINT WINAPI GetSystemWow64DirectoryA (LPSTR lpBuffer, UINT uSize);
1868   WINBASEAPI UINT WINAPI GetSystemWow64DirectoryW (LPWSTR lpBuffer, UINT uSize);
1869 
1870 #define GetSystemWow64Directory __MINGW_NAME_AW(GetSystemWow64Directory)
1871 
1872   WINBASEAPI BOOLEAN WINAPI Wow64EnableWow64FsRedirection (BOOLEAN Wow64FsEnableRedirection);
1873 
1874   typedef UINT (WINAPI *PGET_SYSTEM_WOW64_DIRECTORY_A) (LPSTR lpBuffer, UINT uSize);
1875   typedef UINT (WINAPI *PGET_SYSTEM_WOW64_DIRECTORY_W) (LPWSTR lpBuffer, UINT uSize);
1876 
1877 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A "GetSystemWow64DirectoryA"
1878 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W L"GetSystemWow64DirectoryA"
1879 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T TEXT ("GetSystemWow64DirectoryA")
1880 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A "GetSystemWow64DirectoryW"
1881 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W L"GetSystemWow64DirectoryW"
1882 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T TEXT ("GetSystemWow64DirectoryW")
1883 
1884 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A __MINGW_NAME_UAW_EXT(GET_SYSTEM_WOW64_DIRECTORY_NAME,A)
1885 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W __MINGW_NAME_UAW_EXT(GET_SYSTEM_WOW64_DIRECTORY_NAME,W)
1886 #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T __MINGW_NAME_UAW_EXT(GET_SYSTEM_WOW64_DIRECTORY_NAME,T)
1887 #endif
1888 
1889   WINBASEAPI WINBOOL WINAPI SetDllDirectoryA (LPCSTR lpPathName);
1890   WINBASEAPI WINBOOL WINAPI SetDllDirectoryW (LPCWSTR lpPathName);
1891   WINBASEAPI DWORD WINAPI GetDllDirectoryA (DWORD nBufferLength, LPSTR lpBuffer);
1892   WINBASEAPI DWORD WINAPI GetDllDirectoryW (DWORD nBufferLength, LPWSTR lpBuffer);
1893 
1894 #define SetDllDirectory __MINGW_NAME_AW(SetDllDirectory)
1895 #define GetDllDirectory __MINGW_NAME_AW(GetDllDirectory)
1896 
1897 #define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x1
1898 #define BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE 0x10000
1899 #define BASE_SEARCH_PATH_PERMANENT 0x8000
1900 #define BASE_SEARCH_PATH_INVALID_FLAGS ~0x18001
1901 
1902   WINBASEAPI WINBOOL WINAPI SetSearchPathMode (DWORD Flags);
1903 #endif
1904 
1905 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1906   WINBASEAPI WINBOOL WINAPI CreateDirectoryExA (LPCSTR lpTemplateDirectory, LPCSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1907   WINBASEAPI WINBOOL WINAPI CreateDirectoryExW (LPCWSTR lpTemplateDirectory, LPCWSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1908 
1909 #define CreateDirectoryEx __MINGW_NAME_AW(CreateDirectoryEx)
1910 
1911 #if _WIN32_WINNT >= 0x0600
1912   WINBASEAPI WINBOOL WINAPI CreateDirectoryTransactedA (LPCSTR lpTemplateDirectory, LPCSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes, HANDLE hTransaction);
1913   WINBASEAPI WINBOOL WINAPI CreateDirectoryTransactedW (LPCWSTR lpTemplateDirectory, LPCWSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes, HANDLE hTransaction);
1914   WINBASEAPI WINBOOL WINAPI RemoveDirectoryTransactedA (LPCSTR lpPathName, HANDLE hTransaction);
1915   WINBASEAPI WINBOOL WINAPI RemoveDirectoryTransactedW (LPCWSTR lpPathName, HANDLE hTransaction);
1916   WINBASEAPI DWORD WINAPI GetFullPathNameTransactedA (LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, LPSTR *lpFilePart, HANDLE hTransaction);
1917   WINBASEAPI DWORD WINAPI GetFullPathNameTransactedW (LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR *lpFilePart, HANDLE hTransaction);
1918 
1919 #define CreateDirectoryTransacted __MINGW_NAME_AW(CreateDirectoryTransacted)
1920 #define RemoveDirectoryTransacted __MINGW_NAME_AW(RemoveDirectoryTransacted)
1921 #define GetFullPathNameTransacted __MINGW_NAME_AW(GetFullPathNameTransacted)
1922 
1923 #endif
1924 
1925 #define DDD_RAW_TARGET_PATH 0x00000001
1926 #define DDD_REMOVE_DEFINITION 0x00000002
1927 #define DDD_EXACT_MATCH_ON_REMOVE 0x00000004
1928 #define DDD_NO_BROADCAST_SYSTEM 0x00000008
1929 #define DDD_LUID_BROADCAST_DRIVE 0x00000010
1930 
1931   WINBASEAPI WINBOOL WINAPI DefineDosDeviceA (DWORD dwFlags, LPCSTR lpDeviceName, LPCSTR lpTargetPath);
1932   WINBASEAPI DWORD WINAPI QueryDosDeviceA (LPCSTR lpDeviceName, LPSTR lpTargetPath, DWORD ucchMax);
1933 
1934 #ifndef UNICODE
1935 #define DefineDosDevice DefineDosDeviceA
1936 #define QueryDosDevice QueryDosDeviceA
1937 #endif
1938 
1939 #define EXPAND_LOCAL_DRIVES
1940 
1941 #if _WIN32_WINNT >= 0x0600
1942   WINBASEAPI HANDLE WINAPI CreateFileTransactedA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile, HANDLE hTransaction, PUSHORT pusMiniVersion, PVOID lpExtendedParameter);
1943   WINBASEAPI HANDLE WINAPI CreateFileTransactedW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile, HANDLE hTransaction, PUSHORT pusMiniVersion, PVOID lpExtendedParameter);
1944 
1945 #define CreateFileTransacted __MINGW_NAME_AW(CreateFileTransacted)
1946 #endif
1947 
1948   WINBASEAPI HANDLE WINAPI ReOpenFile (HANDLE hOriginalFile, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwFlagsAndAttributes);
1949 #if _WIN32_WINNT >= 0x0600
1950   WINBASEAPI WINBOOL WINAPI SetFileAttributesTransactedA (LPCSTR lpFileName, DWORD dwFileAttributes, HANDLE hTransaction);
1951   WINBASEAPI WINBOOL WINAPI SetFileAttributesTransactedW (LPCWSTR lpFileName, DWORD dwFileAttributes, HANDLE hTransaction);
1952   WINBASEAPI WINBOOL WINAPI GetFileAttributesTransactedA (LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation, HANDLE hTransaction);
1953   WINBASEAPI WINBOOL WINAPI GetFileAttributesTransactedW (LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation, HANDLE hTransaction);
1954 
1955 #define SetFileAttributesTransacted __MINGW_NAME_AW(SetFileAttributesTransacted)
1956 #define GetFileAttributesTransacted __MINGW_NAME_AW(GetFileAttributesTransacted)
1957 
1958 #endif
1959 
1960   WINBASEAPI DWORD WINAPI GetCompressedFileSizeA (LPCSTR lpFileName, LPDWORD lpFileSizeHigh);
1961   WINBASEAPI DWORD WINAPI GetCompressedFileSizeW (LPCWSTR lpFileName, LPDWORD lpFileSizeHigh);
1962 
1963 #define GetCompressedFileSize __MINGW_NAME_AW(GetCompressedFileSize)
1964 
1965 #if _WIN32_WINNT >= 0x0600
1966   WINBASEAPI DWORD WINAPI GetCompressedFileSizeTransactedA (LPCSTR lpFileName, LPDWORD lpFileSizeHigh, HANDLE hTransaction);
1967   WINBASEAPI DWORD WINAPI GetCompressedFileSizeTransactedW (LPCWSTR lpFileName, LPDWORD lpFileSizeHigh, HANDLE hTransaction);
1968   WINBASEAPI WINBOOL WINAPI DeleteFileTransactedA (LPCSTR lpFileName, HANDLE hTransaction);
1969   WINBASEAPI WINBOOL WINAPI DeleteFileTransactedW (LPCWSTR lpFileName, HANDLE hTransaction);
1970 
1971 #define DeleteFileTransacted __MINGW_NAME_AW(DeleteFileTransacted)
1972 #define GetCompressedFileSizeTransacted __MINGW_NAME_AW(GetCompressedFileSizeTransacted)
1973 
1974 #endif
1975 #endif
1976 
1977 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
1978   typedef DWORD (WINAPI *LPPROGRESS_ROUTINE) (LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData);
1979 
1980   WINBASEAPI WINBOOL WINAPI CopyFileExA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags);
1981   WINBASEAPI WINBOOL WINAPI CopyFileExW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags);
1982 
1983 #define CopyFileEx __MINGW_NAME_AW(CopyFileEx)
1984 #endif
1985 
1986 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
1987   WINBASEAPI WINBOOL WINAPI CheckNameLegalDOS8Dot3A (LPCSTR lpName, LPSTR lpOemName, DWORD OemNameSize, PBOOL pbNameContainsSpaces, PBOOL pbNameLegal);
1988   WINBASEAPI WINBOOL WINAPI CheckNameLegalDOS8Dot3W (LPCWSTR lpName, LPSTR lpOemName, DWORD OemNameSize, PBOOL pbNameContainsSpaces, PBOOL pbNameLegal);
1989   WINBASEAPI WINBOOL WINAPI CopyFileA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, WINBOOL bFailIfExists);
1990   WINBASEAPI WINBOOL WINAPI CopyFileW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, WINBOOL bFailIfExists);
1991 
1992 #if _WIN32_WINNT >= 0x0600
1993   WINBASEAPI HANDLE WINAPI FindFirstFileTransactedA (LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags, HANDLE hTransaction);
1994   WINBASEAPI HANDLE WINAPI FindFirstFileTransactedW (LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags, HANDLE hTransaction);
1995   WINBASEAPI WINBOOL WINAPI CopyFileTransactedA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags, HANDLE hTransaction);
1996   WINBASEAPI WINBOOL WINAPI CopyFileTransactedW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags, HANDLE hTransaction);
1997 
1998 #define FindFirstFileTransacted __MINGW_NAME_AW(FindFirstFileTransacted)
1999 #define CopyFileTransacted __MINGW_NAME_AW(CopyFileTransacted)
2000 #endif
2001 
2002 #define CheckNameLegalDOS8Dot3 __MINGW_NAME_AW(CheckNameLegalDOS8Dot3)
2003 #define CopyFile __MINGW_NAME_AW(CopyFile)
2004 
2005 #endif
2006 
2007 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
2008 #if _WIN32_WINNT >= 0x0601
2009   typedef enum _COPYFILE2_MESSAGE_TYPE {
2010     COPYFILE2_CALLBACK_NONE = 0,
2011     COPYFILE2_CALLBACK_CHUNK_STARTED,
2012     COPYFILE2_CALLBACK_CHUNK_FINISHED,
2013     COPYFILE2_CALLBACK_STREAM_STARTED,
2014     COPYFILE2_CALLBACK_STREAM_FINISHED,
2015     COPYFILE2_CALLBACK_POLL_CONTINUE,
2016     COPYFILE2_CALLBACK_ERROR,
2017     COPYFILE2_CALLBACK_MAX,
2018   } COPYFILE2_MESSAGE_TYPE;
2019 
2020   typedef enum _COPYFILE2_MESSAGE_ACTION {
2021     COPYFILE2_PROGRESS_CONTINUE = 0,
2022     COPYFILE2_PROGRESS_CANCEL,
2023     COPYFILE2_PROGRESS_STOP,
2024     COPYFILE2_PROGRESS_QUIET,
2025     COPYFILE2_PROGRESS_PAUSE,
2026   } COPYFILE2_MESSAGE_ACTION;
2027 
2028   typedef enum _COPYFILE2_COPY_PHASE {
2029     COPYFILE2_PHASE_NONE = 0,
2030     COPYFILE2_PHASE_PREPARE_SOURCE,
2031     COPYFILE2_PHASE_PREPARE_DEST,
2032     COPYFILE2_PHASE_READ_SOURCE,
2033     COPYFILE2_PHASE_WRITE_DESTINATION,
2034     COPYFILE2_PHASE_SERVER_COPY,
2035     COPYFILE2_PHASE_NAMEGRAFT_COPY,
2036     COPYFILE2_PHASE_MAX,
2037   } COPYFILE2_COPY_PHASE;
2038 
2039 #define COPYFILE2_MESSAGE_COPY_OFFLOAD (__MSABI_LONG (0x00000001))
2040 
2041   typedef struct COPYFILE2_MESSAGE {
2042     COPYFILE2_MESSAGE_TYPE Type;
2043     DWORD dwPadding;
2044     union {
2045       struct {
2046     DWORD dwStreamNumber;
2047     DWORD dwReserved;
2048     HANDLE hSourceFile;
2049     HANDLE hDestinationFile;
2050     ULARGE_INTEGER uliChunkNumber;
2051     ULARGE_INTEGER uliChunkSize;
2052     ULARGE_INTEGER uliStreamSize;
2053     ULARGE_INTEGER uliTotalFileSize;
2054       } ChunkStarted;
2055       struct {
2056     DWORD dwStreamNumber;
2057     DWORD dwFlags;
2058     HANDLE hSourceFile;
2059     HANDLE hDestinationFile;
2060     ULARGE_INTEGER uliChunkNumber;
2061     ULARGE_INTEGER uliChunkSize;
2062     ULARGE_INTEGER uliStreamSize;
2063     ULARGE_INTEGER uliStreamBytesTransferred;
2064     ULARGE_INTEGER uliTotalFileSize;
2065     ULARGE_INTEGER uliTotalBytesTransferred;
2066       } ChunkFinished;
2067       struct {
2068     DWORD dwStreamNumber;
2069     DWORD dwReserved;
2070     HANDLE hSourceFile;
2071     HANDLE hDestinationFile;
2072     ULARGE_INTEGER uliStreamSize;
2073     ULARGE_INTEGER uliTotalFileSize;
2074       } StreamStarted;
2075       struct {
2076     DWORD dwStreamNumber;
2077     DWORD dwReserved;
2078     HANDLE hSourceFile;
2079     HANDLE hDestinationFile;
2080     ULARGE_INTEGER uliStreamSize;
2081     ULARGE_INTEGER uliStreamBytesTransferred;
2082     ULARGE_INTEGER uliTotalFileSize;
2083     ULARGE_INTEGER uliTotalBytesTransferred;
2084       } StreamFinished;
2085       struct {
2086     DWORD dwReserved;
2087       } PollContinue;
2088       struct {
2089     COPYFILE2_COPY_PHASE CopyPhase;
2090     DWORD dwStreamNumber;
2091     HRESULT hrFailure;
2092     DWORD dwReserved;
2093     ULARGE_INTEGER uliChunkNumber;
2094     ULARGE_INTEGER uliStreamSize;
2095     ULARGE_INTEGER uliStreamBytesTransferred;
2096     ULARGE_INTEGER uliTotalFileSize;
2097     ULARGE_INTEGER uliTotalBytesTransferred;
2098       } Error;
2099     } Info;
2100   } COPYFILE2_MESSAGE;
2101 
2102   typedef COPYFILE2_MESSAGE_ACTION (CALLBACK *PCOPYFILE2_PROGRESS_ROUTINE) (const COPYFILE2_MESSAGE *pMessage, PVOID pvCallbackContext);
2103 
2104   typedef struct COPYFILE2_EXTENDED_PARAMETERS {
2105     DWORD dwSize;
2106     DWORD dwCopyFlags;
2107     WINBOOL *pfCancel;
2108     PCOPYFILE2_PROGRESS_ROUTINE pProgressRoutine;
2109     PVOID pvCallbackContext;
2110   } COPYFILE2_EXTENDED_PARAMETERS;
2111 
2112   WINBASEAPI HRESULT WINAPI CopyFile2 (PCWSTR pwszExistingFileName, PCWSTR pwszNewFileName, COPYFILE2_EXTENDED_PARAMETERS *pExtendedParameters);
2113 #endif
2114 #endif
2115 
2116 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2117   WINBASEAPI WINBOOL WINAPI MoveFileA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName);
2118   WINBASEAPI WINBOOL WINAPI MoveFileW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName);
2119 
2120 #define MoveFile __MINGW_NAME_AW(MoveFile)
2121 #endif
2122 
2123 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
2124   WINBASEAPI WINBOOL WINAPI MoveFileExA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, DWORD dwFlags);
2125   WINBASEAPI WINBOOL WINAPI MoveFileExW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, DWORD dwFlags);
2126 
2127 #define MoveFileEx __MINGW_NAME_AW(MoveFileEx)
2128 #endif
2129 
2130 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2131   WINBASEAPI WINBOOL WINAPI MoveFileWithProgressA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags);
2132   WINBASEAPI WINBOOL WINAPI MoveFileWithProgressW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags);
2133 
2134 #define MoveFileWithProgress __MINGW_NAME_AW(MoveFileWithProgress)
2135 
2136 #if _WIN32_WINNT >= 0x0600
2137   WINBASEAPI WINBOOL WINAPI MoveFileTransactedA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags, HANDLE hTransaction);
2138   WINBASEAPI WINBOOL WINAPI MoveFileTransactedW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags, HANDLE hTransaction);
2139 
2140 #define MoveFileTransacted __MINGW_NAME_AW(MoveFileTransacted)
2141 #endif
2142 #endif
2143 
2144 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
2145 #define MOVEFILE_REPLACE_EXISTING 0x00000001
2146 #define MOVEFILE_COPY_ALLOWED 0x00000002
2147 #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
2148 #define MOVEFILE_WRITE_THROUGH 0x00000008
2149 #define MOVEFILE_CREATE_HARDLINK 0x00000010
2150 #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x00000020
2151 #endif
2152 
2153 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
2154   WINBASEAPI WINBOOL WINAPI GetNamedPipeClientComputerNameA (HANDLE Pipe, LPSTR ClientComputerName, ULONG ClientComputerNameLength);
2155   WINBASEAPI WINBOOL WINAPI GetNamedPipeHandleStateA (HANDLE hNamedPipe, LPDWORD lpState, LPDWORD lpCurInstances, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout, LPSTR lpUserName, DWORD nMaxUserNameSize);
2156   WINBASEAPI WINBOOL WINAPI WaitNamedPipeA (LPCSTR lpNamedPipeName, DWORD nTimeOut);
2157   WINBASEAPI WINBOOL WINAPI CallNamedPipeA (LPCSTR lpNamedPipeName, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, DWORD nTimeOut);
2158   WINBASEAPI WINBOOL WINAPI CallNamedPipeW (LPCWSTR lpNamedPipeName, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, DWORD nTimeOut);
2159   WINBASEAPI HANDLE WINAPI CreateNamedPipeA (LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2160 
2161 #ifndef UNICODE
2162 #define WaitNamedPipe WaitNamedPipeA
2163 #define CreateNamedPipe CreateNamedPipeA
2164 #endif
2165 
2166 #define CallNamedPipe __MINGW_NAME_AW(CallNamedPipe)
2167 
2168 #endif
2169 
2170 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2171   WINBASEAPI WINBOOL WINAPI ReplaceFileA (LPCSTR lpReplacedFileName, LPCSTR lpReplacementFileName, LPCSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved);
2172   WINBASEAPI WINBOOL WINAPI ReplaceFileW (LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileName, LPCWSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved);
2173   WINBASEAPI WINBOOL WINAPI CreateHardLinkA (LPCSTR lpFileName, LPCSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2174   WINBASEAPI WINBOOL WINAPI CreateHardLinkW (LPCWSTR lpFileName, LPCWSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2175 
2176 #define ReplaceFile __MINGW_NAME_AW(ReplaceFile)
2177 #define CreateHardLink __MINGW_NAME_AW(CreateHardLink)
2178 
2179 #if _WIN32_WINNT >= 0x0600
2180   WINBASEAPI WINBOOL WINAPI CreateHardLinkTransactedA (LPCSTR lpFileName, LPCSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes, HANDLE hTransaction);
2181   WINBASEAPI WINBOOL WINAPI CreateHardLinkTransactedW (LPCWSTR lpFileName, LPCWSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes, HANDLE hTransaction);
2182 
2183 #define CreateHardLinkTransacted __MINGW_NAME_AW(CreateHardLinkTransacted)
2184 #endif
2185 
2186   typedef enum _STREAM_INFO_LEVELS {
2187     FindStreamInfoStandard,
2188     FindStreamInfoMaxInfoLevel
2189   } STREAM_INFO_LEVELS;
2190 
2191   typedef struct _WIN32_FIND_STREAM_DATA {
2192     LARGE_INTEGER StreamSize;
2193     WCHAR cStreamName[MAX_PATH + 36];
2194   } WIN32_FIND_STREAM_DATA,*PWIN32_FIND_STREAM_DATA;
2195 
2196   WINBASEAPI HANDLE WINAPI FindFirstStreamW (LPCWSTR lpFileName, STREAM_INFO_LEVELS InfoLevel, LPVOID lpFindStreamData, DWORD dwFlags);
2197   WINBASEAPI WINBOOL APIENTRY FindNextStreamW (HANDLE hFindStream, LPVOID lpFindStreamData);
2198 #if _WIN32_WINNT >= 0x0600
2199   WINBASEAPI HANDLE WINAPI FindFirstStreamTransactedW (LPCWSTR lpFileName, STREAM_INFO_LEVELS InfoLevel, LPVOID lpFindStreamData, DWORD dwFlags, HANDLE hTransaction);
2200   WINBASEAPI HANDLE WINAPI FindFirstFileNameW (LPCWSTR lpFileName, DWORD dwFlags, LPDWORD StringLength, PWSTR LinkName);
2201   WINBASEAPI WINBOOL APIENTRY FindNextFileNameW (HANDLE hFindStream, LPDWORD StringLength, PWSTR LinkName);
2202   WINBASEAPI HANDLE WINAPI FindFirstFileNameTransactedW (LPCWSTR lpFileName, DWORD dwFlags, LPDWORD StringLength, PWSTR LinkName, HANDLE hTransaction);
2203   WINBASEAPI WINBOOL WINAPI GetNamedPipeClientProcessId (HANDLE Pipe, PULONG ClientProcessId);
2204   WINBASEAPI WINBOOL WINAPI GetNamedPipeClientSessionId (HANDLE Pipe, PULONG ClientSessionId);
2205   WINBASEAPI WINBOOL WINAPI GetNamedPipeServerProcessId (HANDLE Pipe, PULONG ServerProcessId);
2206   WINBASEAPI WINBOOL WINAPI GetNamedPipeServerSessionId (HANDLE Pipe, PULONG ServerSessionId);
2207   WINBASEAPI WINBOOL WINAPI SetFileBandwidthReservation (HANDLE hFile, DWORD nPeriodMilliseconds, DWORD nBytesPerPeriod, WINBOOL bDiscardable, LPDWORD lpTransferSize, LPDWORD lpNumOutstandingRequests);
2208   WINBASEAPI WINBOOL WINAPI GetFileBandwidthReservation (HANDLE hFile, LPDWORD lpPeriodMilliseconds, LPDWORD lpBytesPerPeriod, LPBOOL pDiscardable, LPDWORD lpTransferSize, LPDWORD lpNumOutstandingRequests);
2209 #endif
2210   WINBASEAPI WINBOOL WINAPI GetNamedPipeHandleStateW (HANDLE hNamedPipe, LPDWORD lpState, LPDWORD lpCurInstances, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout, LPWSTR lpUserName, DWORD nMaxUserNameSize);
2211   WINBASEAPI WINBOOL WINAPI SetVolumeLabelA (LPCSTR lpRootPathName, LPCSTR lpVolumeName);
2212   WINBASEAPI WINBOOL WINAPI SetVolumeLabelW (LPCWSTR lpRootPathName, LPCWSTR lpVolumeName);
2213   WINBASEAPI VOID WINAPI SetFileApisToOEM (VOID);
2214   WINBASEAPI VOID WINAPI SetFileApisToANSI (VOID);
2215   WINBASEAPI WINBOOL WINAPI AreFileApisANSI (VOID);
2216   WINBASEAPI WINBOOL WINAPI GetVolumeInformationA (LPCSTR lpRootPathName, LPSTR lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, LPSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
2217   WINADVAPI WINBOOL WINAPI ClearEventLogA (HANDLE hEventLog, LPCSTR lpBackupFileName);
2218   WINADVAPI WINBOOL WINAPI ClearEventLogW (HANDLE hEventLog, LPCWSTR lpBackupFileName);
2219   WINADVAPI WINBOOL WINAPI BackupEventLogA (HANDLE hEventLog, LPCSTR lpBackupFileName);
2220   WINADVAPI WINBOOL WINAPI BackupEventLogW (HANDLE hEventLog, LPCWSTR lpBackupFileName);
2221   WINADVAPI WINBOOL WINAPI CloseEventLog (HANDLE hEventLog);
2222   WINADVAPI WINBOOL WINAPI DeregisterEventSource (HANDLE hEventLog);
2223   WINADVAPI WINBOOL WINAPI NotifyChangeEventLog (HANDLE hEventLog, HANDLE hEvent);
2224   WINADVAPI WINBOOL WINAPI GetNumberOfEventLogRecords (HANDLE hEventLog, PDWORD NumberOfRecords);
2225   WINADVAPI WINBOOL WINAPI GetOldestEventLogRecord (HANDLE hEventLog, PDWORD OldestRecord);
2226   WINADVAPI HANDLE WINAPI OpenEventLogA (LPCSTR lpUNCServerName, LPCSTR lpSourceName);
2227   WINADVAPI HANDLE WINAPI OpenEventLogW (LPCWSTR lpUNCServerName, LPCWSTR lpSourceName);
2228   WINADVAPI HANDLE WINAPI RegisterEventSourceA (LPCSTR lpUNCServerName, LPCSTR lpSourceName);
2229   WINADVAPI HANDLE WINAPI RegisterEventSourceW (LPCWSTR lpUNCServerName, LPCWSTR lpSourceName);
2230   WINADVAPI HANDLE WINAPI OpenBackupEventLogA (LPCSTR lpUNCServerName, LPCSTR lpFileName);
2231   WINADVAPI HANDLE WINAPI OpenBackupEventLogW (LPCWSTR lpUNCServerName, LPCWSTR lpFileName);
2232   WINADVAPI WINBOOL WINAPI ReadEventLogA (HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded);
2233   WINADVAPI WINBOOL WINAPI ReadEventLogW (HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded);
2234   WINADVAPI WINBOOL WINAPI ReportEventA (HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCSTR *lpStrings, LPVOID lpRawData);
2235   WINADVAPI WINBOOL WINAPI ReportEventW (HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData);
2236 
2237 #ifndef UNICODE
2238 #define GetVolumeInformation GetVolumeInformationA
2239 #endif
2240 
2241 #define GetNamedPipeHandleState __MINGW_NAME_AW(GetNamedPipeHandleState)
2242 #define SetVolumeLabel __MINGW_NAME_AW(SetVolumeLabel)
2243 #define ClearEventLog __MINGW_NAME_AW(ClearEventLog)
2244 #define BackupEventLog __MINGW_NAME_AW(BackupEventLog)
2245 #define OpenEventLog __MINGW_NAME_AW(OpenEventLog)
2246 #define RegisterEventSource __MINGW_NAME_AW(RegisterEventSource)
2247 #define OpenBackupEventLog __MINGW_NAME_AW(OpenBackupEventLog)
2248 #define ReadEventLog __MINGW_NAME_AW(ReadEventLog)
2249 #define ReportEvent __MINGW_NAME_AW(ReportEvent)
2250 
2251 #if _WIN32_WINNT >= 0x0600 && !defined (UNICODE)
2252 #define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameA
2253 #endif
2254 
2255 #define EVENTLOG_FULL_INFO 0
2256 
2257   typedef struct _EVENTLOG_FULL_INFORMATION {
2258     DWORD dwFull;
2259   } EVENTLOG_FULL_INFORMATION,*LPEVENTLOG_FULL_INFORMATION;
2260 
2261   WINADVAPI WINBOOL WINAPI GetEventLogInformation (HANDLE hEventLog, DWORD dwInfoLevel, LPVOID lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded);
2262 
2263 #if _WIN32_WINNT >= 0x0602
2264 
2265 #define OPERATION_API_VERSION 1
2266 
2267   typedef ULONG OPERATION_ID;
2268 
2269   typedef struct _OPERATION_START_PARAMETERS {
2270     ULONG Version;
2271     OPERATION_ID OperationId;
2272     ULONG Flags;
2273   } OPERATION_START_PARAMETERS,*POPERATION_START_PARAMETERS;
2274 
2275 #define OPERATION_START_TRACE_CURRENT_THREAD 0x1
2276 
2277   typedef struct _OPERATION_END_PARAMETERS {
2278     ULONG Version;
2279     OPERATION_ID OperationId;
2280     ULONG Flags;
2281   } OPERATION_END_PARAMETERS,*POPERATION_END_PARAMETERS;
2282 
2283 #define OPERATION_END_DISCARD 0x1
2284 
2285   WINADVAPI WINBOOL WINAPI OperationStart (OPERATION_START_PARAMETERS *OperationStartParams);
2286   WINADVAPI WINBOOL WINAPI OperationEnd (OPERATION_END_PARAMETERS *OperationEndParams);
2287 #endif
2288 
2289 #endif
2290 
2291 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
2292   WINBASEAPI WINBOOL WINAPI ReadDirectoryChangesW (HANDLE hDirectory, LPVOID lpBuffer, DWORD nBufferLength, WINBOOL bWatchSubtree, DWORD dwNotifyFilter, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
2293 #endif
2294 
2295 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2296 
2297   WINADVAPI WINBOOL WINAPI AccessCheckAndAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, LPSTR ObjectTypeName, LPSTR ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD DesiredAccess, PGENERIC_MAPPING GenericMapping, WINBOOL ObjectCreation, LPDWORD GrantedAccess, LPBOOL AccessStatus, LPBOOL pfGenerateOnClose);
2298   WINADVAPI WINBOOL WINAPI AccessCheckByTypeAndAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, LPCSTR ObjectTypeName, LPCSTR ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID PrincipalSelfSid, DWORD DesiredAccess, AUDIT_EVENT_TYPE AuditType, DWORD Flags, POBJECT_TYPE_LIST ObjectTypeList, DWORD ObjectTypeListLength, PGENERIC_MAPPING GenericMapping, WINBOOL ObjectCreation, LPDWORD GrantedAccess, LPBOOL AccessStatus, LPBOOL pfGenerateOnClose);
2299   WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultListAndAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, LPCSTR ObjectTypeName, LPCSTR ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID PrincipalSelfSid, DWORD DesiredAccess, AUDIT_EVENT_TYPE AuditType, DWORD Flags, POBJECT_TYPE_LIST ObjectTypeList, DWORD ObjectTypeListLength, PGENERIC_MAPPING GenericMapping, WINBOOL ObjectCreation, LPDWORD GrantedAccess, LPDWORD AccessStatusList, LPBOOL pfGenerateOnClose);
2300   WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultListAndAuditAlarmByHandleA (LPCSTR SubsystemName, LPVOID HandleId, HANDLE ClientToken, LPCSTR ObjectTypeName, LPCSTR ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID PrincipalSelfSid, DWORD DesiredAccess, AUDIT_EVENT_TYPE AuditType, DWORD Flags, POBJECT_TYPE_LIST ObjectTypeList, DWORD ObjectTypeListLength, PGENERIC_MAPPING GenericMapping, WINBOOL ObjectCreation, LPDWORD GrantedAccess, LPDWORD AccessStatusList, LPBOOL pfGenerateOnClose);
2301   WINADVAPI WINBOOL WINAPI ObjectOpenAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, LPSTR ObjectTypeName, LPSTR ObjectName, PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess, DWORD GrantedAccess, PPRIVILEGE_SET Privileges, WINBOOL ObjectCreation, WINBOOL AccessGranted, LPBOOL GenerateOnClose);
2302   WINADVAPI WINBOOL WINAPI ObjectPrivilegeAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, HANDLE ClientToken, DWORD DesiredAccess, PPRIVILEGE_SET Privileges, WINBOOL AccessGranted);
2303   WINADVAPI WINBOOL WINAPI ObjectCloseAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, WINBOOL GenerateOnClose);
2304   WINADVAPI WINBOOL WINAPI ObjectDeleteAuditAlarmA (LPCSTR SubsystemName, LPVOID HandleId, WINBOOL GenerateOnClose);
2305   WINADVAPI WINBOOL WINAPI PrivilegedServiceAuditAlarmA (LPCSTR SubsystemName, LPCSTR ServiceName, HANDLE ClientToken, PPRIVILEGE_SET Privileges, WINBOOL AccessGranted);
2306   WINADVAPI WINBOOL WINAPI SetFileSecurityA (LPCSTR lpFileName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor);
2307   WINADVAPI WINBOOL WINAPI GetFileSecurityA (LPCSTR lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded);
2308   WINBASEAPI WINBOOL WINAPI IsBadReadPtr (CONST VOID *lp, UINT_PTR ucb);
2309   WINBASEAPI WINBOOL WINAPI IsBadWritePtr (LPVOID lp, UINT_PTR ucb);
2310   WINBASEAPI WINBOOL WINAPI IsBadHugeReadPtr (CONST VOID *lp, UINT_PTR ucb);
2311   WINBASEAPI WINBOOL WINAPI IsBadHugeWritePtr (LPVOID lp, UINT_PTR ucb);
2312   WINBASEAPI WINBOOL WINAPI IsBadCodePtr (FARPROC lpfn);
2313   WINBASEAPI WINBOOL WINAPI IsBadStringPtrA (LPCSTR lpsz, UINT_PTR ucchMax);
2314   WINBASEAPI WINBOOL WINAPI IsBadStringPtrW (LPCWSTR lpsz, UINT_PTR ucchMax);
2315 #if _WIN32_WINNT >= 0x0600
2316   WINBASEAPI LPVOID WINAPI MapViewOfFileExNuma (HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress, DWORD nndPreferred);
2317 #endif
2318 #if _WIN32_WINNT >= 0x0601
2319   WINADVAPI WINBOOL WINAPI AddConditionalAce (PACL pAcl, DWORD dwAceRevision, DWORD AceFlags, UCHAR AceType, DWORD AccessMask, PSID pSid, PWCHAR ConditionStr, DWORD *ReturnLength);
2320 #endif
2321   WINADVAPI WINBOOL WINAPI LookupAccountSidA (LPCSTR lpSystemName, PSID Sid, LPSTR Name, LPDWORD cchName, LPSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2322   WINADVAPI WINBOOL WINAPI LookupAccountSidW (LPCWSTR lpSystemName, PSID Sid, LPWSTR Name, LPDWORD cchName, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2323   WINADVAPI WINBOOL WINAPI LookupAccountNameA (LPCSTR lpSystemName, LPCSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2324   WINADVAPI WINBOOL WINAPI LookupAccountNameW (LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2325 
2326 #ifndef UNICODE
2327 #define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA
2328 #define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmA
2329 #define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAndAuditAlarmA
2330 #define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResultListAndAuditAlarmByHandleA
2331 #define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA
2332 #define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA
2333 #define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA
2334 #define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA
2335 #define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA
2336 #define SetFileSecurity SetFileSecurityA
2337 #define GetFileSecurity GetFileSecurityA
2338 #endif
2339 
2340 #define IsBadStringPtr __MINGW_NAME_AW(IsBadStringPtr)
2341 #define LookupAccountSid __MINGW_NAME_AW(LookupAccountSid)
2342 #define LookupAccountName __MINGW_NAME_AW(LookupAccountName)
2343 
2344 #if _WIN32_WINNT >= 0x0601
2345   WINADVAPI WINBOOL WINAPI LookupAccountNameLocalA (LPCSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2346   WINADVAPI WINBOOL WINAPI LookupAccountNameLocalW (LPCWSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2347   WINADVAPI WINBOOL WINAPI LookupAccountSidLocalA (PSID Sid, LPSTR Name, LPDWORD cchName, LPSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2348   WINADVAPI WINBOOL WINAPI LookupAccountSidLocalW (PSID Sid, LPWSTR Name, LPDWORD cchName, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse);
2349 
2350 #define LookupAccountNameLocal __MINGW_NAME_AW(LookupAccountNameLocal)
2351 #define LookupAccountSidLocal __MINGW_NAME_AW(LookupAccountSidLocal)
2352 #else
2353 
2354 #define LookupAccountNameLocalA(n, s, cs, d, cd, u) LookupAccountNameA (NULL, n, s, cs, d, cd, u)
2355 #define LookupAccountNameLocalW(n, s, cs, d, cd, u) LookupAccountNameW (NULL, n, s, cs, d, cd, u)
2356 #define LookupAccountNameLocal(n, s, cs, d, cd, u) __MINGW_NAME_AW(LookupAccountName) (NULL, n, s, cs, d, cd, u)
2357 
2358 #define LookupAccountSidLocalA(s, n, cn, d, cd, u) LookupAccountSidA (NULL, s, n, cn, d, cd, u)
2359 #define LookupAccountSidLocalW(s, n, cn, d, cd, u) LookupAccountSidW (NULL, s, n, cn, d, cd, u)
2360 #define LookupAccountSidLocal(s, n, cn, d, cd, u) __MINGW_NAME_AW(LookupAccountSid) (NULL, s, n, cn, d, cd, u)
2361 
2362 #endif
2363 
2364   WINADVAPI WINBOOL WINAPI LookupPrivilegeValueA (LPCSTR lpSystemName, LPCSTR lpName, PLUID lpLuid);
2365   WINADVAPI WINBOOL WINAPI LookupPrivilegeValueW (LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid);
2366   WINADVAPI WINBOOL WINAPI LookupPrivilegeNameA (LPCSTR lpSystemName, PLUID lpLuid, LPSTR lpName, LPDWORD cchName);
2367   WINADVAPI WINBOOL WINAPI LookupPrivilegeNameW (LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName, LPDWORD cchName);
2368   WINADVAPI WINBOOL WINAPI LookupPrivilegeDisplayNameA (LPCSTR lpSystemName, LPCSTR lpName, LPSTR lpDisplayName, LPDWORD cchDisplayName, LPDWORD lpLanguageId);
2369   WINADVAPI WINBOOL WINAPI LookupPrivilegeDisplayNameW (LPCWSTR lpSystemName, LPCWSTR lpName, LPWSTR lpDisplayName, LPDWORD cchDisplayName, LPDWORD lpLanguageId);
2370   WINBASEAPI WINBOOL WINAPI BuildCommDCBA (LPCSTR lpDef, LPDCB lpDCB);
2371   WINBASEAPI WINBOOL WINAPI BuildCommDCBW (LPCWSTR lpDef, LPDCB lpDCB);
2372   WINBASEAPI WINBOOL WINAPI BuildCommDCBAndTimeoutsA (LPCSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts);
2373   WINBASEAPI WINBOOL WINAPI BuildCommDCBAndTimeoutsW (LPCWSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts);
2374   WINBASEAPI WINBOOL WINAPI CommConfigDialogA (LPCSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC);
2375   WINBASEAPI WINBOOL WINAPI CommConfigDialogW (LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC);
2376   WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigA (LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);
2377   WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);
2378   WINBASEAPI WINBOOL WINAPI SetDefaultCommConfigA (LPCSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize);
2379   WINBASEAPI WINBOOL WINAPI SetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize);
2380 
2381 #define LookupPrivilegeValue __MINGW_NAME_AW(LookupPrivilegeValue)
2382 #define LookupPrivilegeName __MINGW_NAME_AW(LookupPrivilegeName)
2383 #define LookupPrivilegeDisplayName __MINGW_NAME_AW(LookupPrivilegeDisplayName)
2384 #define BuildCommDCB __MINGW_NAME_AW(BuildCommDCB)
2385 #define BuildCommDCBAndTimeouts __MINGW_NAME_AW(BuildCommDCBAndTimeouts)
2386 #define CommConfigDialog __MINGW_NAME_AW(CommConfigDialog)
2387 #define GetDefaultCommConfig __MINGW_NAME_AW(GetDefaultCommConfig)
2388 #define SetDefaultCommConfig __MINGW_NAME_AW(SetDefaultCommConfig)
2389 
2390 #define MAX_COMPUTERNAME_LENGTH 15
2391 
2392   WINBASEAPI WINBOOL WINAPI GetComputerNameA (LPSTR lpBuffer, LPDWORD nSize);
2393   WINBASEAPI WINBOOL WINAPI GetComputerNameW (LPWSTR lpBuffer, LPDWORD nSize);
2394   WINBASEAPI WINBOOL WINAPI SetComputerNameA (LPCSTR lpComputerName);
2395   WINBASEAPI WINBOOL WINAPI SetComputerNameW (LPCWSTR lpComputerName);
2396   WINBASEAPI WINBOOL WINAPI SetComputerNameExA (COMPUTER_NAME_FORMAT NameType, LPCTSTR lpBuffer);
2397   WINBASEAPI WINBOOL WINAPI DnsHostnameToComputerNameA (LPCSTR Hostname, LPSTR ComputerName, LPDWORD nSize);
2398   WINBASEAPI WINBOOL WINAPI DnsHostnameToComputerNameW (LPCWSTR Hostname, LPWSTR ComputerName, LPDWORD nSize);
2399   WINADVAPI WINBOOL WINAPI GetUserNameA (LPSTR lpBuffer, LPDWORD pcbBuffer);
2400   WINADVAPI WINBOOL WINAPI GetUserNameW (LPWSTR lpBuffer, LPDWORD pcbBuffer);
2401 
2402 #ifndef UNICODE
2403 #define SetComputerNameEx SetComputerNameExA
2404 #endif
2405 
2406 #define GetComputerName __MINGW_NAME_AW(GetComputerName)
2407 #define SetComputerName __MINGW_NAME_AW(SetComputerName)
2408 #define DnsHostnameToComputerName __MINGW_NAME_AW(DnsHostnameToComputerName)
2409 #define GetUserName __MINGW_NAME_AW(GetUserName)
2410 
2411 #define LOGON32_LOGON_INTERACTIVE 2
2412 #define LOGON32_LOGON_NETWORK 3
2413 #define LOGON32_LOGON_BATCH 4
2414 #define LOGON32_LOGON_SERVICE 5
2415 #define LOGON32_LOGON_UNLOCK 7
2416 #define LOGON32_LOGON_NETWORK_CLEARTEXT 8
2417 #define LOGON32_LOGON_NEW_CREDENTIALS 9
2418 
2419 #define LOGON32_PROVIDER_DEFAULT 0
2420 #define LOGON32_PROVIDER_WINNT35 1
2421 #define LOGON32_PROVIDER_WINNT40 2
2422 #define LOGON32_PROVIDER_WINNT50 3
2423 #if _WIN32_WINNT >= 0x0600
2424 #define LOGON32_PROVIDER_VIRTUAL 4
2425 #endif
2426 
2427   WINADVAPI WINBOOL WINAPI LogonUserA (LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
2428   WINADVAPI WINBOOL WINAPI LogonUserW (LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
2429   WINADVAPI WINBOOL WINAPI LogonUserExA (LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, PSID *ppLogonSid, PVOID *ppProfileBuffer, LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits);
2430   WINADVAPI WINBOOL WINAPI LogonUserExW (LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, PSID *ppLogonSid, PVOID *ppProfileBuffer, LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits);
2431   WINADVAPI WINBOOL WINAPI CreateProcessAsUserA (HANDLE hToken, LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, WINBOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
2432 
2433 #ifndef UNICODE
2434 #define CreateProcessAsUser CreateProcessAsUserA
2435 #endif
2436 
2437 #define LogonUser __MINGW_NAME_AW(LogonUser)
2438 #define LogonUserEx __MINGW_NAME_AW(LogonUserEx)
2439 
2440 #define LOGON_WITH_PROFILE 0x00000001
2441 #define LOGON_NETCREDENTIALS_ONLY 0x00000002
2442 #define LOGON_ZERO_PASSWORD_BUFFER 0x80000000
2443 
2444   WINADVAPI WINBOOL WINAPI CreateProcessWithLogonW (LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, DWORD dwLogonFlags, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
2445   WINADVAPI WINBOOL WINAPI CreateProcessWithTokenW (HANDLE hToken, DWORD dwLogonFlags, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
2446   WINADVAPI WINBOOL WINAPI IsTokenUntrusted (HANDLE TokenHandle);
2447   WINBASEAPI WINBOOL WINAPI RegisterWaitForSingleObject (PHANDLE phNewWaitObject, HANDLE hObject, WAITORTIMERCALLBACK Callback, PVOID Context, ULONG dwMilliseconds, ULONG dwFlags);
2448   WINBASEAPI WINBOOL WINAPI UnregisterWait (HANDLE WaitHandle);
2449   WINBASEAPI WINBOOL WINAPI BindIoCompletionCallback (HANDLE FileHandle, LPOVERLAPPED_COMPLETION_ROUTINE Function, ULONG Flags);
2450   WINBASEAPI HANDLE WINAPI SetTimerQueueTimer (HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, WINBOOL PreferIo);
2451   WINBASEAPI WINBOOL WINAPI CancelTimerQueueTimer (HANDLE TimerQueue, HANDLE Timer);
2452   WINBASEAPI WINBOOL WINAPI DeleteTimerQueue (HANDLE TimerQueue);
2453 
2454 #ifndef __WIDL__
2455   /* Add Tp... API to winnt.h header and Threadpool-base-API. */
2456 
2457   WINBASEAPI HANDLE WINAPI CreatePrivateNamespaceA (LPSECURITY_ATTRIBUTES lpPrivateNamespaceAttributes, LPVOID lpBoundaryDescriptor, LPCSTR lpAliasPrefix);
2458   WINBASEAPI HANDLE WINAPI OpenPrivateNamespaceA (LPVOID lpBoundaryDescriptor, LPCSTR lpAliasPrefix);
2459   WINBASEAPI HANDLE APIENTRY CreateBoundaryDescriptorA (LPCSTR Name, ULONG Flags);
2460   WINBASEAPI WINBOOL WINAPI AddIntegrityLabelToBoundaryDescriptor (HANDLE *BoundaryDescriptor, PSID IntegrityLabel);
2461 
2462 #ifndef UNICODE
2463 #define CreatePrivateNamespace __MINGW_NAME_AW(CreatePrivateNamespace)
2464 #endif
2465 #define OpenPrivateNamespace __MINGW_NAME_AW(OpenPrivateNamespace)
2466 #ifndef UNICODE
2467 #define CreateBoundaryDescriptor __MINGW_NAME_AW(CreateBoundaryDescriptor)
2468 #endif
2469 
2470 #endif
2471 
2472 #define HW_PROFILE_GUIDLEN 39
2473 #define MAX_PROFILE_LEN 80
2474 
2475 #define DOCKINFO_UNDOCKED (0x1)
2476 #define DOCKINFO_DOCKED (0x2)
2477 #define DOCKINFO_USER_SUPPLIED (0x4)
2478 #define DOCKINFO_USER_UNDOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED)
2479 #define DOCKINFO_USER_DOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED)
2480 
2481   typedef struct tagHW_PROFILE_INFOA {
2482     DWORD dwDockInfo;
2483     CHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
2484     CHAR szHwProfileName[MAX_PROFILE_LEN];
2485   } HW_PROFILE_INFOA,*LPHW_PROFILE_INFOA;
2486 
2487   typedef struct tagHW_PROFILE_INFOW {
2488     DWORD dwDockInfo;
2489     WCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
2490     WCHAR szHwProfileName[MAX_PROFILE_LEN];
2491   } HW_PROFILE_INFOW,*LPHW_PROFILE_INFOW;
2492 
2493   __MINGW_TYPEDEF_AW(HW_PROFILE_INFO)
2494   __MINGW_TYPEDEF_AW(LPHW_PROFILE_INFO)
2495 
2496   WINADVAPI WINBOOL WINAPI GetCurrentHwProfileA (LPHW_PROFILE_INFOA lpHwProfileInfo);
2497   WINADVAPI WINBOOL WINAPI GetCurrentHwProfileW (LPHW_PROFILE_INFOW lpHwProfileInfo);
2498   WINBASEAPI WINBOOL WINAPI VerifyVersionInfoA (LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwTypeMask, DWORDLONG dwlConditionMask);
2499   WINBASEAPI WINBOOL WINAPI VerifyVersionInfoW (LPOSVERSIONINFOEXW lpVersionInformation, DWORD dwTypeMask, DWORDLONG dwlConditionMask);
2500 
2501 #define GetCurrentHwProfile __MINGW_NAME_AW(GetCurrentHwProfile)
2502 
2503 #define VerifyVersionInfo __MINGW_NAME_AW(VerifyVersionInfo)
2504 #endif
2505 
2506 #include <winerror.h>
2507 #include <timezoneapi.h>
2508 
2509 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2510 
2511 #define TC_NORMAL 0
2512 #define TC_HARDERR 1
2513 #define TC_GP_TRAP 2
2514 #define TC_SIGNAL 3
2515 
2516 #define AC_LINE_OFFLINE 0x00
2517 #define AC_LINE_ONLINE 0x01
2518 #define AC_LINE_BACKUP_POWER 0x02
2519 #define AC_LINE_UNKNOWN 0xff
2520 
2521 #define BATTERY_FLAG_HIGH 0x01
2522 #define BATTERY_FLAG_LOW 0x02
2523 #define BATTERY_FLAG_CRITICAL 0x04
2524 #define BATTERY_FLAG_CHARGING 0x08
2525 #define BATTERY_FLAG_NO_BATTERY 0x80
2526 #define BATTERY_FLAG_UNKNOWN 0xff
2527 
2528 #define BATTERY_PERCENTAGE_UNKNOWN 0xff
2529 
2530 #define BATTERY_LIFE_UNKNOWN 0xffffffff
2531 
2532   typedef struct _SYSTEM_POWER_STATUS {
2533     BYTE ACLineStatus;
2534     BYTE BatteryFlag;
2535     BYTE BatteryLifePercent;
2536     BYTE Reserved1;
2537     DWORD BatteryLifeTime;
2538     DWORD BatteryFullLifeTime;
2539   } SYSTEM_POWER_STATUS,*LPSYSTEM_POWER_STATUS;
2540 
2541   WINBASEAPI WINBOOL WINAPI GetSystemPowerStatus (LPSYSTEM_POWER_STATUS lpSystemPowerStatus);
2542   WINBASEAPI WINBOOL WINAPI SetSystemPowerState (WINBOOL fSuspend, WINBOOL fForce);
2543 
2544 #if _WIN32_WINNT >= 0x0602
2545   typedef VOID WINAPI BAD_MEMORY_CALLBACK_ROUTINE (VOID);
2546   typedef BAD_MEMORY_CALLBACK_ROUTINE *PBAD_MEMORY_CALLBACK_ROUTINE;
2547 
2548   WINBASEAPI PVOID WINAPI RegisterBadMemoryNotification (PBAD_MEMORY_CALLBACK_ROUTINE Callback);
2549   WINBASEAPI WINBOOL WINAPI UnregisterBadMemoryNotification (PVOID RegistrationHandle);
2550   WINBASEAPI WINBOOL WINAPI GetMemoryErrorHandlingCapabilities (PULONG Capabilities);
2551 
2552 #define MEHC_PATROL_SCRUBBER_PRESENT 0x1
2553 
2554 #endif
2555 
2556   WINBASEAPI WINBOOL WINAPI AllocateUserPhysicalPages (HANDLE hProcess, PULONG_PTR NumberOfPages, PULONG_PTR PageArray);
2557   WINBASEAPI WINBOOL WINAPI FreeUserPhysicalPages (HANDLE hProcess, PULONG_PTR NumberOfPages, PULONG_PTR PageArray);
2558   WINBASEAPI WINBOOL WINAPI MapUserPhysicalPages (PVOID VirtualAddress, ULONG_PTR NumberOfPages, PULONG_PTR PageArray);
2559   WINBASEAPI WINBOOL WINAPI MapUserPhysicalPagesScatter (PVOID *VirtualAddresses, ULONG_PTR NumberOfPages, PULONG_PTR PageArray);
2560   WINBASEAPI HANDLE WINAPI CreateJobObjectA (LPSECURITY_ATTRIBUTES lpJobAttributes, LPCSTR lpName);
2561   WINBASEAPI HANDLE WINAPI CreateJobObjectW (LPSECURITY_ATTRIBUTES lpJobAttributes, LPCWSTR lpName);
2562   WINBASEAPI HANDLE WINAPI OpenJobObjectA (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCSTR lpName);
2563   WINBASEAPI HANDLE WINAPI OpenJobObjectW (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCWSTR lpName);
2564   WINBASEAPI WINBOOL WINAPI AssignProcessToJobObject (HANDLE hJob, HANDLE hProcess);
2565   WINBASEAPI WINBOOL WINAPI TerminateJobObject (HANDLE hJob, UINT uExitCode);
2566   WINBASEAPI WINBOOL WINAPI QueryInformationJobObject (HANDLE hJob, JOBOBJECTINFOCLASS JobObjectInformationClass, LPVOID lpJobObjectInformation, DWORD cbJobObjectInformationLength, LPDWORD lpReturnLength);
2567   WINBASEAPI WINBOOL WINAPI SetInformationJobObject (HANDLE hJob, JOBOBJECTINFOCLASS JobObjectInformationClass, LPVOID lpJobObjectInformation, DWORD cbJobObjectInformationLength);
2568   WINBASEAPI WINBOOL WINAPI CreateJobSet (ULONG NumJob, PJOB_SET_ARRAY UserJobSet, ULONG Flags);
2569   WINBASEAPI HANDLE WINAPI FindFirstVolumeA (LPSTR lpszVolumeName, DWORD cchBufferLength);
2570   WINBASEAPI WINBOOL WINAPI FindNextVolumeA (HANDLE hFindVolume, LPSTR lpszVolumeName, DWORD cchBufferLength);
2571   WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointA (LPCSTR lpszRootPathName, LPSTR lpszVolumeMountPoint, DWORD cchBufferLength);
2572   WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointW (LPCWSTR lpszRootPathName, LPWSTR lpszVolumeMountPoint, DWORD cchBufferLength);
2573   WINBASEAPI WINBOOL WINAPI FindNextVolumeMountPointA (HANDLE hFindVolumeMountPoint, LPSTR lpszVolumeMountPoint, DWORD cchBufferLength);
2574   WINBASEAPI WINBOOL WINAPI FindNextVolumeMountPointW (HANDLE hFindVolumeMountPoint, LPWSTR lpszVolumeMountPoint, DWORD cchBufferLength);
2575   WINBASEAPI WINBOOL WINAPI FindVolumeMountPointClose (HANDLE hFindVolumeMountPoint);
2576   WINBASEAPI WINBOOL WINAPI SetVolumeMountPointA (LPCSTR lpszVolumeMountPoint, LPCSTR lpszVolumeName);
2577   WINBASEAPI WINBOOL WINAPI SetVolumeMountPointW (LPCWSTR lpszVolumeMountPoint, LPCWSTR lpszVolumeName);
2578   WINBASEAPI WINBOOL WINAPI DeleteVolumeMountPointA (LPCSTR lpszVolumeMountPoint);
2579   WINBASEAPI WINBOOL WINAPI GetVolumeNameForVolumeMountPointA (LPCSTR lpszVolumeMountPoint, LPSTR lpszVolumeName, DWORD cchBufferLength);
2580   WINBASEAPI WINBOOL WINAPI GetVolumePathNameA (LPCSTR lpszFileName, LPSTR lpszVolumePathName, DWORD cchBufferLength);
2581   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameA (LPCSTR lpszVolumeName, LPCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD lpcchReturnLength);
2582 #if _WIN32_WINNT >= 0x0600
2583   WINBASEAPI WINBOOL WINAPI AllocateUserPhysicalPagesNuma (HANDLE hProcess, PULONG_PTR NumberOfPages, PULONG_PTR PageArray, DWORD nndPreferred);
2584 #endif
2585 
2586 #ifndef UNICODE
2587 #define FindFirstVolume FindFirstVolumeA
2588 #define FindNextVolume FindNextVolumeA
2589 #define DeleteVolumeMountPoint DeleteVolumeMountPointA
2590 #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointA
2591 #define GetVolumePathName GetVolumePathNameA
2592 #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameA
2593 #endif
2594 
2595 #define CreateJobObject __MINGW_NAME_AW(CreateJobObject)
2596 #define OpenJobObject __MINGW_NAME_AW(OpenJobObject)
2597 #define FindFirstVolumeMountPoint __MINGW_NAME_AW(FindFirstVolumeMountPoint)
2598 #define FindNextVolumeMountPoint __MINGW_NAME_AW(FindNextVolumeMountPoint)
2599 #define SetVolumeMountPoint __MINGW_NAME_AW(SetVolumeMountPoint)
2600 
2601 #define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID (0x00000001)
2602 #define ACTCTX_FLAG_LANGID_VALID (0x00000002)
2603 #define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID (0x00000004)
2604 #define ACTCTX_FLAG_RESOURCE_NAME_VALID (0x00000008)
2605 #define ACTCTX_FLAG_SET_PROCESS_DEFAULT (0x00000010)
2606 #define ACTCTX_FLAG_APPLICATION_NAME_VALID (0x00000020)
2607 #define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF (0x00000040)
2608 #define ACTCTX_FLAG_HMODULE_VALID (0x00000080)
2609 
2610   typedef struct tagACTCTXA {
2611     ULONG cbSize;
2612     DWORD dwFlags;
2613     LPCSTR lpSource;
2614     USHORT wProcessorArchitecture;
2615     LANGID wLangId;
2616     LPCSTR lpAssemblyDirectory;
2617     LPCSTR lpResourceName;
2618     LPCSTR lpApplicationName;
2619     HMODULE hModule;
2620   } ACTCTXA,*PACTCTXA;
2621 
2622   typedef struct tagACTCTXW {
2623     ULONG cbSize;
2624     DWORD dwFlags;
2625     LPCWSTR lpSource;
2626     USHORT wProcessorArchitecture;
2627     LANGID wLangId;
2628     LPCWSTR lpAssemblyDirectory;
2629     LPCWSTR lpResourceName;
2630     LPCWSTR lpApplicationName;
2631     HMODULE hModule;
2632   } ACTCTXW,*PACTCTXW;
2633 
2634   __MINGW_TYPEDEF_AW(ACTCTX)
2635   __MINGW_TYPEDEF_AW(PACTCTX)
2636 
2637   typedef const ACTCTXA *PCACTCTXA;
2638   typedef const ACTCTXW *PCACTCTXW;
2639 
2640   __MINGW_TYPEDEF_AW(PCACTCTX)
2641 
2642   WINBASEAPI HANDLE WINAPI CreateActCtxA (PCACTCTXA pActCtx);
2643   WINBASEAPI HANDLE WINAPI CreateActCtxW (PCACTCTXW pActCtx);
2644   WINBASEAPI VOID WINAPI AddRefActCtx (HANDLE hActCtx);
2645   WINBASEAPI VOID WINAPI ReleaseActCtx (HANDLE hActCtx);
2646   WINBASEAPI WINBOOL WINAPI ZombifyActCtx (HANDLE hActCtx);
2647   WINBASEAPI WINBOOL WINAPI ActivateActCtx (HANDLE hActCtx, ULONG_PTR *lpCookie);
2648   WINBASEAPI WINBOOL WINAPI DeactivateActCtx (DWORD dwFlags, ULONG_PTR ulCookie);
2649   WINBASEAPI WINBOOL WINAPI GetCurrentActCtx (HANDLE *lphActCtx);
2650 
2651 #define CreateActCtx __MINGW_NAME_AW(CreateActCtx)
2652 #define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x00000001)
2653 
2654   typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
2655     ULONG cbSize;
2656     ULONG ulDataFormatVersion;
2657     PVOID lpData;
2658     ULONG ulLength;
2659     PVOID lpSectionGlobalData;
2660     ULONG ulSectionGlobalDataLength;
2661     PVOID lpSectionBase;
2662     ULONG ulSectionTotalLength;
2663     HANDLE hActCtx;
2664     ULONG ulAssemblyRosterIndex;
2665   } ACTCTX_SECTION_KEYED_DATA_2600,*PACTCTX_SECTION_KEYED_DATA_2600;
2666 
2667   typedef const ACTCTX_SECTION_KEYED_DATA_2600 *PCACTCTX_SECTION_KEYED_DATA_2600;
2668 
2669   typedef struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA {
2670     PVOID lpInformation;
2671     PVOID lpSectionBase;
2672     ULONG ulSectionLength;
2673     PVOID lpSectionGlobalDataBase;
2674     ULONG ulSectionGlobalDataLength;
2675   } ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA,*PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
2676 
2677   typedef const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA *PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
2678 
2679   typedef struct tagACTCTX_SECTION_KEYED_DATA {
2680     ULONG cbSize;
2681     ULONG ulDataFormatVersion;
2682     PVOID lpData;
2683     ULONG ulLength;
2684     PVOID lpSectionGlobalData;
2685     ULONG ulSectionGlobalDataLength;
2686     PVOID lpSectionBase;
2687     ULONG ulSectionTotalLength;
2688     HANDLE hActCtx;
2689     ULONG ulAssemblyRosterIndex;
2690     ULONG ulFlags;
2691     ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
2692   } ACTCTX_SECTION_KEYED_DATA,*PACTCTX_SECTION_KEYED_DATA;
2693 
2694   typedef const ACTCTX_SECTION_KEYED_DATA *PCACTCTX_SECTION_KEYED_DATA;
2695 
2696 #define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX (0x00000001)
2697 #define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS (0x00000002)
2698 #define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA (0x00000004)
2699 
2700   WINBASEAPI WINBOOL WINAPI FindActCtxSectionStringA (DWORD dwFlags, const GUID *lpExtensionGuid, ULONG ulSectionId, LPCSTR lpStringToFind, PACTCTX_SECTION_KEYED_DATA ReturnedData);
2701   WINBASEAPI WINBOOL WINAPI FindActCtxSectionStringW (DWORD dwFlags, const GUID *lpExtensionGuid, ULONG ulSectionId, LPCWSTR lpStringToFind, PACTCTX_SECTION_KEYED_DATA ReturnedData);
2702   WINBASEAPI WINBOOL WINAPI FindActCtxSectionGuid (DWORD dwFlags, const GUID *lpExtensionGuid, ULONG ulSectionId, const GUID *lpGuidToFind, PACTCTX_SECTION_KEYED_DATA ReturnedData);
2703 
2704 #define FindActCtxSectionString __MINGW_NAME_AW(FindActCtxSectionString)
2705 
2706 #if !defined (RC_INVOKED) && !defined (ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
2707   typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
2708     HANDLE hActCtx;
2709     DWORD dwFlags;
2710   } ACTIVATION_CONTEXT_BASIC_INFORMATION,*PACTIVATION_CONTEXT_BASIC_INFORMATION;
2711 
2712   typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT_BASIC_INFORMATION;
2713 
2714 #define ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED 1
2715 #endif
2716 
2717 #define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX (0x00000004)
2718 #define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE (0x00000008)
2719 #define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS (0x00000010)
2720 #define QUERY_ACTCTX_FLAG_NO_ADDREF (0x80000000)
2721 
2722   WINBASEAPI WINBOOL WINAPI QueryActCtxW (DWORD dwFlags, HANDLE hActCtx, PVOID pvSubInstance, ULONG ulInfoClass, PVOID pvBuffer, SIZE_T cbBuffer, SIZE_T *pcbWrittenOrRequired);
2723 
2724   typedef WINBOOL (WINAPI *PQUERYACTCTXW_FUNC) (DWORD dwFlags, HANDLE hActCtx, PVOID pvSubInstance, ULONG ulInfoClass, PVOID pvBuffer, SIZE_T cbBuffer, SIZE_T *pcbWrittenOrRequired);
2725 
2726   WINBASEAPI DWORD WINAPI WTSGetActiveConsoleSessionId (VOID);
2727   WINBASEAPI WINBOOL WINAPI GetNumaProcessorNode (UCHAR Processor, PUCHAR NodeNumber);
2728   WINBASEAPI WINBOOL WINAPI GetNumaNodeProcessorMask (UCHAR Node, PULONGLONG ProcessorMask);
2729   WINBASEAPI WINBOOL WINAPI GetNumaAvailableMemoryNode (UCHAR Node, PULONGLONG AvailableBytes);
2730 #if _WIN32_WINNT >= 0x0600
2731   WINBASEAPI WINBOOL WINAPI GetNumaProximityNode (ULONG ProximityId, PUCHAR NodeNumber);
2732 #endif
2733 #if _WIN32_WINNT >= 0x0601
2734   WINBASEAPI WORD WINAPI GetActiveProcessorGroupCount (VOID);
2735   WINBASEAPI WORD WINAPI GetMaximumProcessorGroupCount (VOID);
2736   WINBASEAPI DWORD WINAPI GetActiveProcessorCount (WORD GroupNumber);
2737   WINBASEAPI DWORD WINAPI GetMaximumProcessorCount (WORD GroupNumber);
2738   WINBASEAPI WINBOOL WINAPI GetNumaNodeNumberFromHandle (HANDLE hFile, PUSHORT NodeNumber);
2739   WINBASEAPI WINBOOL WINAPI GetNumaProcessorNodeEx (PPROCESSOR_NUMBER Processor, PUSHORT NodeNumber);
2740   WINBASEAPI WINBOOL WINAPI GetNumaAvailableMemoryNodeEx (USHORT Node, PULONGLONG AvailableBytes);
2741   WINBASEAPI WINBOOL WINAPI GetNumaProximityNodeEx (ULONG ProximityId, PUSHORT NodeNumber);
2742 #endif
2743 
2744   typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK) (PVOID pvParameter);
2745 
2746 #define RESTART_MAX_CMD_LINE 1024
2747 
2748 #define RESTART_NO_CRASH 1
2749 #define RESTART_NO_HANG 2
2750 #define RESTART_NO_PATCH 4
2751 #define RESTART_NO_REBOOT 8
2752 
2753 #define RECOVERY_DEFAULT_PING_INTERVAL 5000
2754 #define RECOVERY_MAX_PING_INTERVAL (5 *60 *1000)
2755 
2756 #if _WIN32_WINNT >= 0x0600
2757   WINBASEAPI HRESULT WINAPI RegisterApplicationRecoveryCallback (APPLICATION_RECOVERY_CALLBACK pRecoveyCallback, PVOID pvParameter, DWORD dwPingInterval, DWORD dwFlags);
2758   WINBASEAPI HRESULT WINAPI UnregisterApplicationRecoveryCallback (void);
2759   WINBASEAPI HRESULT WINAPI RegisterApplicationRestart (PCWSTR pwzCommandline, DWORD dwFlags);
2760   WINBASEAPI HRESULT WINAPI UnregisterApplicationRestart (void);
2761   WINBASEAPI HRESULT WINAPI GetApplicationRecoveryCallback (HANDLE hProcess, APPLICATION_RECOVERY_CALLBACK *pRecoveryCallback, PVOID *ppvParameter, PDWORD pdwPingInterval, PDWORD pdwFlags);
2762   WINBASEAPI HRESULT WINAPI GetApplicationRestartSettings (HANDLE hProcess, PWSTR pwzCommandline, PDWORD pcchSize, PDWORD pdwFlags);
2763   WINBASEAPI HRESULT WINAPI ApplicationRecoveryInProgress (PBOOL pbCancelled);
2764   WINBASEAPI VOID WINAPI ApplicationRecoveryFinished (WINBOOL bSuccess);
2765 #endif
2766 #endif
2767 
2768 #if _WIN32_WINNT >= 0x0600
2769 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
2770   typedef struct _FILE_BASIC_INFO {
2771     LARGE_INTEGER CreationTime;
2772     LARGE_INTEGER LastAccessTime;
2773     LARGE_INTEGER LastWriteTime;
2774     LARGE_INTEGER ChangeTime;
2775     DWORD FileAttributes;
2776   } FILE_BASIC_INFO,*PFILE_BASIC_INFO;
2777 
2778   typedef struct _FILE_STANDARD_INFO {
2779     LARGE_INTEGER AllocationSize;
2780     LARGE_INTEGER EndOfFile;
2781     DWORD NumberOfLinks;
2782     BOOLEAN DeletePending;
2783     BOOLEAN Directory;
2784   } FILE_STANDARD_INFO,*PFILE_STANDARD_INFO;
2785 
2786   typedef struct _FILE_NAME_INFO {
2787     DWORD FileNameLength;
2788     WCHAR FileName[1];
2789   } FILE_NAME_INFO,*PFILE_NAME_INFO;
2790 
2791   typedef struct _FILE_RENAME_INFO {
2792     BOOLEAN ReplaceIfExists;
2793     HANDLE RootDirectory;
2794     DWORD FileNameLength;
2795     WCHAR FileName[1];
2796   } FILE_RENAME_INFO,*PFILE_RENAME_INFO;
2797 
2798   typedef struct _FILE_ALLOCATION_INFO {
2799     LARGE_INTEGER AllocationSize;
2800   } FILE_ALLOCATION_INFO,*PFILE_ALLOCATION_INFO;
2801 
2802   typedef struct _FILE_END_OF_FILE_INFO {
2803     LARGE_INTEGER EndOfFile;
2804   } FILE_END_OF_FILE_INFO,*PFILE_END_OF_FILE_INFO;
2805 
2806   typedef struct _FILE_STREAM_INFO {
2807     DWORD NextEntryOffset;
2808     DWORD StreamNameLength;
2809     LARGE_INTEGER StreamSize;
2810     LARGE_INTEGER StreamAllocationSize;
2811     WCHAR StreamName[1];
2812   } FILE_STREAM_INFO,*PFILE_STREAM_INFO;
2813 
2814   typedef struct _FILE_COMPRESSION_INFO {
2815     LARGE_INTEGER CompressedFileSize;
2816     WORD CompressionFormat;
2817     UCHAR CompressionUnitShift;
2818     UCHAR ChunkShift;
2819     UCHAR ClusterShift;
2820     UCHAR Reserved[3];
2821   } FILE_COMPRESSION_INFO,*PFILE_COMPRESSION_INFO;
2822 
2823   typedef struct _FILE_ATTRIBUTE_TAG_INFO {
2824     DWORD FileAttributes;
2825     DWORD ReparseTag;
2826   } FILE_ATTRIBUTE_TAG_INFO,*PFILE_ATTRIBUTE_TAG_INFO;
2827 
2828   typedef struct _FILE_DISPOSITION_INFO {
2829     BOOLEAN DeleteFile;
2830   } FILE_DISPOSITION_INFO,*PFILE_DISPOSITION_INFO;
2831 
2832   typedef struct _FILE_ID_BOTH_DIR_INFO {
2833     DWORD NextEntryOffset;
2834     DWORD FileIndex;
2835     LARGE_INTEGER CreationTime;
2836     LARGE_INTEGER LastAccessTime;
2837     LARGE_INTEGER LastWriteTime;
2838     LARGE_INTEGER ChangeTime;
2839     LARGE_INTEGER EndOfFile;
2840     LARGE_INTEGER AllocationSize;
2841     DWORD FileAttributes;
2842     DWORD FileNameLength;
2843     DWORD EaSize;
2844     CCHAR ShortNameLength;
2845     WCHAR ShortName[12];
2846     LARGE_INTEGER FileId;
2847     WCHAR FileName[1];
2848   } FILE_ID_BOTH_DIR_INFO,*PFILE_ID_BOTH_DIR_INFO;
2849 
2850   typedef struct _FILE_FULL_DIR_INFO {
2851     ULONG NextEntryOffset;
2852     ULONG FileIndex;
2853     LARGE_INTEGER CreationTime;
2854     LARGE_INTEGER LastAccessTime;
2855     LARGE_INTEGER LastWriteTime;
2856     LARGE_INTEGER ChangeTime;
2857     LARGE_INTEGER EndOfFile;
2858     LARGE_INTEGER AllocationSize;
2859     ULONG FileAttributes;
2860     ULONG FileNameLength;
2861     ULONG EaSize;
2862     WCHAR FileName[1];
2863   } FILE_FULL_DIR_INFO,*PFILE_FULL_DIR_INFO;
2864 
2865   typedef enum _PRIORITY_HINT {
2866     IoPriorityHintVeryLow = 0,
2867     IoPriorityHintLow,
2868     IoPriorityHintNormal,
2869     MaximumIoPriorityHintType
2870   } PRIORITY_HINT;
2871 
2872   typedef struct _FILE_IO_PRIORITY_HINT_INFO {
2873     PRIORITY_HINT PriorityHint;
2874   } FILE_IO_PRIORITY_HINT_INFO,*PFILE_IO_PRIORITY_HINT_INFO;
2875 #if _WIN32_WINNT >= 0x0602
2876   typedef struct _FILE_ALIGNMENT_INFO {
2877     ULONG AlignmentRequirement;
2878   } FILE_ALIGNMENT_INFO,*PFILE_ALIGNMENT_INFO;
2879 
2880 #define STORAGE_INFO_FLAGS_ALIGNED_DEVICE 0x00000001
2881 #define STORAGE_INFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002
2882 
2883 #define STORAGE_INFO_OFFSET_UNKNOWN (0xffffffff)
2884 
2885   typedef struct _FILE_STORAGE_INFO {
2886     ULONG LogicalBytesPerSector;
2887     ULONG PhysicalBytesPerSectorForAtomicity;
2888     ULONG PhysicalBytesPerSectorForPerformance;
2889     ULONG FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
2890     ULONG Flags;
2891     ULONG ByteOffsetForSectorAlignment;
2892     ULONG ByteOffsetForPartitionAlignment;
2893   } FILE_STORAGE_INFO,*PFILE_STORAGE_INFO;
2894 
2895   typedef struct _FILE_ID_INFO {
2896     ULONGLONG VolumeSerialNumber;
2897     FILE_ID_128 FileId;
2898   } FILE_ID_INFO,*PFILE_ID_INFO;
2899 
2900   typedef struct _FILE_ID_EXTD_DIR_INFO {
2901     ULONG NextEntryOffset;
2902     ULONG FileIndex;
2903     LARGE_INTEGER CreationTime;
2904     LARGE_INTEGER LastAccessTime;
2905     LARGE_INTEGER LastWriteTime;
2906     LARGE_INTEGER ChangeTime;
2907     LARGE_INTEGER EndOfFile;
2908     LARGE_INTEGER AllocationSize;
2909     ULONG FileAttributes;
2910     ULONG FileNameLength;
2911     ULONG EaSize;
2912     ULONG ReparsePointTag;
2913     FILE_ID_128 FileId;
2914     WCHAR FileName[1];
2915   } FILE_ID_EXTD_DIR_INFO,*PFILE_ID_EXTD_DIR_INFO;
2916 #endif
2917 
2918 #define REMOTE_PROTOCOL_INFO_FLAG_LOOPBACK 0x00000001
2919 #define REMOTE_PROTOCOL_INFO_FLAG_OFFLINE 0x00000002
2920 
2921 #if _WIN32_WINNT >= 0x0602
2922 #define REMOTE_PROTOCOL_INFO_FLAG_PERSISTENT_HANDLE 0x00000004
2923 
2924 #define RPI_FLAG_SMB2_SHARECAP_TIMEWARP 0x00000002
2925 #define RPI_FLAG_SMB2_SHARECAP_DFS 0x00000008
2926 #define RPI_FLAG_SMB2_SHARECAP_CONTINUOUS_AVAILABILITY 0x00000010
2927 #define RPI_FLAG_SMB2_SHARECAP_SCALEOUT 0x00000020
2928 #define RPI_FLAG_SMB2_SHARECAP_CLUSTER 0x00000040
2929 
2930 #define RPI_SMB2_FLAG_SERVERCAP_DFS 0x00000001
2931 #define RPI_SMB2_FLAG_SERVERCAP_LEASING 0x00000002
2932 #define RPI_SMB2_FLAG_SERVERCAP_LARGEMTU 0x00000004
2933 #define RPI_SMB2_FLAG_SERVERCAP_MULTICHANNEL 0x00000008
2934 #define RPI_SMB2_FLAG_SERVERCAP_PERSISTENT_HANDLES 0x00000010
2935 #define RPI_SMB2_FLAG_SERVERCAP_DIRECTORY_LEASING 0x00000020
2936 #endif
2937 
2938   typedef struct _FILE_REMOTE_PROTOCOL_INFO {
2939     USHORT StructureVersion;
2940     USHORT StructureSize;
2941     ULONG Protocol;
2942     USHORT ProtocolMajorVersion;
2943     USHORT ProtocolMinorVersion;
2944     USHORT ProtocolRevision;
2945     USHORT Reserved;
2946     ULONG Flags;
2947     struct {
2948       ULONG Reserved[8];
2949     } GenericReserved;
2950 #if _WIN32_WINNT < 0x0602
2951     struct {
2952       ULONG Reserved[16];
2953     } ProtocolSpecificReserved;
2954 #else
2955     union {
2956       struct {
2957     struct {
2958       ULONG Capabilities;
2959     } Server;
2960     struct {
2961       ULONG Capabilities;
2962       ULONG CachingFlags;
2963     } Share;
2964       } Smb2;
2965       ULONG Reserved[16];
2966     } ProtocolSpecific;
2967 #endif
2968   } FILE_REMOTE_PROTOCOL_INFO,*PFILE_REMOTE_PROTOCOL_INFO;
2969 
2970   WINBASEAPI WINBOOL WINAPI GetFileInformationByHandleEx (HANDLE hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, LPVOID lpFileInformation, DWORD dwBufferSize);
2971 #endif
2972 
2973 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2974   typedef enum _FILE_ID_TYPE {
2975     FileIdType,
2976     ObjectIdType,
2977     ExtendedFileIdType,
2978     MaximumFileIdType
2979   } FILE_ID_TYPE,*PFILE_ID_TYPE;
2980 
2981   typedef struct FILE_ID_DESCRIPTOR {
2982     DWORD dwSize;
2983     FILE_ID_TYPE Type;
2984     __C89_NAMELESS union {
2985       LARGE_INTEGER FileId;
2986       GUID ObjectId;
2987 #if _WIN32_WINNT >= 0x0602
2988       FILE_ID_128 ExtendedFileId;
2989 #endif
2990     } DUMMYUNIONNAME;
2991   } FILE_ID_DESCRIPTOR,*LPFILE_ID_DESCRIPTOR;
2992 
2993   WINBASEAPI HANDLE WINAPI OpenFileById (HANDLE hVolumeHint, LPFILE_ID_DESCRIPTOR lpFileId, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwFlagsAndAttributes);
2994 #endif
2995 #endif
2996 
2997 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
2998 #if _WIN32_WINNT >= 0x0600
2999 
3000 #define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1)
3001 #define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2)
3002 
3003 #define VALID_SYMBOLIC_LINK_FLAGS SYMBOLIC_LINK_FLAG_DIRECTORY
3004 
3005   WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkA (LPCSTR lpSymlinkFileName, LPCSTR lpTargetFileName, DWORD dwFlags);
3006   WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkW (LPCWSTR lpSymlinkFileName, LPCWSTR lpTargetFileName, DWORD dwFlags);
3007   WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkTransactedA (LPCSTR lpSymlinkFileName, LPCSTR lpTargetFileName, DWORD dwFlags, HANDLE hTransaction);
3008   WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkTransactedW (LPCWSTR lpSymlinkFileName, LPCWSTR lpTargetFileName, DWORD dwFlags, HANDLE hTransaction);
3009   WINBASEAPI WINBOOL WINAPI QueryActCtxSettingsW (DWORD dwFlags, HANDLE hActCtx, PCWSTR settingsNameSpace, PCWSTR settingName, PWSTR pvBuffer, SIZE_T dwBuffer, SIZE_T *pdwWrittenOrRequired);
3010   WINBASEAPI WINBOOL WINAPI ReplacePartitionUnit (PWSTR TargetPartition, PWSTR SparePartition, ULONG Flags);
3011   WINBASEAPI WINBOOL WINAPI AddSecureMemoryCacheCallback (PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack);
3012   WINBASEAPI WINBOOL WINAPI RemoveSecureMemoryCacheCallback (PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack);
3013 
3014 #define CreateSymbolicLink __MINGW_NAME_AW(CreateSymbolicLink)
3015 #define CreateSymbolicLinkTransacted __MINGW_NAME_AW(CreateSymbolicLinkTransacted)
3016 
3017 #endif
3018 #endif
3019 
3020 #if NTDDI_VERSION >= NTDDI_WIN7SP1
3021 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
3022   WINBASEAPI WINBOOL WINAPI CopyContext (PCONTEXT Destination, DWORD ContextFlags, PCONTEXT Source);
3023 #endif
3024 
3025 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
3026   WINBASEAPI WINBOOL WINAPI InitializeContext (PVOID Buffer, DWORD ContextFlags, PCONTEXT *Context, PDWORD ContextLength);
3027 #if defined (__x86_64__) || defined (__i386__)
3028   WINBASEAPI DWORD64 WINAPI GetEnabledXStateFeatures (VOID);
3029   WINBASEAPI WINBOOL WINAPI GetXStateFeaturesMask (PCONTEXT Context, PDWORD64 FeatureMask);
3030   WINBASEAPI PVOID WINAPI LocateXStateFeature (PCONTEXT Context, DWORD FeatureId, PDWORD Length);
3031 #endif
3032 #endif
3033 
3034 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
3035 #if defined (__x86_64__) || defined (__i386__)
3036   WINBASEAPI WINBOOL WINAPI SetXStateFeaturesMask (PCONTEXT Context, DWORD64 FeatureMask);
3037 #endif
3038 #if _WIN32_WINNT >= 0x0601
3039   WINBASEAPI DWORD APIENTRY EnableThreadProfiling (HANDLE ThreadHandle, DWORD Flags, DWORD64 HardwareCounters, HANDLE *PerformanceDataHandle);
3040   WINBASEAPI DWORD APIENTRY DisableThreadProfiling (HANDLE PerformanceDataHandle);
3041   WINBASEAPI DWORD APIENTRY QueryThreadProfiling (HANDLE ThreadHandle, PBOOLEAN Enabled);
3042   WINBASEAPI DWORD APIENTRY ReadThreadProfilingData (HANDLE PerformanceDataHandle, DWORD Flags, PPERFORMANCE_DATA PerformanceData);
3043 #endif
3044 #endif
3045 #endif
3046 
3047 #ifdef __cplusplus
3048 }
3049 #endif
3050 #endif
3051 
3052 #if !defined (RC_INVOKED) && !defined (NOWINBASEINTERLOCK) && !defined (_NTOS_) && !defined (MICROSOFT_WINDOWS_WINBASE_INTERLOCKED_CPLUSPLUS_H_INCLUDED)
3053 #define MICROSOFT_WINDOWS_WINBASE_INTERLOCKED_CPLUSPLUS_H_INCLUDED
3054 #if !defined (__WIDL__)
3055 #if !defined (MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS)
3056 #define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS (_WIN32_WINNT >= 0x0502 || !defined (_WINBASE_))
3057 #endif
3058 #if MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS && defined (__cplusplus)
3059 extern "C++" {
3060 #if defined(__x86_64__) && defined(__CYGWIN__)
3061 #define __MINGW_USE_INT64_INTERLOCKED_LONG
3062 #endif
InterlockedIncrement(unsigned volatile * Addend)3063   FORCEINLINE unsigned InterlockedIncrement (unsigned volatile *Addend) {
3064     return (unsigned) InterlockedIncrement ((volatile __LONG32 *) Addend);
3065   }
3066 
InterlockedIncrement(unsigned long volatile * Addend)3067   FORCEINLINE unsigned long InterlockedIncrement (unsigned long volatile *Addend) {
3068 #ifndef __MINGW_USE_INT64_INTERLOCKED_LONG
3069     return (unsigned __LONG32) InterlockedIncrement ((volatile __LONG32 *) Addend);
3070 #else
3071     return (unsigned long) InterlockedIncrement64 ((volatile __int64 *) Addend);
3072 #endif
3073   }
3074 
3075 #if defined (_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined (_WINBASE_))
InterlockedIncrement(unsigned __int64 volatile * Addend)3076   FORCEINLINE unsigned __int64 InterlockedIncrement (unsigned __int64 volatile *Addend) {
3077     return (unsigned __int64) InterlockedIncrement64 ((volatile __int64 *) Addend);
3078   }
3079 #endif
3080 
InterlockedDecrement(unsigned volatile * Addend)3081   FORCEINLINE unsigned InterlockedDecrement (unsigned volatile *Addend) {
3082     return (unsigned) InterlockedDecrement ((volatile __LONG32 *) Addend);
3083   }
3084 
InterlockedDecrement(unsigned long volatile * Addend)3085   FORCEINLINE unsigned long InterlockedDecrement (unsigned long volatile *Addend) {
3086 #ifndef __MINGW_USE_INT64_INTERLOCKED_LONG
3087     return (unsigned __LONG32) InterlockedDecrement ((volatile __LONG32 *) Addend);
3088 #else
3089     return (unsigned long) InterlockedDecrement64 ((volatile __int64 *) Addend);
3090 #endif
3091   }
3092 
3093 #if defined (_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined (_WINBASE_))
InterlockedDecrement(unsigned __int64 volatile * Addend)3094   FORCEINLINE unsigned __int64 InterlockedDecrement (unsigned __int64 volatile *Addend) {
3095     return (unsigned __int64) InterlockedDecrement64 ((volatile __int64 *) Addend);
3096   }
3097 #endif
3098 
InterlockedExchange(unsigned volatile * Target,unsigned Value)3099   FORCEINLINE unsigned InterlockedExchange (unsigned volatile *Target, unsigned Value) {
3100     return (unsigned) InterlockedExchange ((volatile __LONG32 *) Target,(__LONG32) Value);
3101   }
3102 
InterlockedExchange(unsigned long volatile * Target,unsigned long Value)3103   FORCEINLINE unsigned long InterlockedExchange (unsigned long volatile *Target, unsigned long Value) {
3104 #ifndef __MINGW_USE_INT64_INTERLOCKED_LONG
3105     return (unsigned __LONG32) InterlockedExchange ((volatile __LONG32 *) Target,(__LONG32) Value);
3106 #else
3107     return (unsigned long) InterlockedExchange64 ((volatile __int64 *) Target,(__int64) Value);
3108 #endif
3109   }
3110 
3111 #if defined (_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined (_WINBASE_))
InterlockedExchange(unsigned __int64 volatile * Target,unsigned __int64 Value)3112   FORCEINLINE unsigned __int64 InterlockedExchange (unsigned __int64 volatile *Target, unsigned __int64 Value) {
3113     return (unsigned __int64) InterlockedExchange64 ((volatile __int64 *) Target,(__int64) Value);
3114   }
3115 #endif
3116 
InterlockedExchangeAdd(unsigned volatile * Addend,unsigned Value)3117   FORCEINLINE unsigned InterlockedExchangeAdd (unsigned volatile *Addend, unsigned Value) {
3118     return (unsigned) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,(__LONG32) Value);
3119   }
3120 
InterlockedExchangeSubtract(unsigned volatile * Addend,unsigned Value)3121   FORCEINLINE unsigned InterlockedExchangeSubtract (unsigned volatile *Addend, unsigned Value) {
3122     return (unsigned) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,- (__LONG32) Value);
3123   }
3124 
InterlockedExchangeAdd(unsigned long volatile * Addend,unsigned long Value)3125   FORCEINLINE unsigned long InterlockedExchangeAdd (unsigned long volatile *Addend, unsigned long Value) {
3126 #ifndef __MINGW_USE_INT64_INTERLOCKED_LONG
3127     return (unsigned __LONG32) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,(__LONG32) Value);
3128 #else
3129     return (unsigned __int64) InterlockedExchangeAdd64 ((volatile __int64 *) Addend,(__int64) Value);
3130 #endif
3131   }
3132 
InterlockedExchangeSubtract(unsigned long volatile * Addend,unsigned long Value)3133   FORCEINLINE unsigned long InterlockedExchangeSubtract (unsigned long volatile *Addend, unsigned long Value) {
3134 #ifndef __MINGW_USE_INT64_INTERLOCKED_LONG
3135     return (unsigned __LONG32) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,- (__LONG32) Value);
3136 #else
3137     return (unsigned long) InterlockedExchangeAdd64 ((volatile __int64 *) Addend,- (__int64) Value);
3138 #endif
3139   }
3140 
3141 #if defined (_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined (_WINBASE_))
InterlockedExchangeAdd(unsigned __int64 volatile * Addend,unsigned __int64 Value)3142   FORCEINLINE unsigned __int64 InterlockedExchangeAdd (unsigned __int64 volatile *Addend, unsigned __int64 Value) {
3143     return (unsigned __int64) InterlockedExchangeAdd64 ((volatile __int64 *) Addend,(__int64) Value);
3144   }
3145 
InterlockedExchangeSubtract(unsigned __int64 volatile * Addend,unsigned __int64 Value)3146   FORCEINLINE unsigned __int64 InterlockedExchangeSubtract (unsigned __int64 volatile *Addend, unsigned __int64 Value) {
3147     return (unsigned __int64) InterlockedExchangeAdd64 ((volatile __int64 *) Addend,- (__int64) Value);
3148   }
3149 #endif
3150 
InterlockedCompareExchange(unsigned volatile * Destination,unsigned Exchange,unsigned Comperand)3151   FORCEINLINE unsigned InterlockedCompareExchange (unsigned volatile *Destination, unsigned Exchange, unsigned Comperand) {
3152     return (unsigned) InterlockedCompareExchange ((volatile __LONG32 *) Destination,(__LONG32) Exchange,(__LONG32) Comperand);
3153   }
3154 
InterlockedCompareExchange(unsigned long volatile * Destination,unsigned long Exchange,unsigned long Comperand)3155   FORCEINLINE unsigned long InterlockedCompareExchange (unsigned long volatile *Destination, unsigned long Exchange, unsigned long Comperand) {
3156 #ifndef __MINGW_USE_INT64_INTERLOCKED_LONG
3157     return (unsigned __LONG32) InterlockedCompareExchange ((volatile __LONG32 *) Destination,(__LONG32) Exchange,(__LONG32) Comperand);
3158 #else
3159     return (unsigned long) InterlockedCompareExchange64 ((volatile __int64 *) Destination,(__int64) Exchange,(__int64) Comperand);
3160 #endif
3161   }
3162 
3163 #if defined (_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined (_WINBASE_))
InterlockedCompareExchange(unsigned __int64 volatile * Destination,unsigned __int64 Exchange,unsigned __int64 Comperand)3164   FORCEINLINE unsigned __int64 InterlockedCompareExchange (unsigned __int64 volatile *Destination, unsigned __int64 Exchange, unsigned __int64 Comperand) {
3165     return (unsigned __int64) InterlockedCompareExchange64 ((volatile __int64 *) Destination,(__int64) Exchange,(__int64) Comperand);
3166   }
3167 
InterlockedAnd(unsigned __int64 volatile * Destination,unsigned __int64 Value)3168   FORCEINLINE unsigned __int64 InterlockedAnd (unsigned __int64 volatile *Destination, unsigned __int64 Value) {
3169     return (unsigned __int64) InterlockedAnd64 ((volatile __int64 *) Destination,(__int64) Value);
3170   }
3171 
InterlockedOr(unsigned __int64 volatile * Destination,unsigned __int64 Value)3172   FORCEINLINE unsigned __int64 InterlockedOr (unsigned __int64 volatile *Destination, unsigned __int64 Value) {
3173     return (unsigned __int64) InterlockedOr64 ((volatile __int64 *) Destination,(__int64) Value);
3174   }
3175 
InterlockedXor(unsigned __int64 volatile * Destination,unsigned __int64 Value)3176   FORCEINLINE unsigned __int64 InterlockedXor (unsigned __int64 volatile *Destination, unsigned __int64 Value) {
3177     return (unsigned __int64) InterlockedXor64 ((volatile __int64 *) Destination,(__int64) Value);
3178   }
3179 #endif
3180 }
3181 #endif
3182 
3183 #undef MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS
3184 #define MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
3185 #endif
3186 #endif
3187