source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/winbase.h

Last change on this file was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

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