xref: /reactos/sdk/include/psdk/winbase.h (revision 9d3c3a75)
1 #ifndef _WINBASE_
2 #define _WINBASE_
3 
4 #if !defined(_KERNEL32_)
5 #define WINBASEAPI DECLSPEC_IMPORT
6 #else
7 #define WINBASEAPI
8 #endif
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include <libloaderapi.h>
15 
16 #ifdef _MSC_VER
17 #pragma warning(push)
18 #pragma warning(disable:4201)
19 #pragma warning(disable:4214)
20 #pragma warning(disable:4820)
21 #endif
22 
23 #define PROCESS_NAME_NATIVE      1
24 
25 #define FILE_ENCRYPTABLE         0
26 #define FILE_IS_ENCRYPTED        1
27 #define FILE_SYSTEM_ATTR         2
28 #define FILE_ROOT_DIR            3
29 #define FILE_SYSTEM_DIR          4
30 #define FILE_UNKNOWN             5
31 #define FILE_SYSTEM_NOT_SUPPORT  6
32 #define FILE_USER_DISALLOWED     7
33 #define FILE_READ_ONLY           8
34 #define FILE_DIR_DISALLOWED      9
35 
36 #define COMMPROP_INITIALIZED 0xE73CF52E
37 #define SP_SERIALCOMM 1
38 #define PST_UNSPECIFIED	0
39 #define PST_RS232	1
40 #define PST_PARALLELPORT	2
41 #define PST_RS422	3
42 #define PST_RS423	4
43 #define PST_RS449	5
44 #define PST_MODEM	6
45 #define PST_FAX	0x21
46 #define PST_SCANNER	0x22
47 #define PST_NETWORK_BRIDGE	0x100
48 #define PST_LAT	0x101
49 #define PST_TCPIP_TELNET	0x102
50 #define PST_X25	0x103
51 #define BAUD_075	1
52 #define BAUD_110	2
53 #define BAUD_134_5	4
54 #define BAUD_150	8
55 #define BAUD_300	16
56 #define BAUD_600	32
57 #define BAUD_1200	64
58 #define BAUD_1800	128
59 #define BAUD_2400	256
60 #define BAUD_4800	512
61 #define BAUD_7200	1024
62 #define BAUD_9600	2048
63 #define BAUD_14400	4096
64 #define BAUD_19200	8192
65 #define BAUD_38400	16384
66 #define BAUD_56K	32768
67 #define BAUD_128K	65536
68 #define BAUD_115200	131072
69 #define BAUD_57600	262144
70 #define BAUD_USER	0x10000000
71 #define PCF_DTRDSR	1
72 #define PCF_RTSCTS	2
73 #define PCF_RLSD	4
74 #define PCF_PARITY_CHECK	8
75 #define PCF_XONXOFF	16
76 #define PCF_SETXCHAR	32
77 #define PCF_TOTALTIMEOUTS	64
78 #define PCF_INTTIMEOUTS	128
79 #define PCF_SPECIALCHARS	256
80 #define PCF_16BITMODE	512
81 #define SP_PARITY	1
82 #define SP_BAUD	2
83 #define SP_DATABITS	4
84 #define SP_STOPBITS	8
85 #define SP_HANDSHAKING	16
86 #define SP_PARITY_CHECK	32
87 #define SP_RLSD	64
88 #define DATABITS_5	1
89 #define DATABITS_6	2
90 #define DATABITS_7	4
91 #define DATABITS_8	8
92 #define DATABITS_16	16
93 #define DATABITS_16X	32
94 #define STOPBITS_10	1
95 #define STOPBITS_15	2
96 #define STOPBITS_20	4
97 #define PARITY_NONE	256
98 #define PARITY_ODD	512
99 #define PARITY_EVEN	1024
100 #define PARITY_MARK	2048
101 #define PARITY_SPACE	4096
102 #define EXCEPTION_DEBUG_EVENT	1
103 #define CREATE_THREAD_DEBUG_EVENT	2
104 #define CREATE_PROCESS_DEBUG_EVENT	3
105 #define EXIT_THREAD_DEBUG_EVENT	4
106 #define EXIT_PROCESS_DEBUG_EVENT	5
107 #define LOAD_DLL_DEBUG_EVENT	6
108 #define UNLOAD_DLL_DEBUG_EVENT	7
109 #define OUTPUT_DEBUG_STRING_EVENT	8
110 #define RIP_EVENT	9
111 #define HFILE_ERROR ((HFILE)-1)
112 #define FILE_BEGIN	0
113 #define FILE_CURRENT	1
114 #define FILE_END	2
115 #define INVALID_SET_FILE_POINTER	((DWORD)-1)
116 #define OF_READ 0
117 #define OF_READWRITE	2
118 #define OF_WRITE	1
119 #define OF_SHARE_COMPAT	0
120 #define OF_SHARE_DENY_NONE	64
121 #define OF_SHARE_DENY_READ	48
122 #define OF_SHARE_DENY_WRITE	32
123 #define OF_SHARE_EXCLUSIVE	16
124 #define OF_CANCEL	2048
125 #define OF_CREATE	4096
126 #define OF_DELETE	512
127 #define OF_EXIST	16384
128 #define OF_PARSE	256
129 #define OF_PROMPT	8192
130 #define OF_REOPEN	32768
131 #define OF_VERIFY	1024
132 #define NMPWAIT_NOWAIT	1
133 #define NMPWAIT_WAIT_FOREVER	((DWORD)-1)
134 #define NMPWAIT_USE_DEFAULT_WAIT	0
135 #define CE_BREAK	16
136 #define CE_DNS	2048
137 #define CE_FRAME	8
138 #define CE_IOE	1024
139 #define CE_MODE	32768
140 #define CE_OOP	4096
141 #define CE_OVERRUN	2
142 #define CE_PTO	512
143 #define CE_RXOVER	1
144 #define CE_RXPARITY	4
145 #define CE_TXFULL	256
146 #define PROGRESS_CONTINUE	0
147 #define PROGRESS_CANCEL	1
148 #define PROGRESS_STOP	2
149 #define PROGRESS_QUIET	3
150 #define CALLBACK_CHUNK_FINISHED	0
151 #define CALLBACK_STREAM_SWITCH	1
152 #define OFS_MAXPATHNAME 128
153 #define FILE_MAP_COPY SECTION_QUERY
154 #define FILE_MAP_WRITE SECTION_MAP_WRITE
155 #define FILE_MAP_READ SECTION_MAP_READ
156 #define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
157 #define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT
158 #define MUTEX_ALL_ACCESS	0x1f0001
159 #define MUTEX_MODIFY_STATE	1
160 #define SEMAPHORE_ALL_ACCESS	0x1f0003
161 #define SEMAPHORE_MODIFY_STATE	2
162 #define EVENT_ALL_ACCESS	0x1f0003
163 #define EVENT_MODIFY_STATE	2
164 #define PIPE_ACCESS_DUPLEX      3
165 #define PIPE_ACCESS_INBOUND     1
166 #define PIPE_ACCESS_OUTBOUND    2
167 #define PIPE_TYPE_BYTE	0
168 #define PIPE_TYPE_MESSAGE	4
169 #define PIPE_READMODE_BYTE	0
170 #define PIPE_READMODE_MESSAGE	2
171 #define PIPE_WAIT	0
172 #define PIPE_NOWAIT	1
173 #define PIPE_CLIENT_END 0
174 #define PIPE_SERVER_END 1
175 #define PIPE_UNLIMITED_INSTANCES 255
176 #define DEBUG_PROCESS			0x00000001
177 #define DEBUG_ONLY_THIS_PROCESS		0x00000002
178 #define CREATE_SUSPENDED		0x00000004
179 #define DETACHED_PROCESS		0x00000008
180 #define CREATE_NEW_CONSOLE		0x00000010
181 #define NORMAL_PRIORITY_CLASS		0x00000020
182 #define IDLE_PRIORITY_CLASS		0x00000040
183 #define HIGH_PRIORITY_CLASS		0x00000080
184 #define REALTIME_PRIORITY_CLASS		0x00000100
185 #define CREATE_NEW_PROCESS_GROUP	0x00000200
186 #define CREATE_UNICODE_ENVIRONMENT	0x00000400
187 #define CREATE_SEPARATE_WOW_VDM		0x00000800
188 #define CREATE_SHARED_WOW_VDM		0x00001000
189 #define CREATE_FORCEDOS			0x00002000
190 #define BELOW_NORMAL_PRIORITY_CLASS	0x00004000
191 #define ABOVE_NORMAL_PRIORITY_CLASS	0x00008000
192 #define CREATE_BREAKAWAY_FROM_JOB	0x01000000
193 #define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x02000000
194 #define CREATE_DEFAULT_ERROR_MODE	0x04000000
195 #define CREATE_NO_WINDOW		0x08000000
196 #define PROFILE_USER			0x10000000
197 #define PROFILE_KERNEL			0x20000000
198 #define PROFILE_SERVER			0x40000000
199 #define CREATE_NEW	1
200 #define CREATE_ALWAYS	2
201 #define OPEN_EXISTING	3
202 #define OPEN_ALWAYS	4
203 #define TRUNCATE_EXISTING	5
204 #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
205 #define COPY_FILE_FAIL_IF_EXISTS 0x00000001
206 #define COPY_FILE_RESTARTABLE 0x00000002
207 #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
208 #define FILE_FLAG_WRITE_THROUGH	0x80000000
209 #define FILE_FLAG_OVERLAPPED	1073741824
210 #define FILE_FLAG_NO_BUFFERING	536870912
211 #define FILE_FLAG_RANDOM_ACCESS	268435456
212 #define FILE_FLAG_SEQUENTIAL_SCAN	134217728
213 #define FILE_FLAG_DELETE_ON_CLOSE	67108864
214 #define FILE_FLAG_BACKUP_SEMANTICS	33554432
215 #define FILE_FLAG_POSIX_SEMANTICS	16777216
216 #define FILE_FLAG_OPEN_REPARSE_POINT	2097152
217 #define FILE_FLAG_OPEN_NO_RECALL	1048576
218 #if (_WIN32_WINNT >= 0x0500)
219 #define FILE_FLAG_FIRST_PIPE_INSTANCE	524288
220 #endif
221 #define CLRDTR 6
222 #define CLRRTS 4
223 #define SETDTR 5
224 #define SETRTS 3
225 #define SETXOFF 1
226 #define SETXON 2
227 #define RESETDEV 7
228 #define SETBREAK 8
229 #define CLRBREAK 9
230 #define STILL_ACTIVE 0x103
231 #define FIND_FIRST_EX_CASE_SENSITIVE 1
232 #define FIND_FIRST_EX_LARGE_FETCH 2
233 #define SCS_32BIT_BINARY 0
234 #define SCS_64BIT_BINARY 6
235 #define SCS_DOS_BINARY 1
236 #define SCS_OS216_BINARY 5
237 #define SCS_PIF_BINARY 3
238 #define SCS_POSIX_BINARY 4
239 #define SCS_WOW_BINARY 2
240 #define MAX_COMPUTERNAME_LENGTH 15
241 #define HW_PROFILE_GUIDLEN	39
242 #define MAX_PROFILE_LEN	80
243 #define DOCKINFO_UNDOCKED	1
244 #define DOCKINFO_DOCKED	2
245 #define DOCKINFO_USER_SUPPLIED	4
246 #define DOCKINFO_USER_UNDOCKED	(DOCKINFO_USER_SUPPLIED|DOCKINFO_UNDOCKED)
247 #define DOCKINFO_USER_DOCKED	(DOCKINFO_USER_SUPPLIED|DOCKINFO_DOCKED)
248 #define DRIVE_REMOVABLE 2
249 #define DRIVE_FIXED 3
250 #define DRIVE_REMOTE 4
251 #define DRIVE_CDROM 5
252 #define DRIVE_RAMDISK 6
253 #define DRIVE_UNKNOWN 0
254 #define DRIVE_NO_ROOT_DIR 1
255 #define FILE_TYPE_UNKNOWN 0
256 #define FILE_TYPE_DISK 1
257 #define FILE_TYPE_CHAR 2
258 #define FILE_TYPE_PIPE 3
259 #define FILE_TYPE_REMOTE 0x8000
260 /* also in ddk/ntapi.h */
261 #define HANDLE_FLAG_INHERIT		0x01
262 #define HANDLE_FLAG_PROTECT_FROM_CLOSE	0x02
263 /* end ntapi.h */
264 #define STD_INPUT_HANDLE (DWORD)(0xfffffff6)
265 #define STD_OUTPUT_HANDLE (DWORD)(0xfffffff5)
266 #define STD_ERROR_HANDLE (DWORD)(0xfffffff4)
267 #define INVALID_HANDLE_VALUE (HANDLE)(-1)
268 #define GET_TAPE_MEDIA_INFORMATION 0
269 #define GET_TAPE_DRIVE_INFORMATION 1
270 #define SET_TAPE_MEDIA_INFORMATION 0
271 #define SET_TAPE_DRIVE_INFORMATION 1
272 #define THREAD_PRIORITY_ABOVE_NORMAL 1
273 #define THREAD_PRIORITY_BELOW_NORMAL (-1)
274 #define THREAD_PRIORITY_HIGHEST 2
275 #define THREAD_PRIORITY_IDLE (-15)
276 #define THREAD_PRIORITY_LOWEST (-2)
277 #define THREAD_PRIORITY_NORMAL 0
278 #define THREAD_PRIORITY_TIME_CRITICAL 15
279 #define THREAD_PRIORITY_ERROR_RETURN 2147483647
280 #define TIME_ZONE_ID_UNKNOWN 0
281 #define TIME_ZONE_ID_STANDARD 1
282 #define TIME_ZONE_ID_DAYLIGHT 2
283 #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
284 #define FS_CASE_IS_PRESERVED 2
285 #define FS_CASE_SENSITIVE 1
286 #define FS_UNICODE_STORED_ON_DISK 4
287 #define FS_PERSISTENT_ACLS 8
288 #define FS_FILE_COMPRESSION 16
289 #define FS_VOL_IS_COMPRESSED 32768
290 #define GMEM_FIXED 0
291 #define GMEM_MOVEABLE 2
292 #define GMEM_MODIFY 128
293 #define GPTR 64
294 #define GHND 66
295 #define GMEM_DDESHARE 8192
296 #define GMEM_DISCARDABLE 256
297 #define GMEM_LOWER 4096
298 #define GMEM_NOCOMPACT 16
299 #define GMEM_NODISCARD 32
300 #define GMEM_NOT_BANKED 4096
301 #define GMEM_NOTIFY 16384
302 #define GMEM_SHARE 8192
303 #define GMEM_ZEROINIT 64
304 #define GMEM_DISCARDED 16384
305 #define GMEM_INVALID_HANDLE 32768
306 #define GMEM_LOCKCOUNT 255
307 #define GMEM_VALID_FLAGS 32626
308 #define EXCEPTION_ACCESS_VIOLATION ((DWORD)0xC0000005)
309 #define EXCEPTION_DATATYPE_MISALIGNMENT ((DWORD)0x80000002)
310 #define EXCEPTION_BREAKPOINT ((DWORD)0x80000003)
311 #define EXCEPTION_SINGLE_STEP ((DWORD)0x80000004)
312 #define EXCEPTION_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C)
313 #define EXCEPTION_FLT_DENORMAL_OPERAND ((DWORD)0xC000008D)
314 #define EXCEPTION_FLT_DIVIDE_BY_ZERO ((DWORD)0xC000008E)
315 #define EXCEPTION_FLT_INEXACT_RESULT ((DWORD)0xC000008F)
316 #define EXCEPTION_FLT_INVALID_OPERATION ((DWORD)0xC0000090)
317 #define EXCEPTION_FLT_OVERFLOW ((DWORD)0xC0000091)
318 #define EXCEPTION_FLT_STACK_CHECK ((DWORD)0xC0000092)
319 #define EXCEPTION_FLT_UNDERFLOW ((DWORD)0xC0000093)
320 #define EXCEPTION_INT_DIVIDE_BY_ZERO ((DWORD)0xC0000094)
321 #define EXCEPTION_INT_OVERFLOW ((DWORD)0xC0000095)
322 #define EXCEPTION_PRIV_INSTRUCTION ((DWORD)0xC0000096)
323 #define EXCEPTION_IN_PAGE_ERROR ((DWORD)0xC0000006)
324 #define EXCEPTION_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
325 #define EXCEPTION_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025)
326 #define EXCEPTION_STACK_OVERFLOW ((DWORD)0xC00000FD)
327 #define EXCEPTION_INVALID_DISPOSITION ((DWORD)0xC0000026)
328 #define EXCEPTION_GUARD_PAGE ((DWORD)0x80000001)
329 #define EXCEPTION_INVALID_HANDLE ((DWORD)0xC0000008L)
330 #define CONTROL_C_EXIT ((DWORD)0xC000013A)
331 #define PROCESS_HEAP_REGION 1
332 #define PROCESS_HEAP_UNCOMMITTED_RANGE 2
333 #define PROCESS_HEAP_ENTRY_BUSY 4
334 #define PROCESS_HEAP_ENTRY_MOVEABLE 16
335 #define PROCESS_HEAP_ENTRY_DDESHARE 32
336 
337 // LoadLibraryEx() dwFlags.
338 #define DONT_RESOLVE_DLL_REFERENCES                 0x00000001
339 #define LOAD_LIBRARY_AS_DATAFILE                    0x00000002
340 // #define LOAD_PACKAGED_LIBRARY                       0x00000004 // Internal use only.
341 #define LOAD_WITH_ALTERED_SEARCH_PATH               0x00000008
342 #define LOAD_IGNORE_CODE_AUTHZ_LEVEL                0x00000010
343 #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
344 #define LOAD_LIBRARY_AS_IMAGE_RESOURCE              0x00000020
345 #define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE          0x00000040
346 #define LOAD_LIBRARY_REQUIRE_SIGNED_TARGET          0x00000080
347 #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR            0x00000100
348 #define LOAD_LIBRARY_SEARCH_APPLICATION_DIR         0x00000200
349 #define LOAD_LIBRARY_SEARCH_USER_DIRS               0x00000400
350 #define LOAD_LIBRARY_SEARCH_SYSTEM32                0x00000800
351 #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS            0x00001000
352 #endif // _WIN32_WINNT_VISTA
353 #if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
354 #define LOAD_LIBRARY_SAFE_CURRENT_DIRS              0x00002000
355 #define LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER   0x00004000
356 #else // NTDDI_WIN10_RS1
357 #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
358 #define LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER   LOAD_LIBRARY_SEARCH_SYSTEM32
359 #endif // _WIN32_WINNT_VISTA
360 #endif // NTDDI_WIN10_RS1
361 #if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
362 #define LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY        0x00008000
363 #endif // NTDDI_WIN10_RS2
364 
365 #define LMEM_FIXED 0
366 #define LMEM_MOVEABLE 2
367 #define LMEM_NONZEROLHND 2
368 #define LMEM_NONZEROLPTR 0
369 #define LMEM_DISCARDABLE 3840
370 #define LMEM_NOCOMPACT 16
371 #define LMEM_NODISCARD 32
372 #define LMEM_ZEROINIT 64
373 #define LMEM_DISCARDED 16384
374 #define LMEM_MODIFY 128
375 #define LMEM_INVALID_HANDLE 32768
376 #define LMEM_LOCKCOUNT 255
377 #define LMEM_VALID_FLAGS 0x0F72
378 #define LPTR 64
379 #define LHND 66
380 #define NONZEROLHND 2
381 #define NONZEROLPTR 0
382 #define LOCKFILE_FAIL_IMMEDIATELY 1
383 #define LOCKFILE_EXCLUSIVE_LOCK 2
384 #define LOGON32_PROVIDER_DEFAULT	0
385 #define LOGON32_PROVIDER_WINNT35	1
386 #define LOGON32_PROVIDER_WINNT40	2
387 #define LOGON32_PROVIDER_WINNT50	3
388 #define LOGON32_LOGON_INTERACTIVE	2
389 #define LOGON32_LOGON_NETWORK	3
390 #define LOGON32_LOGON_BATCH	4
391 #define LOGON32_LOGON_SERVICE	5
392 #define LOGON32_LOGON_UNLOCK	7
393 #define LOGON32_LOGON_NETWORK_CLEARTEXT	8
394 #define LOGON32_LOGON_NEW_CREDENTIALS	9
395 #define MOVEFILE_REPLACE_EXISTING 1
396 #define MOVEFILE_COPY_ALLOWED 2
397 #define MOVEFILE_DELAY_UNTIL_REBOOT 4
398 #define MOVEFILE_WRITE_THROUGH 8
399 #define MOVEFILE_CREATE_HARDLINK 16
400 #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 32
401 #define MAXIMUM_WAIT_OBJECTS 64
402 #define MAXIMUM_SUSPEND_COUNT 0x7F
403 #define WAIT_OBJECT_0 0
404 #define WAIT_ABANDONED_0 128
405 #ifndef WAIT_TIMEOUT /* also in winerror.h */
406 #define WAIT_TIMEOUT 258
407 #endif
408 #define WAIT_IO_COMPLETION 0xC0
409 #define WAIT_ABANDONED 128
410 #define WAIT_FAILED ((DWORD)0xFFFFFFFF)
411 #define PURGE_TXABORT 1
412 #define PURGE_RXABORT 2
413 #define PURGE_TXCLEAR 4
414 #define PURGE_RXCLEAR 8
415 
416 #define FORMAT_MESSAGE_ALLOCATE_BUFFER 256
417 #define FORMAT_MESSAGE_IGNORE_INSERTS 512
418 #define FORMAT_MESSAGE_FROM_STRING 1024
419 #define FORMAT_MESSAGE_FROM_HMODULE 2048
420 #define FORMAT_MESSAGE_FROM_SYSTEM 4096
421 #define FORMAT_MESSAGE_ARGUMENT_ARRAY 8192
422 #define FORMAT_MESSAGE_MAX_WIDTH_MASK 255
423 #define EV_BREAK 64
424 #define EV_CTS 8
425 #define EV_DSR 16
426 #define EV_ERR 128
427 #define EV_EVENT1 2048
428 #define EV_EVENT2 4096
429 #define EV_PERR 512
430 #define EV_RING 256
431 #define EV_RLSD 32
432 #define EV_RX80FULL 1024
433 #define EV_RXCHAR 1
434 #define EV_RXFLAG 2
435 #define EV_TXEMPTY 4
436 /* also in ddk/ntapi.h */
437 #define SEM_FAILCRITICALERRORS		0x0001
438 #define SEM_NOGPFAULTERRORBOX		0x0002
439 #define SEM_NOALIGNMENTFAULTEXCEPT	0x0004
440 #define SEM_NOOPENFILEERRORBOX		0x8000
441 /* end ntapi.h */
442 #define SLE_ERROR 1
443 #define SLE_MINORERROR 2
444 #define SLE_WARNING 3
445 #define SHUTDOWN_NORETRY 1
446 #define MAXINTATOM 0xC000
447 #define INVALID_ATOM ((ATOM)0)
448 #define IGNORE	0
449 #define INFINITE	0xFFFFFFFF
450 #define NOPARITY	0
451 #define ODDPARITY	1
452 #define EVENPARITY	2
453 #define MARKPARITY	3
454 #define SPACEPARITY	4
455 #define ONESTOPBIT	0
456 #define ONE5STOPBITS	1
457 #define TWOSTOPBITS	2
458 #define CBR_110	110
459 #define CBR_300	300
460 #define CBR_600	600
461 #define CBR_1200	1200
462 #define CBR_2400	2400
463 #define CBR_4800	4800
464 #define CBR_9600	9600
465 #define CBR_14400	14400
466 #define CBR_19200	19200
467 #define CBR_38400	38400
468 #define CBR_56000	56000
469 #define CBR_57600	57600
470 #define CBR_115200	115200
471 #define CBR_128000	128000
472 #define CBR_256000	256000
473 #define BACKUP_INVALID	0
474 #define BACKUP_DATA 1
475 #define BACKUP_EA_DATA 2
476 #define BACKUP_SECURITY_DATA 3
477 #define BACKUP_ALTERNATE_DATA 4
478 #define BACKUP_LINK 5
479 #define BACKUP_PROPERTY_DATA 6
480 #define BACKUP_OBJECT_ID 7
481 #define BACKUP_REPARSE_DATA 8
482 #define BACKUP_SPARSE_BLOCK 9
483 #define STREAM_NORMAL_ATTRIBUTE 0
484 #define STREAM_MODIFIED_WHEN_READ 1
485 #define STREAM_CONTAINS_SECURITY 2
486 #define STREAM_CONTAINS_PROPERTIES 4
487 
488 #define STARTF_USESHOWWINDOW    0x00000001
489 #define STARTF_USESIZE          0x00000002
490 #define STARTF_USEPOSITION      0x00000004
491 #define STARTF_USECOUNTCHARS    0x00000008
492 #define STARTF_USEFILLATTRIBUTE 0x00000010
493 #define STARTF_RUNFULLSCREEN    0x00000020
494 #define STARTF_FORCEONFEEDBACK  0x00000040
495 #define STARTF_FORCEOFFFEEDBACK 0x00000080
496 #define STARTF_USESTDHANDLES    0x00000100
497 #if (WINVER >= 0x400)
498 #define STARTF_USEHOTKEY        0x00000200
499 #define STARTF_TITLEISLINKNAME  0x00000800
500 #define STARTF_TITLEISAPPID     0x00001000
501 #define STARTF_PREVENTPINNING   0x00002000
502 #endif /* (WINVER >= 0x400) */
503 
504 #define TC_NORMAL 0
505 #define TC_HARDERR 1
506 #define TC_GP_TRAP 2
507 #define TC_SIGNAL 3
508 #define AC_LINE_OFFLINE 0
509 #define AC_LINE_ONLINE 1
510 #define AC_LINE_BACKUP_POWER 2
511 #define AC_LINE_UNKNOWN 255
512 #define BATTERY_FLAG_HIGH 1
513 #define BATTERY_FLAG_LOW 2
514 #define BATTERY_FLAG_CRITICAL 4
515 #define BATTERY_FLAG_CHARGING 8
516 #define BATTERY_FLAG_NO_BATTERY 128
517 #define BATTERY_FLAG_UNKNOWN 255
518 #define BATTERY_PERCENTAGE_UNKNOWN 255
519 #define BATTERY_LIFE_UNKNOWN 0xFFFFFFFF
520 #define DDD_RAW_TARGET_PATH 1
521 #define DDD_REMOVE_DEFINITION 2
522 #define DDD_EXACT_MATCH_ON_REMOVE 4
523 #define DDD_NO_BROADCAST_SYSTEM 8
524 #define DDD_LUID_BROADCAST_DRIVE 16
525 #define HINSTANCE_ERROR 32
526 #define MS_CTS_ON 16
527 #define MS_DSR_ON 32
528 #define MS_RING_ON 64
529 #define MS_RLSD_ON 128
530 #define DTR_CONTROL_DISABLE 0
531 #define DTR_CONTROL_ENABLE 1
532 #define DTR_CONTROL_HANDSHAKE 2
533 #define RTS_CONTROL_DISABLE 0
534 #define RTS_CONTROL_ENABLE 1
535 #define RTS_CONTROL_HANDSHAKE 2
536 #define RTS_CONTROL_TOGGLE 3
537 #define SECURITY_ANONYMOUS (SecurityAnonymous<<16)
538 #define SECURITY_IDENTIFICATION (SecurityIdentification<<16)
539 #define SECURITY_IMPERSONATION (SecurityImpersonation<<16)
540 #define SECURITY_DELEGATION (SecurityDelegation<<16)
541 #define SECURITY_CONTEXT_TRACKING 0x40000
542 #define SECURITY_EFFECTIVE_ONLY 0x80000
543 #define SECURITY_SQOS_PRESENT 0x100000
544 #define SECURITY_VALID_SQOS_FLAGS 0x1F0000
545 #define INVALID_FILE_SIZE 0xFFFFFFFF
546 #define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF
547 #if (_WIN32_WINNT >= 0x0501)
548 #define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID 0x00000001
549 #define ACTCTX_FLAG_LANGID_VALID 0x00000002
550 #define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID 0x00000004
551 #define ACTCTX_FLAG_RESOURCE_NAME_VALID 0x00000008
552 #define ACTCTX_FLAG_SET_PROCESS_DEFAULT 0x00000010
553 #define ACTCTX_FLAG_APPLICATION_NAME_VALID 0x00000020
554 #define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF 0x00000040
555 #define ACTCTX_FLAG_HMODULE_VALID 0x00000080
556 #define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION 0x00000001
557 #define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX 0x00000001
558 #define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX 0x00000004
559 #define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE 0x00000008
560 #define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS 0x00000010
561 #define QUERY_ACTCTX_FLAG_NO_ADDREF 0x80000000
562 #if (_WIN32_WINNT >= 0x0600)
563 #define SYMBOLIC_LINK_FLAG_DIRECTORY 0x1
564 #endif
565 #endif /* (_WIN32_WINNT >= 0x0501) */
566 #if (_WIN32_WINNT >= 0x0500)
567 #define REPLACEFILE_WRITE_THROUGH 0x00000001
568 #define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
569 #endif /* (_WIN32_WINNT >= 0x0500) */
570 #if (_WIN32_WINNT >= 0x0400)
571 #define FIBER_FLAG_FLOAT_SWITCH 0x1
572 #endif
573 #define FLS_OUT_OF_INDEXES 0xFFFFFFFF
574 #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
575 #if (_WIN32_WINNT >= 0x0600)
576 #define MAX_RESTART_CMD_LINE 0x800
577 #define RESTART_CYCLICAL 0x1
578 #define RESTART_NOTIFY_SOLUTION 0x2
579 #define RESTART_NOTIFY_FAULT 0x4
580 #define VOLUME_NAME_DOS 0x0
581 #define VOLUME_NAME_GUID 0x1
582 #define VOLUME_NAME_NT 0x2
583 #define VOLUME_NAME_NONE 0x4
584 #define FILE_NAME_NORMALIZED 0x0
585 #define FILE_NAME_OPENED 0x8
586 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
587 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
588 #endif
589 #if (_WIN32_WINNT >= 0x0500)
590 #define GET_MODULE_HANDLE_EX_FLAG_PIN 0x1
591 #define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 0x2
592 #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x4
593 #endif
594 #if (_WIN32_WINNT >= 0x0600)
595 #define CREATE_EVENT_MANUAL_RESET   0x1
596 #define CREATE_EVENT_INITIAL_SET    0x2
597 #define CREATE_MUTEX_INITIAL_OWNER  0x1
598 #define CREATE_WAITABLE_TIMER_MANUAL_RESET  0x1
599 #define SRWLOCK_INIT    RTL_SRWLOCK_INIT
600 #define CONDITION_VARIABLE_INIT RTL_CONDITION_VARIABLE_INIT
601 #define CONDITION_VARIABLE_LOCKMODE_SHARED  RTL_CONDITION_VARIABLE_LOCKMODE_SHARED
602 #endif
603 
604 #define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE  0x00001
605 #define BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE 0x10000
606 #define BASE_SEARCH_PATH_PERMANENT               0x08000
607 #define BASE_SEARCH_PATH_INVALID_FLAGS           (~0x18001)
608 
609 #define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT
610 
611 #if (_WIN32_WINNT >= 0x0600)
612 #define PROCESS_DEP_ENABLE 0x00000001
613 #define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
614 #endif
615 
616 #define LOGON_WITH_PROFILE        0x00000001
617 #define LOGON_NETCREDENTIALS_ONLY 0x00000002
618 
619 #ifndef RC_INVOKED
620 
621 #ifndef _FILETIME_
622 #define _FILETIME_
623 typedef struct _FILETIME {
624 	DWORD dwLowDateTime;
625 	DWORD dwHighDateTime;
626 } FILETIME,*PFILETIME,*LPFILETIME;
627 #endif
628 
629 typedef struct _BY_HANDLE_FILE_INFORMATION {
630 	DWORD	dwFileAttributes;
631 	FILETIME	ftCreationTime;
632 	FILETIME	ftLastAccessTime;
633 	FILETIME	ftLastWriteTime;
634 	DWORD	dwVolumeSerialNumber;
635 	DWORD	nFileSizeHigh;
636 	DWORD	nFileSizeLow;
637 	DWORD	nNumberOfLinks;
638 	DWORD	nFileIndexHigh;
639 	DWORD	nFileIndexLow;
640 } BY_HANDLE_FILE_INFORMATION,*PBY_HANDLE_FILE_INFORMATION,*LPBY_HANDLE_FILE_INFORMATION;
641 
642 typedef struct _DCB {
643 	DWORD DCBlength;
644 	DWORD BaudRate;
645 	DWORD fBinary:1;
646 	DWORD fParity:1;
647 	DWORD fOutxCtsFlow:1;
648 	DWORD fOutxDsrFlow:1;
649 	DWORD fDtrControl:2;
650 	DWORD fDsrSensitivity:1;
651 	DWORD fTXContinueOnXoff:1;
652 	DWORD fOutX:1;
653 	DWORD fInX:1;
654 	DWORD fErrorChar:1;
655 	DWORD fNull:1;
656 	DWORD fRtsControl:2;
657 	DWORD fAbortOnError:1;
658 	DWORD fDummy2:17;
659 	WORD wReserved;
660 	WORD XonLim;
661 	WORD XoffLim;
662 	BYTE ByteSize;
663 	BYTE Parity;
664 	BYTE StopBits;
665 	char XonChar;
666 	char XoffChar;
667 	char ErrorChar;
668 	char EofChar;
669 	char EvtChar;
670 	WORD wReserved1;
671 } DCB,*LPDCB;
672 
673 typedef struct _COMM_CONFIG {
674 	DWORD dwSize;
675 	WORD  wVersion;
676 	WORD  wReserved;
677 	DCB   dcb;
678 	DWORD dwProviderSubType;
679 	DWORD dwProviderOffset;
680 	DWORD dwProviderSize;
681 	WCHAR wcProviderData[1];
682 } COMMCONFIG,*LPCOMMCONFIG;
683 
684 typedef struct _COMMPROP {
685 	WORD	wPacketLength;
686 	WORD	wPacketVersion;
687 	DWORD	dwServiceMask;
688 	DWORD	dwReserved1;
689 	DWORD	dwMaxTxQueue;
690 	DWORD	dwMaxRxQueue;
691 	DWORD	dwMaxBaud;
692 	DWORD	dwProvSubType;
693 	DWORD	dwProvCapabilities;
694 	DWORD	dwSettableParams;
695 	DWORD	dwSettableBaud;
696 	WORD	wSettableData;
697 	WORD	wSettableStopParity;
698 	DWORD	dwCurrentTxQueue;
699 	DWORD	dwCurrentRxQueue;
700 	DWORD	dwProvSpec1;
701 	DWORD	dwProvSpec2;
702 	WCHAR	wcProvChar[1];
703 } COMMPROP,*LPCOMMPROP;
704 
705 typedef struct _COMMTIMEOUTS {
706 	DWORD ReadIntervalTimeout;
707 	DWORD ReadTotalTimeoutMultiplier;
708 	DWORD ReadTotalTimeoutConstant;
709 	DWORD WriteTotalTimeoutMultiplier;
710 	DWORD WriteTotalTimeoutConstant;
711 } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
712 
713 typedef struct _COMSTAT {
714 	DWORD fCtsHold:1;
715 	DWORD fDsrHold:1;
716 	DWORD fRlsdHold:1;
717 	DWORD fXoffHold:1;
718 	DWORD fXoffSent:1;
719 	DWORD fEof:1;
720 	DWORD fTxim:1;
721 	DWORD fReserved:25;
722 	DWORD cbInQue;
723 	DWORD cbOutQue;
724 } COMSTAT,*LPCOMSTAT;
725 
726 typedef DWORD (WINAPI *LPTHREAD_START_ROUTINE)(LPVOID);
727 
728 typedef struct _CREATE_PROCESS_DEBUG_INFO {
729 	HANDLE hFile;
730 	HANDLE hProcess;
731 	HANDLE hThread;
732 	LPVOID lpBaseOfImage;
733 	DWORD dwDebugInfoFileOffset;
734 	DWORD nDebugInfoSize;
735 	LPVOID lpThreadLocalBase;
736 	LPTHREAD_START_ROUTINE lpStartAddress;
737 	LPVOID lpImageName;
738 	WORD fUnicode;
739 } CREATE_PROCESS_DEBUG_INFO,*LPCREATE_PROCESS_DEBUG_INFO;
740 
741 typedef struct _CREATE_THREAD_DEBUG_INFO {
742 	HANDLE hThread;
743 	LPVOID lpThreadLocalBase;
744 	LPTHREAD_START_ROUTINE lpStartAddress;
745 } CREATE_THREAD_DEBUG_INFO,*LPCREATE_THREAD_DEBUG_INFO;
746 
747 typedef struct _EXCEPTION_DEBUG_INFO {
748 	EXCEPTION_RECORD ExceptionRecord;
749 	DWORD dwFirstChance;
750 } EXCEPTION_DEBUG_INFO,*LPEXCEPTION_DEBUG_INFO;
751 
752 typedef struct _EXIT_THREAD_DEBUG_INFO {
753 	DWORD dwExitCode;
754 } EXIT_THREAD_DEBUG_INFO,*LPEXIT_THREAD_DEBUG_INFO;
755 
756 typedef struct _EXIT_PROCESS_DEBUG_INFO {
757 	DWORD dwExitCode;
758 } EXIT_PROCESS_DEBUG_INFO,*LPEXIT_PROCESS_DEBUG_INFO;
759 
760 typedef struct _LOAD_DLL_DEBUG_INFO {
761 	HANDLE hFile;
762 	LPVOID lpBaseOfDll;
763 	DWORD dwDebugInfoFileOffset;
764 	DWORD nDebugInfoSize;
765 	LPVOID lpImageName;
766 	WORD fUnicode;
767 } LOAD_DLL_DEBUG_INFO,*LPLOAD_DLL_DEBUG_INFO;
768 
769 typedef struct _UNLOAD_DLL_DEBUG_INFO {
770 	LPVOID lpBaseOfDll;
771 } UNLOAD_DLL_DEBUG_INFO,*LPUNLOAD_DLL_DEBUG_INFO;
772 
773 typedef struct _OUTPUT_DEBUG_STRING_INFO {
774 	LPSTR lpDebugStringData;
775 	WORD fUnicode;
776 	WORD nDebugStringLength;
777 } OUTPUT_DEBUG_STRING_INFO,*LPOUTPUT_DEBUG_STRING_INFO;
778 
779 typedef struct _RIP_INFO {
780 	DWORD dwError;
781 	DWORD dwType;
782 } RIP_INFO,*LPRIP_INFO;
783 
784 typedef struct _DEBUG_EVENT {
785 	DWORD dwDebugEventCode;
786 	DWORD dwProcessId;
787 	DWORD dwThreadId;
788 	union {
789 		EXCEPTION_DEBUG_INFO Exception;
790 		CREATE_THREAD_DEBUG_INFO CreateThread;
791 		CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
792 		EXIT_THREAD_DEBUG_INFO ExitThread;
793 		EXIT_PROCESS_DEBUG_INFO ExitProcess;
794 		LOAD_DLL_DEBUG_INFO LoadDll;
795 		UNLOAD_DLL_DEBUG_INFO UnloadDll;
796 		OUTPUT_DEBUG_STRING_INFO DebugString;
797 		RIP_INFO RipInfo;
798 	} u;
799 } DEBUG_EVENT,*LPDEBUG_EVENT;
800 
801 #ifndef MIDL_PASS
802 typedef PCONTEXT LPCONTEXT;
803 typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
804 typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
805 #endif
806 
807 typedef struct _OVERLAPPED {
808 	ULONG_PTR Internal;
809 	ULONG_PTR InternalHigh;
810 	union {
811 		struct {
812 			DWORD Offset;
813 			DWORD OffsetHigh;
814 		} DUMMYSTRUCTNAME;
815 		PVOID Pointer;
816 	} DUMMYUNIONNAME;
817 	HANDLE hEvent;
818 } OVERLAPPED, *POVERLAPPED, *LPOVERLAPPED;
819 
820 typedef struct _OVERLAPPED_ENTRY {
821     ULONG_PTR lpCompletionKey;
822     LPOVERLAPPED lpOverlapped;
823     ULONG_PTR Internal;
824     DWORD dwNumberOfBytesTransferred;
825 } OVERLAPPED_ENTRY, *LPOVERLAPPED_ENTRY;
826 
827 typedef struct _STARTUPINFOA {
828 	DWORD	cb;
829 	LPSTR	lpReserved;
830 	LPSTR	lpDesktop;
831 	LPSTR	lpTitle;
832 	DWORD	dwX;
833 	DWORD	dwY;
834 	DWORD	dwXSize;
835 	DWORD	dwYSize;
836 	DWORD	dwXCountChars;
837 	DWORD	dwYCountChars;
838 	DWORD	dwFillAttribute;
839 	DWORD	dwFlags;
840 	WORD	wShowWindow;
841 	WORD	cbReserved2;
842 	PBYTE	lpReserved2;
843 	HANDLE	hStdInput;
844 	HANDLE	hStdOutput;
845 	HANDLE	hStdError;
846 } STARTUPINFOA,*LPSTARTUPINFOA;
847 
848 typedef struct _STARTUPINFOW {
849 	DWORD	cb;
850 	LPWSTR	lpReserved;
851 	LPWSTR	lpDesktop;
852 	LPWSTR	lpTitle;
853 	DWORD	dwX;
854 	DWORD	dwY;
855 	DWORD	dwXSize;
856 	DWORD	dwYSize;
857 	DWORD	dwXCountChars;
858 	DWORD	dwYCountChars;
859 	DWORD	dwFillAttribute;
860 	DWORD	dwFlags;
861 	WORD	wShowWindow;
862 	WORD	cbReserved2;
863 	PBYTE	lpReserved2;
864 	HANDLE	hStdInput;
865 	HANDLE	hStdOutput;
866 	HANDLE	hStdError;
867 } STARTUPINFOW,*LPSTARTUPINFOW;
868 
869 typedef struct _PROCESS_INFORMATION {
870 	HANDLE hProcess;
871 	HANDLE hThread;
872 	DWORD dwProcessId;
873 	DWORD dwThreadId;
874 } PROCESS_INFORMATION,*PPROCESS_INFORMATION,*LPPROCESS_INFORMATION;
875 
876 typedef struct _CRITICAL_SECTION_DEBUG {
877 	WORD Type;
878 	WORD CreatorBackTraceIndex;
879 	struct _CRITICAL_SECTION *CriticalSection;
880 	LIST_ENTRY ProcessLocksList;
881 	DWORD EntryCount;
882 	DWORD ContentionCount;
883 //#ifdef __WINESRC__ //not all wine code is marked so
884 	DWORD_PTR Spare[8/sizeof(DWORD_PTR)];/* in Wine they store a string here */
885 //#else
886 	//WORD SpareWORD;
887 //#endif
888 } CRITICAL_SECTION_DEBUG,*PCRITICAL_SECTION_DEBUG,*LPCRITICAL_SECTION_DEBUG;
889 
890 typedef struct _CRITICAL_SECTION {
891 	PCRITICAL_SECTION_DEBUG DebugInfo;
892 	LONG LockCount;
893 	LONG RecursionCount;
894 	HANDLE OwningThread;
895 	HANDLE LockSemaphore;
896 	ULONG_PTR SpinCount;
897 } CRITICAL_SECTION,*PCRITICAL_SECTION,*LPCRITICAL_SECTION;
898 
899 #ifndef _SYSTEMTIME_
900 #define _SYSTEMTIME_
901 typedef struct _SYSTEMTIME {
902 	WORD wYear;
903 	WORD wMonth;
904 	WORD wDayOfWeek;
905 	WORD wDay;
906 	WORD wHour;
907 	WORD wMinute;
908 	WORD wSecond;
909 	WORD wMilliseconds;
910 } SYSTEMTIME,*LPSYSTEMTIME,*PSYSTEMTIME;
911 #endif /* _SYSTEMTIME_ */
912 #if (_WIN32_WINNT >= 0x0500)
913 typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK ;
914 #endif
915 typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
916 	DWORD	dwFileAttributes;
917 	FILETIME	ftCreationTime;
918 	FILETIME	ftLastAccessTime;
919 	FILETIME	ftLastWriteTime;
920 	DWORD	nFileSizeHigh;
921 	DWORD	nFileSizeLow;
922 } WIN32_FILE_ATTRIBUTE_DATA,*LPWIN32_FILE_ATTRIBUTE_DATA;
923 typedef struct _WIN32_FIND_DATAA {
924 	DWORD dwFileAttributes;
925 	FILETIME ftCreationTime;
926 	FILETIME ftLastAccessTime;
927 	FILETIME ftLastWriteTime;
928 	DWORD nFileSizeHigh;
929 	DWORD nFileSizeLow;
930 	DWORD dwReserved0;
931 	DWORD dwReserved1;
932 	CHAR cFileName[MAX_PATH];
933 	CHAR cAlternateFileName[14];
934 } WIN32_FIND_DATAA,*PWIN32_FIND_DATAA,*LPWIN32_FIND_DATAA;
935 typedef struct _WIN32_FIND_DATAW {
936 	DWORD dwFileAttributes;
937 	FILETIME ftCreationTime;
938 	FILETIME ftLastAccessTime;
939 	FILETIME ftLastWriteTime;
940 	DWORD nFileSizeHigh;
941 	DWORD nFileSizeLow;
942 	DWORD dwReserved0;
943 	DWORD dwReserved1;
944 	WCHAR cFileName[MAX_PATH];
945 	WCHAR cAlternateFileName[14];
946 } WIN32_FIND_DATAW,*PWIN32_FIND_DATAW,*LPWIN32_FIND_DATAW;
947 
948 #if (_WIN32_WINNT >= 0x0501)
949 typedef enum _STREAM_INFO_LEVELS {
950 	FindStreamInfoStandard
951 } STREAM_INFO_LEVELS;
952 
953 typedef struct _WIN32_FIND_STREAM_DATA {
954 	LARGE_INTEGER StreamSize;
955 	WCHAR cStreamName[MAX_PATH + 36];
956 } WIN32_FIND_STREAM_DATA, *PWIN32_FIND_STREAM_DATA;
957 #endif
958 
959 typedef struct _WIN32_STREAM_ID {
960 	DWORD dwStreamId;
961 	DWORD dwStreamAttributes;
962 	LARGE_INTEGER Size;
963 	DWORD dwStreamNameSize;
964 	WCHAR cStreamName[ANYSIZE_ARRAY];
965 } WIN32_STREAM_ID, *LPWIN32_STREAM_ID;
966 
967 #if (_WIN32_WINNT >= 0x0600)
968 
969 typedef enum _FILE_ID_TYPE {
970     FileIdType,
971     ObjectIdType,
972     ExtendedFileIdType,
973     MaximumFileIdType
974 } FILE_ID_TYPE, *PFILE_ID_TYPE;
975 
976 typedef struct _FILE_ID_DESCRIPTOR {
977     DWORD        dwSize;
978     FILE_ID_TYPE Type;
979     union {
980         LARGE_INTEGER FileId;
981         GUID          ObjectId;
982     } DUMMYUNIONNAME;
983 } FILE_ID_DESCRIPTOR, *LPFILE_ID_DESCRIPTOR;
984 
985 typedef enum _FILE_INFO_BY_HANDLE_CLASS {
986     FileBasicInfo,
987     FileStandardInfo,
988     FileNameInfo,
989     FileRenameInfo,
990     FileDispositionInfo,
991     FileAllocationInfo,
992     FileEndOfFileInfo,
993     FileStreamInfo,
994     FileCompressionInfo,
995     FileAttributeTagInfo,
996     FileIdBothDirectoryInfo,
997     FileIdBothDirectoryRestartInfo,
998     FileIoPriorityHintInfo,
999     FileRemoteProtocolInfo,
1000     FileFullDirectoryInfo,
1001     FileFullDirectoryRestartInfo,
1002     FileStorageInfo,
1003     FileAlignmentInfo,
1004     FileIdInfo,
1005     FileIdExtdDirectoryInfo,
1006     FileIdExtdDirectoryRestartInfo,
1007     MaximumFileInfoByHandlesClass
1008 } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS;
1009 
1010 typedef struct _FILE_ID_BOTH_DIR_INFO {
1011     DWORD         NextEntryOffset;
1012     DWORD         FileIndex;
1013     LARGE_INTEGER CreationTime;
1014     LARGE_INTEGER LastAccessTime;
1015     LARGE_INTEGER LastWriteTime;
1016     LARGE_INTEGER ChangeTime;
1017     LARGE_INTEGER EndOfFile;
1018     LARGE_INTEGER AllocationSize;
1019     DWORD         FileAttributes;
1020     DWORD         FileNameLength;
1021     DWORD         EaSize;
1022     CCHAR         ShortNameLength;
1023     WCHAR         ShortName[12];
1024     LARGE_INTEGER FileId;
1025     WCHAR         FileName[1];
1026 } FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO;
1027 
1028 typedef struct _FILE_BASIC_INFO {
1029     LARGE_INTEGER CreationTime;
1030     LARGE_INTEGER LastAccessTime;
1031     LARGE_INTEGER LastWriteTime;
1032     LARGE_INTEGER ChangeTime;
1033     DWORD FileAttributes;
1034 } FILE_BASIC_INFO, *PFILE_BASIC_INFO;
1035 
1036 typedef struct _FILE_STANDARD_INFO {
1037     LARGE_INTEGER AllocationSize;
1038     LARGE_INTEGER EndOfFile;
1039     DWORD NumberOfLinks;
1040     BOOLEAN DeletePending;
1041     BOOLEAN Directory;
1042 } FILE_STANDARD_INFO, *PFILE_STANDARD_INFO;
1043 
1044 typedef struct _FILE_NAME_INFO {
1045     DWORD FileNameLength;
1046     WCHAR FileName[1];
1047 } FILE_NAME_INFO, *PFILE_NAME_INFO;
1048 
1049 typedef enum _PRIORITY_HINT {
1050     IoPriorityHintVeryLow,
1051     IoPriorityHintLow,
1052     IoPriorityHintNormal,
1053     MaximumIoPriorityHintType
1054 } PRIORITY_HINT;
1055 
1056 typedef struct _FILE_IO_PRIORITY_HINT_INFO {
1057     PRIORITY_HINT PriorityHint;
1058 } FILE_IO_PRIORITY_HINT_INFO;
1059 
1060 typedef struct _FILE_ALLOCATION_INFO {
1061     LARGE_INTEGER AllocationSize;
1062 } FILE_ALLOCATION_INFO, *PFILE_ALLOCATION_INFO;
1063 
1064 typedef struct _FILE_DISPOSITION_INFO {
1065     BOOLEAN DeleteFile;
1066 } FILE_DISPOSITION_INFO, *PFILE_DISPOSITION_INFO;
1067 
1068 typedef struct _FILE_END_OF_FILE_INFO {
1069     LARGE_INTEGER EndOfFile;
1070 } FILE_END_OF_FILE_INFO, *PFILE_END_OF_FILE_INFO;
1071 
1072 typedef struct _FILE_RENAME_INFO {
1073     BOOLEAN ReplaceIfExists;
1074     HANDLE RootDirectory;
1075     DWORD FileNameLength;
1076     WCHAR FileName[1];
1077 } FILE_RENAME_INFO, *PFILE_RENAME_INFO;
1078 
1079 typedef struct _FILE_ATTRIBUTE_TAG_INFO {
1080     DWORD FileAttributes;
1081     DWORD ReparseTag;
1082 } FILE_ATTRIBUTE_TAG_INFO, *PFILE_ATTRIBUTE_TAG_INFO;
1083 
1084 typedef struct _FILE_COMPRESSION_INFO {
1085     LARGE_INTEGER CompressedFileSize;
1086     WORD CompressionFormat;
1087     UCHAR CompressionUnitShift;
1088     UCHAR ChunkShift;
1089     UCHAR ClusterShift;
1090     UCHAR Reserved[3];
1091 } FILE_COMPRESSION_INFO, *PFILE_COMPRESSION_INFO;
1092 
1093 typedef struct _FILE_REMOTE_PROTOCOL_INFO {
1094     USHORT StructureVersion;
1095     USHORT StructureSize;
1096     ULONG Protocol;
1097     USHORT ProtocolMajorVersion;
1098     USHORT ProtocolMinorVersion;
1099     USHORT ProtocolRevision;
1100     USHORT Reserved;
1101     ULONG Flags;
1102     struct {
1103         ULONG Reserved[8];
1104     } GenericReserved;
1105     struct {
1106         ULONG Reserved[16];
1107     } ProtocolSpecificReserved;
1108 } FILE_REMOTE_PROTOCOL_INFO, *PFILE_REMOTE_PROTOCOL_INFO;
1109 
1110 #endif
1111 
1112 typedef enum _FINDEX_INFO_LEVELS {
1113 	FindExInfoStandard,
1114 	FindExInfoBasic,
1115 	FindExInfoMaxInfoLevel
1116 } FINDEX_INFO_LEVELS;
1117 
1118 typedef enum _FINDEX_SEARCH_OPS {
1119 	FindExSearchNameMatch,
1120 	FindExSearchLimitToDirectories,
1121 	FindExSearchLimitToDevices,
1122 	FindExSearchMaxSearchOp
1123 } FINDEX_SEARCH_OPS;
1124 
1125 typedef struct tagHW_PROFILE_INFOA {
1126 	DWORD dwDockInfo;
1127 	CHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
1128 	CHAR szHwProfileName[MAX_PROFILE_LEN];
1129 } HW_PROFILE_INFOA,*LPHW_PROFILE_INFOA;
1130 
1131 typedef struct tagHW_PROFILE_INFOW {
1132 	DWORD dwDockInfo;
1133 	WCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
1134 	WCHAR szHwProfileName[MAX_PROFILE_LEN];
1135 } HW_PROFILE_INFOW,*LPHW_PROFILE_INFOW;
1136 
1137 /* Event Logging */
1138 
1139 #define EVENTLOG_FULL_INFO          0
1140 
1141 typedef struct _EVENTLOG_FULL_INFORMATION {
1142     DWORD dwFull;
1143 } EVENTLOG_FULL_INFORMATION, *LPEVENTLOG_FULL_INFORMATION;
1144 
1145 typedef enum _GET_FILEEX_INFO_LEVELS {
1146 	GetFileExInfoStandard,
1147 	GetFileExMaxInfoLevel
1148 } GET_FILEEX_INFO_LEVELS;
1149 
1150 typedef struct _SYSTEM_INFO {
1151 	_ANONYMOUS_UNION union {
1152 		DWORD dwOemId;
1153 		_ANONYMOUS_STRUCT struct {
1154 			WORD wProcessorArchitecture;
1155 			WORD wReserved;
1156 		} DUMMYSTRUCTNAME;
1157 	} DUMMYUNIONNAME;
1158 	DWORD dwPageSize;
1159 	PVOID lpMinimumApplicationAddress;
1160 	PVOID lpMaximumApplicationAddress;
1161 	DWORD_PTR dwActiveProcessorMask;
1162 	DWORD dwNumberOfProcessors;
1163 	DWORD dwProcessorType;
1164 	DWORD dwAllocationGranularity;
1165 	WORD wProcessorLevel;
1166 	WORD wProcessorRevision;
1167 } SYSTEM_INFO,*LPSYSTEM_INFO;
1168 
1169 typedef struct _SYSTEM_POWER_STATUS {
1170 	BYTE ACLineStatus;
1171 	BYTE BatteryFlag;
1172 	BYTE BatteryLifePercent;
1173 	BYTE SystemStatusFlag;
1174 	DWORD BatteryLifeTime;
1175 	DWORD BatteryFullLifeTime;
1176 } SYSTEM_POWER_STATUS,*LPSYSTEM_POWER_STATUS;
1177 
1178 typedef struct _TIME_DYNAMIC_ZONE_INFORMATION {
1179   LONG Bias;
1180   WCHAR StandardName[32];
1181   SYSTEMTIME StandardDate;
1182   LONG StandardBias;
1183   WCHAR DaylightName[32];
1184   SYSTEMTIME DaylightDate;
1185   LONG DaylightBias;
1186   WCHAR TimeZoneKeyName[128];
1187   BOOLEAN DynamicDaylightTimeDisabled;
1188 } DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION;
1189 
1190 typedef struct _TIME_ZONE_INFORMATION {
1191 	LONG Bias;
1192 	WCHAR StandardName[32];
1193 	SYSTEMTIME StandardDate;
1194 	LONG StandardBias;
1195 	WCHAR DaylightName[32];
1196 	SYSTEMTIME DaylightDate;
1197 	LONG DaylightBias;
1198 } TIME_ZONE_INFORMATION,*PTIME_ZONE_INFORMATION,*LPTIME_ZONE_INFORMATION;
1199 
1200 typedef struct _MEMORYSTATUS {
1201 	DWORD dwLength;
1202 	DWORD dwMemoryLoad;
1203 	SIZE_T dwTotalPhys;
1204 	SIZE_T dwAvailPhys;
1205 	SIZE_T dwTotalPageFile;
1206 	SIZE_T dwAvailPageFile;
1207 	SIZE_T dwTotalVirtual;
1208 	SIZE_T dwAvailVirtual;
1209 } MEMORYSTATUS,*LPMEMORYSTATUS;
1210 
1211 #if (_WIN32_WINNT >= 0x0500)
1212 typedef struct _MEMORYSTATUSEX {
1213 	DWORD dwLength;
1214 	DWORD dwMemoryLoad;
1215 	DWORDLONG ullTotalPhys;
1216 	DWORDLONG ullAvailPhys;
1217 	DWORDLONG ullTotalPageFile;
1218 	DWORDLONG ullAvailPageFile;
1219 	DWORDLONG ullTotalVirtual;
1220 	DWORDLONG ullAvailVirtual;
1221 	DWORDLONG ullAvailExtendedVirtual;
1222 } MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
1223 #endif
1224 
1225 #ifndef _LDT_ENTRY_DEFINED
1226 #define _LDT_ENTRY_DEFINED
1227 typedef struct _LDT_ENTRY {
1228 	WORD LimitLow;
1229 	WORD BaseLow;
1230 	union {
1231 		struct {
1232 			BYTE BaseMid;
1233 			BYTE Flags1;
1234 			BYTE Flags2;
1235 			BYTE BaseHi;
1236 		} Bytes;
1237 		struct {
1238 			DWORD BaseMid:8;
1239 			DWORD Type:5;
1240 			DWORD Dpl:2;
1241 			DWORD Pres:1;
1242 			DWORD LimitHi:4;
1243 			DWORD Sys:1;
1244 			DWORD Reserved_0:1;
1245 			DWORD Default_Big:1;
1246 			DWORD Granularity:1;
1247 			DWORD BaseHi:8;
1248 		} Bits;
1249 	} HighWord;
1250 } LDT_ENTRY,*PLDT_ENTRY,*LPLDT_ENTRY;
1251 #endif
1252 
1253 typedef struct _PROCESS_HEAP_ENTRY {
1254 	PVOID lpData;
1255 	DWORD cbData;
1256 	BYTE cbOverhead;
1257 	BYTE iRegionIndex;
1258 	WORD wFlags;
1259 	_ANONYMOUS_UNION union {
1260 		struct {
1261 			HANDLE hMem;
1262 			DWORD dwReserved[3];
1263 		} Block;
1264 		struct {
1265 			DWORD dwCommittedSize;
1266 			DWORD dwUnCommittedSize;
1267 			LPVOID lpFirstBlock;
1268 			LPVOID lpLastBlock;
1269 		} Region;
1270 	} DUMMYUNIONNAME;
1271 } PROCESS_HEAP_ENTRY,*PPROCESS_HEAP_ENTRY,*LPPROCESS_HEAP_ENTRY;
1272 
1273 typedef struct _OFSTRUCT {
1274 	BYTE cBytes;
1275 	BYTE fFixedDisk;
1276 	WORD nErrCode;
1277 	WORD Reserved1;
1278 	WORD Reserved2;
1279 	CHAR szPathName[OFS_MAXPATHNAME];
1280 } OFSTRUCT,*LPOFSTRUCT,*POFSTRUCT;
1281 
1282 #if (_WIN32_WINNT >= 0x0501)
1283 typedef struct tagACTCTXA {
1284 	ULONG cbSize;
1285 	DWORD dwFlags;
1286 	LPCSTR lpSource;
1287 	USHORT wProcessorArchitecture;
1288 	LANGID wLangId;
1289 	LPCSTR lpAssemblyDirectory;
1290 	LPCSTR lpResourceName;
1291 	LPCSTR lpApplicationName;
1292 	HMODULE hModule;
1293 } ACTCTXA,*PACTCTXA;
1294 typedef const ACTCTXA *PCACTCTXA;
1295 
1296 typedef struct tagACTCTXW {
1297 	ULONG cbSize;
1298 	DWORD dwFlags;
1299 	LPCWSTR lpSource;
1300 	USHORT wProcessorArchitecture;
1301 	LANGID wLangId;
1302 	LPCWSTR lpAssemblyDirectory;
1303 	LPCWSTR lpResourceName;
1304 	LPCWSTR lpApplicationName;
1305 	HMODULE hModule;
1306 } ACTCTXW,*PACTCTXW;
1307 typedef const ACTCTXW *PCACTCTXW;
1308 
1309 typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
1310 	ULONG  cbSize;
1311 	ULONG  ulDataFormatVersion;
1312 	PVOID  lpData;
1313 	ULONG  ulLength;
1314 	PVOID  lpSectionGlobalData;
1315 	ULONG  ulSectionGlobalDataLength;
1316 	PVOID  lpSectionBase;
1317 	ULONG  ulSectionTotalLength;
1318 	HANDLE hActCtx;
1319 	ULONG  ulAssemblyRosterIndex;
1320 } ACTCTX_SECTION_KEYED_DATA_2600, *PACTCTX_SECTION_KEYED_DATA_2600;
1321 typedef const ACTCTX_SECTION_KEYED_DATA_2600 *PCACTCTX_SECTION_KEYED_DATA_2600;
1322 
1323 typedef struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA {
1324 	PVOID lpInformation;
1325 	PVOID lpSectionBase;
1326 	ULONG ulSectionLength;
1327 	PVOID lpSectionGlobalDataBase;
1328 	ULONG ulSectionGlobalDataLength;
1329 } ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, *PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
1330 typedef const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA *PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
1331 
1332 typedef struct tagACTCTX_SECTION_KEYED_DATA {
1333 	ULONG cbSize;
1334 	ULONG ulDataFormatVersion;
1335 	PVOID lpData;
1336 	ULONG ulLength;
1337 	PVOID lpSectionGlobalData;
1338 	ULONG ulSectionGlobalDataLength;
1339 	PVOID lpSectionBase;
1340 	ULONG ulSectionTotalLength;
1341 	HANDLE hActCtx;
1342 	ULONG ulAssemblyRosterIndex;
1343 	/* Non 2600 extra fields */
1344 	ULONG ulFlags;
1345 	ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
1346 } ACTCTX_SECTION_KEYED_DATA,*PACTCTX_SECTION_KEYED_DATA;
1347 
1348 typedef const ACTCTX_SECTION_KEYED_DATA *PCACTCTX_SECTION_KEYED_DATA;
1349 
1350 typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
1351 	HANDLE hActCtx;
1352 	DWORD  dwFlags;
1353 } ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION;
1354 typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT_BASIC_INFORMATION;
1355 
1356 typedef BOOL
1357 (WINAPI *PQUERYACTCTXW_FUNC)(
1358   _In_ DWORD dwFlags,
1359   _In_ HANDLE hActCtx,
1360   _In_opt_ PVOID pvSubInstance,
1361   _In_ ULONG ulInfoClass,
1362   _Out_writes_bytes_to_opt_(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer,
1363   _In_ SIZE_T cbBuffer,
1364   _Out_opt_ SIZE_T *pcbWrittenOrRequired);
1365 
1366 typedef enum {
1367 	LowMemoryResourceNotification ,
1368 	HighMemoryResourceNotification
1369 } MEMORY_RESOURCE_NOTIFICATION_TYPE;
1370 #endif /* (_WIN32_WINNT >= 0x0501) */
1371 
1372 #if (_WIN32_WINNT >= 0x0500)
1373 typedef enum _COMPUTER_NAME_FORMAT {
1374 	ComputerNameNetBIOS,
1375 	ComputerNameDnsHostname,
1376 	ComputerNameDnsDomain,
1377 	ComputerNameDnsFullyQualified,
1378 	ComputerNamePhysicalNetBIOS,
1379 	ComputerNamePhysicalDnsHostname,
1380 	ComputerNamePhysicalDnsDomain,
1381 	ComputerNamePhysicalDnsFullyQualified,
1382 	ComputerNameMax
1383 } COMPUTER_NAME_FORMAT;
1384 #endif /* (_WIN32_WINNT >= 0x0500) */
1385 
1386 #if (_WIN32_WINNT >= 0x0600)
1387 typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
1388 typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
1389 #endif
1390 
1391 typedef struct _PROC_THREAD_ATTRIBUTE_LIST *PPROC_THREAD_ATTRIBUTE_LIST, *LPPROC_THREAD_ATTRIBUTE_LIST;
1392 
1393 #define PROC_THREAD_ATTRIBUTE_NUMBER 0x0000ffff
1394 #define PROC_THREAD_ATTRIBUTE_THREAD 0x00010000
1395 #define PROC_THREAD_ATTRIBUTE_INPUT 0x00020000
1396 #define PROC_THREAD_ATTRIBUTE_ADDITIVE 0x00040000
1397 
1398 typedef enum _PROC_THREAD_ATTRIBUTE_NUM {
1399   ProcThreadAttributeParentProcess = 0,
1400   ProcThreadAttributeHandleList = 2,
1401   ProcThreadAttributeGroupAffinity = 3,
1402   ProcThreadAttributeIdealProcessor = 5,
1403   ProcThreadAttributeUmsThread = 6,
1404   ProcThreadAttributeMitigationPolicy = 7,
1405   ProcThreadAttributeSecurityCapabilities = 9,
1406   ProcThreadAttributeProtectionLevel = 11,
1407   ProcThreadAttributeJobList = 13,
1408   ProcThreadAttributeChildProcessPolicy = 14,
1409   ProcThreadAttributeAllApplicationPackagesPolicy = 15,
1410   ProcThreadAttributeWin32kFilter = 16,
1411   ProcThreadAttributeSafeOpenPromptOriginClaim = 17,
1412 } PROC_THREAD_ATTRIBUTE_NUM;
1413 
1414 #define PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR (ProcThreadAttributeIdealProcessor | PROC_THREAD_ATTRIBUTE_THREAD | PROC_THREAD_ATTRIBUTE_INPUT)
1415 #define PROC_THREAD_ATTRIBUTE_HANDLE_LIST (ProcThreadAttributeHandleList | PROC_THREAD_ATTRIBUTE_INPUT)
1416 #define PROC_THREAD_ATTRIBUTE_PARENT_PROCESS (ProcThreadAttributeParentProcess | PROC_THREAD_ATTRIBUTE_INPUT)
1417 
1418 typedef DWORD
1419 (WINAPI *PFE_EXPORT_FUNC)(
1420   _In_reads_bytes_(ulLength) PBYTE pbData,
1421   _In_opt_ PVOID pvCallbackContext,
1422   _In_ ULONG ulLength);
1423 
1424 typedef DWORD(WINAPI *LPPROGRESS_ROUTINE)(_In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ DWORD, _In_ DWORD, _In_ HANDLE, _In_ HANDLE, _In_opt_ LPVOID);
1425 
1426 typedef VOID (WINAPI *PFIBER_START_ROUTINE)( LPVOID lpFiberParameter );
1427 typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
1428 
1429 typedef VOID (WINAPI *PFLS_CALLBACK_FUNCTION)(PVOID);
1430 typedef BOOL(CALLBACK *ENUMRESLANGPROCA)(HMODULE,LPCSTR,LPCSTR,WORD,LONG_PTR);
1431 typedef BOOL(CALLBACK *ENUMRESLANGPROCW)(HMODULE,LPCWSTR,LPCWSTR,WORD,LONG_PTR);
1432 typedef BOOL(CALLBACK *ENUMRESNAMEPROCA)(HMODULE,LPCSTR,LPSTR,LONG_PTR);
1433 typedef BOOL(CALLBACK *ENUMRESNAMEPROCW)(HMODULE,LPCWSTR,LPWSTR,LONG_PTR);
1434 typedef BOOL(CALLBACK *ENUMRESTYPEPROCA)(HMODULE,LPSTR,LONG_PTR);
1435 typedef BOOL(CALLBACK *ENUMRESTYPEPROCW)(HMODULE,LPWSTR,LONG_PTR);
1436 typedef void(CALLBACK *LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPOVERLAPPED);
1437 typedef LONG(CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(LPEXCEPTION_POINTERS);
1438 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
1439 typedef void(APIENTRY *PAPCFUNC)(ULONG_PTR);
1440 typedef void(CALLBACK *PTIMERAPCROUTINE)(PVOID,DWORD,DWORD);
1441 #if (_WIN32_WINNT >= 0x0600)
1442 typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK)(PVOID);
1443 #endif
1444 
1445 #ifdef WINE_NO_UNICODE_MACROS /* force using a cast */
1446 #define MAKEINTATOM(atom)   ((ULONG_PTR)((WORD)(atom)))
1447 #else
1448 #define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i)))
1449 #endif
1450 
1451 typedef DWORD
1452 (WINAPI *PFE_IMPORT_FUNC)(
1453   _Out_writes_bytes_to_(*ulLength, *ulLength) PBYTE pbData,
1454   _In_opt_ PVOID pvCallbackContext,
1455   _Inout_ PULONG ulLength);
1456 
1457 /* Functions */
1458 #ifndef UNDER_CE
1459 int APIENTRY WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int);
1460 #else
1461 int APIENTRY WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int);
1462 #endif
1463 int APIENTRY wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int);
1464 
1465 long
1466 WINAPI
1467 _hread(
1468   _In_ HFILE hFile,
1469   _Out_writes_bytes_to_(lBytes, return) LPVOID lpBuffer,
1470   _In_ long lBytes);
1471 
1472 long
1473 WINAPI
1474 _hwrite(
1475   _In_ HFILE hFile,
1476   _In_reads_bytes_(lBytes) LPCCH lpBuffer,
1477   _In_ long lBytes);
1478 
1479 HFILE WINAPI _lclose(_In_ HFILE);
1480 HFILE WINAPI _lcreat(_In_ LPCSTR, _In_ int);
1481 LONG WINAPI _llseek(_In_ HFILE, _In_ LONG, _In_ int);
1482 HFILE WINAPI _lopen(_In_ LPCSTR, _In_ int);
1483 
1484 UINT
1485 WINAPI
1486 _lread(
1487   _In_ HFILE hFile,
1488   _Out_writes_bytes_to_(uBytes, return) LPVOID lpBuffer,
1489   _In_ UINT uBytes);
1490 
1491 UINT
1492 WINAPI
1493 _lwrite(
1494   _In_ HFILE hFile,
1495   _In_reads_bytes_(uBytes) LPCCH lpBuffer,
1496   _In_ UINT uBytes);
1497 
1498 BOOL WINAPI AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,PDWORD,PDWORD,PBOOL);
1499 
1500 BOOL
1501 WINAPI
1502 AccessCheckAndAuditAlarmA(
1503   _In_ LPCSTR SubsystemName,
1504   _In_opt_ LPVOID HandleId,
1505   _In_ LPSTR ObjectTypeName,
1506   _In_opt_ LPSTR ObjectName,
1507   _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1508   _In_ DWORD DesiredAccess,
1509   _In_ PGENERIC_MAPPING GenericMapping,
1510   _In_ BOOL ObjectCreation,
1511   _Out_ LPDWORD GrantedAccess,
1512   _Out_ LPBOOL AccessStatus,
1513   _Out_ LPBOOL pfGenerateOnClose);
1514 
1515 BOOL WINAPI AccessCheckAndAuditAlarmW(LPCWSTR,LPVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,PDWORD,PBOOL,PBOOL);
1516 #if (_WIN32_WINNT >= 0x0600)
1517 VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK);
1518 VOID WINAPI AcquireSRWLockShared(PSRWLOCK);
1519 #endif
1520 #if (_WIN32_WINNT >= 0x0501)
1521 BOOL WINAPI ActivateActCtx(_Inout_opt_ HANDLE, _Out_ ULONG_PTR*);
1522 #endif
1523 BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1524 BOOL WINAPI AddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1525 #if (_WIN32_WINNT >= 0x0500)
1526 BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1527 BOOL WINAPI AddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1528 BOOL WINAPI AddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
1529 BOOL WINAPI AddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
1530 #endif
1531 BOOL WINAPI AddAce(PACL,DWORD,DWORD,PVOID,DWORD);
1532 ATOM WINAPI AddAtomA(_In_opt_ LPCSTR);
1533 ATOM WINAPI AddAtomW(_In_opt_ LPCWSTR);
1534 BOOL WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
1535 #if (_WIN32_WINNT >= 0x0500)
1536 BOOL WINAPI AddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
1537 #endif
1538 #if (_WIN32_WINNT >= 0x0501)
1539 void WINAPI AddRefActCtx(_Inout_ HANDLE);
1540 #endif
1541 #if (_WIN32_WINNT >= 0x0500)
1542 _Ret_maybenull_ PVOID WINAPI AddVectoredExceptionHandler(_In_ ULONG, _In_ PVECTORED_EXCEPTION_HANDLER);
1543 _Ret_maybenull_ PVOID WINAPI AddVectoredContinueHandler(_In_ ULONG, _In_ PVECTORED_EXCEPTION_HANDLER);
1544 #endif
1545 BOOL WINAPI AccessCheckByType(PSECURITY_DESCRIPTOR,PSID,HANDLE,DWORD,POBJECT_TYPE_LIST,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL);
1546 BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD);
1547 BOOL WINAPI AdjustTokenPrivileges(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1548 BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID*);
1549 BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
1550 BOOL WINAPI AllocateLocallyUniqueId(PLUID);
1551 BOOL WINAPI AreAllAccessesGranted(DWORD,DWORD);
1552 BOOL WINAPI AreAnyAccessesGranted(DWORD,DWORD);
1553 BOOL WINAPI AreFileApisANSI(void);
1554 BOOL WINAPI BackupEventLogA(_In_ HANDLE, _In_ LPCSTR);
1555 BOOL WINAPI BackupEventLogW(_In_ HANDLE, _In_ LPCWSTR);
1556 
1557 BOOL
1558 WINAPI
1559 BackupRead(
1560   _In_ HANDLE hFile,
1561   _Out_writes_bytes_to_(nNumberOfBytesToRead, *lpNumberOfBytesRead) LPBYTE lpBuffer,
1562   _In_ DWORD nNumberOfBytesToRead,
1563   _Out_ LPDWORD lpNumberOfBytesRead,
1564   _In_ BOOL bAbort,
1565   _In_ BOOL bProcessSecurity,
1566   _Inout_ LPVOID *lpContext);
1567 
1568 BOOL WINAPI BackupSeek(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _Out_ LPDWORD, _Out_ LPDWORD, _Inout_ LPVOID*);
1569 
1570 BOOL
1571 WINAPI
1572 BackupWrite(
1573   _In_ HANDLE hFile,
1574   _In_reads_bytes_(nNumberOfBytesToWrite) LPBYTE lpBuffer,
1575   _In_ DWORD nNumberOfBytesToWrite,
1576   _Out_ LPDWORD lpNumberOfBytesWritten,
1577   _In_ BOOL bAbort,
1578   _In_ BOOL bProcessSecurity,
1579   _Inout_ LPVOID *lpContext);
1580 
1581 BOOL WINAPI Beep(DWORD,DWORD);
1582 HANDLE WINAPI BeginUpdateResourceA(_In_ LPCSTR, _In_ BOOL);
1583 HANDLE WINAPI BeginUpdateResourceW(_In_ LPCWSTR, _In_ BOOL);
1584 #if (_WIN32_WINNT >= 0x0500)
1585 BOOL WINAPI BindIoCompletionCallback(_In_ HANDLE, _In_ LPOVERLAPPED_COMPLETION_ROUTINE, _In_ ULONG);
1586 #endif
1587 BOOL WINAPI BuildCommDCBA(_In_ LPCSTR, _Out_ LPDCB);
1588 BOOL WINAPI BuildCommDCBW(_In_ LPCWSTR, _Out_ LPDCB);
1589 BOOL WINAPI BuildCommDCBAndTimeoutsA(_In_ LPCSTR, _Out_ LPDCB, _Out_ LPCOMMTIMEOUTS);
1590 BOOL WINAPI BuildCommDCBAndTimeoutsW(_In_ LPCWSTR, _Out_ LPDCB, _Out_ LPCOMMTIMEOUTS);
1591 
1592 BOOL
1593 WINAPI
1594 CallNamedPipeA(
1595   _In_ LPCSTR lpNamedPipeName,
1596   _In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer,
1597   _In_ DWORD nInBufferSize,
1598   _Out_writes_bytes_to_opt_(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer,
1599   _In_ DWORD nOutBufferSize,
1600   _Out_ LPDWORD lpBytesRead,
1601   _In_ DWORD nTimeOut);
1602 
1603 BOOL
1604 WINAPI
1605 CallNamedPipeW(
1606   _In_ LPCWSTR lpNamedPipeName,
1607   _In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer,
1608   _In_ DWORD nInBufferSize,
1609   _Out_writes_bytes_to_opt_(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer,
1610   _In_ DWORD nOutBufferSize,
1611   _Out_ LPDWORD lpBytesRead,
1612   _In_ DWORD nTimeOut);
1613 
1614 BOOL WINAPI CancelDeviceWakeupRequest(_In_ HANDLE);
1615 BOOL WINAPI CancelIo(HANDLE);
1616 #if (_WIN32_WINNT >= 0x0600)
1617 BOOL WINAPI CancelIoEx(HANDLE,LPOVERLAPPED);
1618 BOOL WINAPI CancelSynchronousIo(HANDLE);
1619 #endif
1620 BOOL WINAPI CancelWaitableTimer(HANDLE);
1621 
1622 #if (_WIN32_WINNT >= 0x0501)
1623 
1624 BOOL
1625 WINAPI
1626 CheckNameLegalDOS8Dot3A(
1627   _In_ LPCSTR lpName,
1628   _Out_writes_opt_(OemNameSize) LPSTR lpOemName,
1629   _In_ DWORD OemNameSize,
1630   _Out_opt_ PBOOL pbNameContainsSpaces,
1631   _Out_ PBOOL pbNameLegal);
1632 
1633 BOOL
1634 WINAPI
1635 CheckNameLegalDOS8Dot3W(
1636   _In_ LPCWSTR lpName,
1637   _Out_writes_opt_(OemNameSize) LPSTR lpOemName,
1638   _In_ DWORD OemNameSize,
1639   _Out_opt_ PBOOL pbNameContainsSpaces,
1640   _Out_ PBOOL pbNameLegal);
1641 
1642 BOOL WINAPI CheckRemoteDebuggerPresent(_In_ HANDLE, _Out_ PBOOL);
1643 #endif
1644 
1645 BOOL WINAPI ClearCommBreak(_In_ HANDLE);
1646 BOOL WINAPI ClearCommError(_In_ HANDLE, _Out_opt_ PDWORD, _Out_opt_ LPCOMSTAT);
1647 BOOL WINAPI ClearEventLogA(_In_ HANDLE, _In_opt_ LPCSTR);
1648 BOOL WINAPI ClearEventLogW(_In_ HANDLE, _In_opt_ LPCWSTR);
1649 BOOL WINAPI CloseEventLog(_In_ HANDLE);
1650 BOOL WINAPI CloseHandle(HANDLE);
1651 BOOL WINAPI CommConfigDialogA(_In_ LPCSTR, _In_opt_ HWND, _Inout_ LPCOMMCONFIG);
1652 BOOL WINAPI CommConfigDialogW(_In_ LPCWSTR, _In_opt_ HWND, _Inout_ LPCOMMCONFIG);
1653 LONG WINAPI CompareFileTime(CONST FILETIME*,CONST FILETIME*);
1654 BOOL WINAPI ConnectNamedPipe(HANDLE,LPOVERLAPPED);
1655 BOOL WINAPI ContinueDebugEvent(DWORD,DWORD,DWORD);
1656 #if (_WIN32_WINNT >= 0x0400)
1657 BOOL WINAPI ConvertFiberToThread(void);
1658 #endif
1659 _Ret_maybenull_ PVOID WINAPI ConvertThreadToFiber(_In_opt_ PVOID);
1660 BOOL WINAPI CopyFileA(_In_ LPCSTR, _In_ LPCSTR, _In_ BOOL);
1661 BOOL WINAPI CopyFileW(_In_ LPCWSTR lpExistingFileName, _In_ LPCWSTR lpNewFileName, _In_ BOOL bFailIfExists);
1662 BOOL WINAPI CopyFileExA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPPROGRESS_ROUTINE, _In_opt_ LPVOID, _In_opt_ LPBOOL, _In_ DWORD);
1663 BOOL WINAPI CopyFileExW(_In_ LPCWSTR, _In_ LPCWSTR, _In_opt_ LPPROGRESS_ROUTINE, _In_opt_ LPVOID, _In_opt_ LPBOOL, _In_ DWORD);
1664 #define MoveMemory RtlMoveMemory
1665 #define CopyMemory RtlCopyMemory
1666 #define FillMemory RtlFillMemory
1667 #define ZeroMemory RtlZeroMemory
1668 #define SecureZeroMemory RtlSecureZeroMemory
1669 BOOL WINAPI CopySid(DWORD,PSID,PSID);
1670 #if (_WIN32_WINNT >= 0x0501)
1671 HANDLE WINAPI CreateActCtxA(_In_ PCACTCTXA);
1672 HANDLE WINAPI CreateActCtxW(_In_ PCACTCTXW);
1673 #endif
1674 BOOL WINAPI CreateDirectoryA(LPCSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1675 BOOL WINAPI CreateDirectoryW(LPCWSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1676 BOOL WINAPI CreateDirectoryExA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPSECURITY_ATTRIBUTES);
1677 BOOL WINAPI CreateDirectoryExW(_In_ LPCWSTR, _In_ LPCWSTR, _In_opt_ LPSECURITY_ATTRIBUTES);
1678 HANDLE WINAPI CreateEventA(_In_opt_ LPSECURITY_ATTRIBUTES lpEventAttributes, _In_ BOOL bManualReset, _In_ BOOL bInitialState, _In_opt_ LPCSTR lpName);
1679 HANDLE WINAPI CreateEventW(_In_opt_ LPSECURITY_ATTRIBUTES,_In_ BOOL bManualReset, _In_ BOOL bInitialState,_In_opt_ LPCWSTR lpName);
1680 #if (_WIN32_WINNT >= 0x0600)
1681 HANDLE WINAPI CreateEventExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD);
1682 HANDLE WINAPI CreateEventExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD);
1683 #endif
1684 _Ret_maybenull_ LPVOID WINAPI CreateFiber(_In_ SIZE_T, _In_ LPFIBER_START_ROUTINE, _In_opt_ LPVOID);
1685 #if (_WIN32_WINNT >= 0x0400)
1686 _Ret_maybenull_ LPVOID WINAPI CreateFiberEx(_In_ SIZE_T, _In_ SIZE_T, _In_ DWORD, _In_ LPFIBER_START_ROUTINE, _In_opt_ LPVOID);
1687 #endif
1688 HANDLE WINAPI CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
1689 HANDLE WINAPI CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
1690 _Ret_maybenull_ HANDLE WINAPI CreateFileMappingA(_In_ HANDLE, _In_opt_ LPSECURITY_ATTRIBUTES, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR);
1691 HANDLE WINAPI CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCWSTR);
1692 #if (_WIN32_WINNT >= 0x0500)
1693 BOOL WINAPI CreateHardLinkA(_In_ LPCSTR, _In_ LPCSTR, _Reserved_ LPSECURITY_ATTRIBUTES);
1694 BOOL WINAPI CreateHardLinkW(_In_ LPCWSTR, _In_ LPCWSTR, _Reserved_ LPSECURITY_ATTRIBUTES);
1695 #endif
1696 HANDLE WINAPI CreateIoCompletionPort(HANDLE,HANDLE,ULONG_PTR,DWORD);
1697 #if (_WIN32_WINNT >= 0x0500)
1698 _Ret_maybenull_ HANDLE WINAPI CreateJobObjectA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_opt_ LPCSTR);
1699 _Ret_maybenull_ HANDLE WINAPI CreateJobObjectW(_In_opt_ LPSECURITY_ATTRIBUTES, _In_opt_ LPCWSTR);
1700 BOOL WINAPI TerminateJobObject(_In_ HANDLE, _In_ UINT);
1701 BOOL WINAPI AssignProcessToJobObject(_In_ HANDLE, _In_ HANDLE);
1702 #endif
1703 HANDLE WINAPI CreateMailslotA(_In_ LPCSTR, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES);
1704 HANDLE WINAPI CreateMailslotW(_In_ LPCWSTR, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES);
1705 #if (_WIN32_WINNT >= 0x0501)
1706 HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE);
1707 #endif
1708 HANDLE WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1709 HANDLE WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1710 #if (_WIN32_WINNT >= 0x0600)
1711 HANDLE WINAPI CreateMutexExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD);
1712 HANDLE WINAPI CreateMutexExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD);
1713 #endif
1714 HANDLE WINAPI CreateNamedPipeA(_In_ LPCSTR, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES);
1715 HANDLE WINAPI CreateNamedPipeW(_In_ LPCWSTR, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES);
1716 BOOL WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
1717 BOOL WINAPI CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOL,HANDLE,PGENERIC_MAPPING);
1718 BOOL WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
1719 BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1720 
1721 BOOL
1722 WINAPI
1723 CreateProcessAsUserA(
1724   _In_opt_ HANDLE,
1725   _In_opt_ LPCSTR,
1726   _Inout_opt_ LPSTR,
1727   _In_opt_ LPSECURITY_ATTRIBUTES,
1728   _In_opt_ LPSECURITY_ATTRIBUTES,
1729   _In_ BOOL,
1730   _In_ DWORD,
1731   _In_opt_ PVOID,
1732   _In_opt_ LPCSTR,
1733   _In_ LPSTARTUPINFOA,
1734   _Out_ LPPROCESS_INFORMATION);
1735 
1736 BOOL WINAPI CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1737 BOOL WINAPI CreateProcessWithLogonW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPCWSTR,LPWSTR,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1738 BOOL WINAPI CreateProcessWithTokenW(HANDLE,DWORD,LPCWSTR,LPWSTR,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1739 HANDLE WINAPI CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
1740 
1741 BOOL
1742 WINAPI
1743 CreateRestrictedToken(
1744   _In_ HANDLE ExistingTokenHandle,
1745   _In_ DWORD Flags,
1746   _In_ DWORD DisableSidCount,
1747   _In_reads_opt_(DisableSidCount) PSID_AND_ATTRIBUTES SidsToDisable,
1748   _In_ DWORD DeletePrivilegeCount,
1749   _In_reads_opt_(DeletePrivilegeCount) PLUID_AND_ATTRIBUTES PrivilegesToDelete,
1750   _In_ DWORD RestrictedSidCount,
1751   _In_reads_opt_(RestrictedSidCount) PSID_AND_ATTRIBUTES SidsToRestrict,
1752   _Outptr_ PHANDLE NewTokenHandle);
1753 
1754 _Ret_maybenull_ HANDLE WINAPI CreateSemaphoreA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ LONG, _In_ LONG, _In_opt_ LPCSTR);
1755 _Ret_maybenull_ HANDLE WINAPI CreateSemaphoreW(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ LONG, _In_ LONG, _In_opt_ LPCWSTR);
1756 #if (_WIN32_WINNT >= 0x0600)
1757 _Ret_maybenull_ HANDLE WINAPI CreateSemaphoreExA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ LONG, _In_ LONG, _In_opt_ LPCSTR, _Reserved_ DWORD, _In_ DWORD);
1758 HANDLE WINAPI CreateSemaphoreExW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR,DWORD,DWORD);
1759 #endif
1760 DWORD WINAPI CreateTapePartition(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ DWORD);
1761 
1762 #if (_WIN32_WINNT >= 0x0500)
1763 
1764 HANDLE WINAPI CreateTimerQueue(void);
1765 
1766 BOOL
1767 WINAPI
1768 CreateTimerQueueTimer(
1769   _Outptr_ PHANDLE,
1770   _In_opt_ HANDLE,
1771   _In_ WAITORTIMERCALLBACK,
1772   _In_opt_ PVOID,
1773   _In_ DWORD,
1774   _In_ DWORD,
1775   _In_ ULONG);
1776 
1777 _Must_inspect_result_
1778 BOOL
1779 WINAPI
1780 ChangeTimerQueueTimer(
1781   _In_opt_ HANDLE TimerQueue,
1782   _Inout_ HANDLE Timer,
1783   _In_ ULONG DueTime,
1784   _In_ ULONG Period);
1785 
1786 #endif /* (_WIN32_WINNT >= 0x0500) */
1787 
1788 HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD);
1789 _Ret_maybenull_ HANDLE WINAPI CreateWaitableTimerA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ BOOL, _In_opt_ LPCSTR);
1790 _Ret_maybenull_ HANDLE WINAPI CreateWaitableTimerW(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ BOOL, _In_opt_ LPCWSTR);
1791 #if (_WIN32_WINNT >= 0x0600)
1792 _Ret_maybenull_ HANDLE WINAPI CreateWaitableTimerExA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_opt_ LPCSTR, _In_ DWORD, _In_ DWORD);
1793 HANDLE WINAPI CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD);
1794 #endif
1795 #if (_WIN32_WINNT >= 0x0501)
1796 BOOL WINAPI CreateWellKnownSid(WELL_KNOWN_SID_TYPE,PSID,PSID,DWORD*);
1797 BOOL WINAPI DeactivateActCtx(_In_ DWORD, _In_ ULONG_PTR);
1798 #endif
1799 BOOL WINAPI DebugActiveProcess(DWORD);
1800 #if (_WIN32_WINNT >= 0x0501)
1801 BOOL WINAPI DebugActiveProcessStop(DWORD);
1802 #endif
1803 void WINAPI DebugBreak(void);
1804 #if (_WIN32_WINNT >= 0x0501)
1805 BOOL WINAPI DebugBreakProcess(_In_ HANDLE);
1806 BOOL WINAPI DebugSetProcessKillOnExit(_In_ BOOL);
1807 #endif
1808 PVOID WINAPI DecodePointer(PVOID);
1809 PVOID WINAPI DecodeSystemPointer(PVOID);
1810 BOOL WINAPI DecryptFileA(_In_ LPCSTR, _Reserved_ DWORD);
1811 BOOL WINAPI DecryptFileW(_In_ LPCWSTR, _Reserved_ DWORD);
1812 BOOL WINAPI DefineDosDeviceA(_In_ DWORD, _In_ LPCSTR, _In_opt_ LPCSTR);
1813 BOOL WINAPI DefineDosDeviceW(DWORD,LPCWSTR,LPCWSTR);
1814 #define DefineHandleTable(w) ((w),TRUE)
1815 BOOL WINAPI DeleteAce(PACL,DWORD);
1816 ATOM WINAPI DeleteAtom(_In_ ATOM);
1817 void WINAPI DeleteCriticalSection(PCRITICAL_SECTION);
1818 void WINAPI DeleteFiber(_In_ PVOID);
1819 BOOL WINAPI DeleteFileA(LPCSTR);
1820 BOOL WINAPI DeleteFileW(LPCWSTR);
1821 #if (_WIN32_WINNT >= 0x0500)
1822 _Must_inspect_result_ BOOL WINAPI DeleteTimerQueue(_In_ HANDLE);
1823 BOOL WINAPI DeleteTimerQueueEx(HANDLE,HANDLE);
1824 BOOL WINAPI DeleteTimerQueueTimer(HANDLE,HANDLE,HANDLE);
1825 BOOL WINAPI DeleteVolumeMountPointA(_In_ LPCSTR);
1826 BOOL WINAPI DeleteVolumeMountPointW(LPCWSTR);
1827 #endif
1828 BOOL WINAPI DeregisterEventSource(_In_ HANDLE);
1829 BOOL WINAPI DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR*);
1830 BOOL WINAPI DeviceIoControl(HANDLE,DWORD,PVOID,DWORD,PVOID,DWORD,PDWORD,POVERLAPPED);
1831 BOOL WINAPI DisableThreadLibraryCalls(HMODULE);
1832 
1833 #if (_WIN32_WINNT >= 0x0500)
1834 
1835 _Success_(return != FALSE)
1836 BOOL
1837 WINAPI
1838 DnsHostnameToComputerNameA(
1839   _In_ LPCSTR Hostname,
1840   _Out_writes_to_opt_(*nSize, *nSize + 1) LPSTR ComputerName,
1841   _Inout_ LPDWORD nSize);
1842 
1843 _Success_(return != FALSE)
1844 BOOL
1845 WINAPI
1846 DnsHostnameToComputerNameW(
1847   _In_ LPCWSTR Hostname,
1848   _Out_writes_to_opt_(*nSize, *nSize + 1) LPWSTR ComputerName,
1849   _Inout_ LPDWORD nSize);
1850 
1851 #endif
1852 
1853 BOOL WINAPI DisconnectNamedPipe(HANDLE);
1854 BOOL WINAPI DosDateTimeToFileTime(_In_ WORD, _In_ WORD, _Out_ LPFILETIME);
1855 BOOL WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,PHANDLE,DWORD,BOOL,DWORD);
1856 BOOL WINAPI DuplicateToken(HANDLE,SECURITY_IMPERSONATION_LEVEL,PHANDLE);
1857 BOOL WINAPI DuplicateTokenEx(HANDLE,DWORD,LPSECURITY_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1858 PVOID WINAPI EncodePointer(PVOID);
1859 PVOID WINAPI EncodeSystemPointer(PVOID);
1860 BOOL WINAPI EncryptFileA(_In_ LPCSTR);
1861 BOOL WINAPI EncryptFileW(_In_ LPCWSTR);
1862 BOOL WINAPI EndUpdateResourceA(_In_ HANDLE, _In_ BOOL);
1863 BOOL WINAPI EndUpdateResourceW(_In_ HANDLE, _In_ BOOL);
1864 void WINAPI EnterCriticalSection(LPCRITICAL_SECTION);
1865 BOOL WINAPI EnumResourceLanguagesA(_In_opt_ HMODULE, _In_ LPCSTR, _In_ LPCSTR, _In_ ENUMRESLANGPROCA, _In_ LONG_PTR);
1866 BOOL WINAPI EnumResourceLanguagesW(_In_opt_ HMODULE, _In_ LPCWSTR, _In_ LPCWSTR, _In_ ENUMRESLANGPROCW, _In_ LONG_PTR);
1867 BOOL WINAPI EnumResourceNamesA(_In_opt_ HMODULE, _In_ LPCSTR, _In_ ENUMRESNAMEPROCA, _In_ LONG_PTR);
1868 BOOL WINAPI EnumResourceNamesW(_In_opt_ HMODULE, _In_ LPCWSTR, _In_ ENUMRESNAMEPROCW, _In_ LONG_PTR);
1869 BOOL WINAPI EnumResourceTypesA(_In_opt_ HMODULE, _In_ ENUMRESTYPEPROCA, _In_ LONG_PTR);
1870 BOOL WINAPI EnumResourceTypesW(_In_opt_ HMODULE, _In_ ENUMRESTYPEPROCW, _In_ LONG_PTR);
1871 BOOL WINAPI EqualPrefixSid(PSID,PSID);
1872 BOOL WINAPI EqualSid(PSID,PSID);
1873 DWORD WINAPI EraseTape(_In_ HANDLE, _In_ DWORD, _In_ BOOL);
1874 BOOL WINAPI EscapeCommFunction(_In_ HANDLE, _In_ DWORD);
1875 DECLSPEC_NORETURN void WINAPI ExitProcess(UINT);
1876 DECLSPEC_NORETURN void WINAPI ExitThread(_In_ DWORD dwExitCode);
1877 DWORD WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD);
1878 DWORD WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD);
1879 void WINAPI FatalAppExitA(UINT,LPCSTR);
1880 void WINAPI FatalAppExitW(UINT,LPCWSTR);
1881 __analysis_noreturn void WINAPI FatalExit(_In_ int);
1882 BOOL WINAPI FileEncryptionStatusA(_In_ LPCSTR, _Out_ LPDWORD);
1883 BOOL WINAPI FileEncryptionStatusW(_In_ LPCWSTR, _Out_ LPDWORD);
1884 BOOL WINAPI FileTimeToDosDateTime(_In_ CONST FILETIME *, _Out_ LPWORD, _Out_ LPWORD);
1885 BOOL WINAPI FileTimeToLocalFileTime(CONST FILETIME *,LPFILETIME);
1886 BOOL WINAPI FileTimeToSystemTime(CONST FILETIME *,LPSYSTEMTIME);
1887 #if (_WIN32_WINNT >= 0x0501)
1888 BOOL WINAPI FindActCtxSectionGuid(_In_ DWORD, _Reserved_ const GUID*, _In_ ULONG, _In_opt_ const GUID*, _Out_ PACTCTX_SECTION_KEYED_DATA);
1889 BOOL WINAPI FindActCtxSectionStringA(_In_ DWORD, _Reserved_ const GUID*, _In_ ULONG, _In_ LPCSTR, _Out_ PACTCTX_SECTION_KEYED_DATA);
1890 BOOL WINAPI FindActCtxSectionStringW(_In_ DWORD, _Reserved_ const GUID*, _In_ ULONG, _In_ LPCWSTR, _Out_ PACTCTX_SECTION_KEYED_DATA);
1891 #endif
1892 ATOM WINAPI FindAtomA(_In_opt_ LPCSTR);
1893 ATOM WINAPI FindAtomW(_In_opt_ LPCWSTR);
1894 BOOL WINAPI FindClose(HANDLE);
1895 BOOL WINAPI FindCloseChangeNotification(HANDLE);
1896 HANDLE WINAPI FindFirstChangeNotificationA(LPCSTR,BOOL,DWORD);
1897 HANDLE WINAPI FindFirstChangeNotificationW(LPCWSTR,BOOL,DWORD);
1898 HANDLE WINAPI FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
1899 HANDLE WINAPI FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW);
1900 HANDLE WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD);
1901 HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD);
1902 #if (_WIN32_WINNT >= 0x0501)
1903 HANDLE WINAPI FindFirstStreamW(_In_ LPCWSTR, _In_ STREAM_INFO_LEVELS, _Out_ LPVOID, _Reserved_ DWORD);
1904 #endif
1905 BOOL WINAPI FindFirstFreeAce(PACL,PVOID*);
1906 
1907 #if (_WIN32_WINNT >= 0x0500)
1908 
1909 HANDLE
1910 WINAPI
1911 FindFirstVolumeA(
1912   _Out_writes_(cchBufferLength) LPSTR lpszVolumeName,
1913   _In_ DWORD cchBufferLength);
1914 
1915 HANDLE WINAPI FindFirstVolumeW(LPWSTR,DWORD);
1916 
1917 HANDLE
1918 WINAPI
1919 FindFirstVolumeMountPointA(
1920   _In_ LPCSTR lpszRootPathName,
1921   _Out_writes_(cchBufferLength) LPSTR lpszVolumeMountPoint,
1922   _In_ DWORD cchBufferLength);
1923 
1924 HANDLE
1925 WINAPI
1926 FindFirstVolumeMountPointW(
1927   _In_ LPCWSTR lpszRootPathName,
1928   _Out_writes_(cchBufferLength) LPWSTR lpszVolumeMountPoint,
1929   _In_ DWORD cchBufferLength);
1930 
1931 #endif
1932 
1933 BOOL WINAPI FindNextChangeNotification(HANDLE);
1934 BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
1935 BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
1936 #if (_WIN32_WINNT >= 0x0501)
1937 BOOL WINAPI FindNextStreamW(_In_ HANDLE, _Out_ LPVOID);
1938 #endif
1939 
1940 #if (_WIN32_WINNT >= 0x0500)
1941 
1942 BOOL
1943 WINAPI
1944 FindNextVolumeA(
1945   _Inout_ HANDLE hFindVolume,
1946   _Out_writes_(cchBufferLength) LPSTR lpszVolumeName,
1947   _In_ DWORD cchBufferLength);
1948 
1949 BOOL WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD);
1950 
1951 BOOL
1952 WINAPI
1953 FindNextVolumeMountPointA(
1954   _In_ HANDLE hFindVolumeMountPoint,
1955   _Out_writes_(cchBufferLength) LPSTR lpszVolumeMountPoint,
1956   _In_ DWORD cchBufferLength);
1957 
1958 BOOL
1959 WINAPI
1960 FindNextVolumeMountPointW(
1961   _In_ HANDLE hFindVolumeMountPoint,
1962   _Out_writes_(cchBufferLength) LPWSTR lpszVolumeMountPoint,
1963   _In_ DWORD cchBufferLength);
1964 
1965 BOOL WINAPI FindVolumeClose(HANDLE);
1966 BOOL WINAPI FindVolumeMountPointClose(_In_ HANDLE);
1967 
1968 #endif
1969 
1970 _Ret_maybenull_ HRSRC WINAPI FindResourceA(_In_opt_ HMODULE,_In_ LPCSTR, _In_ LPCSTR);
1971 _Ret_maybenull_ HRSRC WINAPI FindResourceW(_In_opt_ HMODULE,_In_ LPCWSTR, _In_ LPCWSTR);
1972 _Ret_maybenull_ HRSRC WINAPI FindResourceExA(_In_opt_ HMODULE, _In_ LPCSTR, _In_ LPCSTR, _In_ WORD);
1973 HRSRC WINAPI FindResourceExW(HINSTANCE,LPCWSTR,LPCWSTR,WORD);
1974 #if (_WIN32_WINNT >= 0x0502)
1975 
1976 DWORD
1977 WINAPI
1978 GetFirmwareEnvironmentVariableA(
1979   _In_ LPCSTR lpName,
1980   _In_ LPCSTR lpGuid,
1981   _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer,
1982   _In_ DWORD nSize);
1983 
1984 DWORD
1985 WINAPI
1986 GetFirmwareEnvironmentVariableW(
1987   _In_ LPCWSTR lpName,
1988   _In_ LPCWSTR lpGuid,
1989   _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer,
1990   _In_ DWORD nSize);
1991 
1992 #endif
1993 BOOL WINAPI FlushFileBuffers(HANDLE);
1994 BOOL WINAPI FlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1995 BOOL WINAPI FlushViewOfFile(LPCVOID,SIZE_T);
1996 DWORD WINAPI FlsAlloc(PFLS_CALLBACK_FUNCTION);
1997 PVOID WINAPI FlsGetValue(DWORD);
1998 BOOL WINAPI FlsSetValue(DWORD,PVOID);
1999 BOOL WINAPI FlsFree(DWORD);
2000 DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, va_list* Arguments);
2001 DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list* Arguments);
2002 BOOL WINAPI FreeEnvironmentStringsA(LPSTR);
2003 BOOL WINAPI FreeEnvironmentStringsW(LPWSTR);
2004 BOOL WINAPI FreeLibrary(HMODULE);
2005 DECLSPEC_NORETURN void WINAPI FreeLibraryAndExitThread(HMODULE,DWORD);
2006 #define FreeModule(m) FreeLibrary(m)
2007 #define FreeProcInstance(p) (void)(p)
2008 #ifndef XFree86Server
2009 BOOL WINAPI FreeResource(HGLOBAL);
2010 #endif /* ndef XFree86Server */
2011 PVOID WINAPI FreeSid(PSID);
2012 BOOL WINAPI GetAce(PACL,DWORD,LPVOID*);
2013 BOOL WINAPI GetAclInformation(PACL,PVOID,DWORD,ACL_INFORMATION_CLASS);
2014 #if (_WIN32_WINNT >= 0x0600)
2015 HRESULT WINAPI GetApplicationRecoveryCallback(_In_ HANDLE, _Out_ APPLICATION_RECOVERY_CALLBACK*, _Outptr_opt_result_maybenull_ PVOID*, _Out_opt_ DWORD*, _Out_opt_ DWORD*);
2016 HRESULT WINAPI GetApplicationRestart(HANDLE,PWSTR,PDWORD,PDWORD);
2017 #endif
2018 
2019 UINT
2020 WINAPI
2021 GetAtomNameA(
2022   _In_ ATOM nAtom,
2023   _Out_writes_to_(nSize, return + 1) LPSTR lpBuffer,
2024   _In_ int nSize);
2025 
2026 UINT
2027 WINAPI
2028 GetAtomNameW(
2029   _In_ ATOM nAtom,
2030   _Out_writes_to_(nSize, return + 1) LPWSTR lpBuffer,
2031   _In_ int nSize);
2032 
2033 BOOL WINAPI GetBinaryTypeA(_In_ LPCSTR, _Out_ PDWORD);
2034 BOOL WINAPI GetBinaryTypeW(_In_ LPCWSTR, _Out_ PDWORD);
2035 LPSTR WINAPI GetCommandLineA(VOID);
2036 LPWSTR WINAPI GetCommandLineW(VOID);
2037 
2038 _Success_(return != FALSE)
2039 BOOL
2040 WINAPI
2041 GetCommConfig(
2042   _In_ HANDLE hCommDev,
2043   _Out_writes_bytes_opt_(*lpdwSize) LPCOMMCONFIG lpCC,
2044   _Inout_ LPDWORD lpdwSize);
2045 
2046 BOOL WINAPI GetCommMask(_In_ HANDLE, _Out_ PDWORD);
2047 BOOL WINAPI GetCommModemStatus(_In_ HANDLE, _Out_ PDWORD);
2048 BOOL WINAPI GetCommProperties(_In_ HANDLE, _Inout_ LPCOMMPROP);
2049 BOOL WINAPI GetCommState(_In_ HANDLE, _Out_ LPDCB);
2050 BOOL WINAPI GetCommTimeouts(_In_ HANDLE, _Out_ LPCOMMTIMEOUTS);
2051 DWORD WINAPI GetCompressedFileSizeA(_In_ LPCSTR, _Out_opt_ PDWORD);
2052 DWORD WINAPI GetCompressedFileSizeW(_In_ LPCWSTR, _Out_opt_ PDWORD);
2053 
2054 _Success_(return != 0)
2055 BOOL
2056 WINAPI
2057 GetComputerNameA(
2058   _Out_writes_to_opt_(*nSize, *nSize + 1) LPSTR lpBuffer,
2059   _Inout_ LPDWORD nSize);
2060 
2061 _Success_(return != 0)
2062 BOOL
2063 WINAPI
2064 GetComputerNameW(
2065   _Out_writes_to_opt_(*nSize, *nSize + 1) LPWSTR lpBuffer,
2066   _Inout_ LPDWORD nSize);
2067 
2068 #if (_WIN32_WINNT >= 0x0500)
2069 BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
2070 BOOL WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT,LPWSTR,LPDWORD);
2071 #endif
2072 #if (_WIN32_WINNT >= 0x0501)
2073 BOOL WINAPI GetCurrentActCtx( _Outptr_ HANDLE*);
2074 #endif
2075 DWORD WINAPI GetCurrentDirectoryA(DWORD,LPSTR);
2076 DWORD WINAPI GetCurrentDirectoryW(DWORD,LPWSTR);
2077 BOOL WINAPI GetCurrentHwProfileA(_Out_ LPHW_PROFILE_INFOA);
2078 BOOL WINAPI GetCurrentHwProfileW(_Out_ LPHW_PROFILE_INFOW);
2079 HANDLE WINAPI GetCurrentProcess(void);
2080 DWORD WINAPI GetCurrentProcessId(void);
2081 HANDLE WINAPI GetCurrentThread(void);
2082 DWORD WINAPI GetCurrentThreadId(void);
2083 #define GetCurrentTime GetTickCount
2084 
2085 BOOL
2086 WINAPI
2087 GetDefaultCommConfigA(
2088   _In_ LPCSTR lpszName,
2089   _Out_writes_bytes_to_(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC,
2090   _Inout_ LPDWORD lpdwSize);
2091 
2092 BOOL
2093 WINAPI
2094 GetDefaultCommConfigW(
2095   _In_ LPCWSTR lpszName,
2096   _Out_writes_bytes_to_(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC,
2097   _Inout_ LPDWORD lpdwSize);
2098 
2099 BOOL WINAPI GetDiskFreeSpaceA(LPCSTR,PDWORD,PDWORD,PDWORD,PDWORD);
2100 BOOL WINAPI GetDiskFreeSpaceW(LPCWSTR,PDWORD,PDWORD,PDWORD,PDWORD);
2101 BOOL WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
2102 BOOL WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
2103 
2104 #if (_WIN32_WINNT >= 0x0502)
2105 
2106 _Success_(return != 0 && return < nBufferLength)
2107 DWORD
2108 WINAPI
2109 GetDllDirectoryA(
2110   _In_ DWORD nBufferLength,
2111   _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer);
2112 
2113 _Success_(return != 0 && return < nBufferLength)
2114 DWORD
2115 WINAPI
2116 GetDllDirectoryW(
2117   _In_ DWORD nBufferLength,
2118   _Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer);
2119 
2120 #endif
2121 
2122 UINT WINAPI GetDriveTypeA(LPCSTR);
2123 UINT WINAPI GetDriveTypeW(LPCWSTR);
2124 LPSTR WINAPI GetEnvironmentStrings(void);
2125 LPWSTR WINAPI GetEnvironmentStringsW(void);
2126 DWORD WINAPI GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
2127 DWORD WINAPI GetEnvironmentVariableW(LPCWSTR,LPWSTR,DWORD);
2128 BOOL WINAPI GetExitCodeProcess(HANDLE,PDWORD);
2129 BOOL WINAPI GetExitCodeThread(HANDLE,PDWORD);
2130 DWORD WINAPI GetFileAttributesA(LPCSTR);
2131 #if (_WIN32_WINNT >= 0x0600)
2132 BOOL WINAPI GetFileAttributesByHandle(HANDLE,LPDWORD,DWORD);
2133 DWORD WINAPI GetFinalPathNameByHandleA(HANDLE,LPSTR,DWORD,DWORD);
2134 DWORD WINAPI GetFinalPathNameByHandleW(HANDLE,LPWSTR,DWORD,DWORD);
2135 #endif
2136 DWORD WINAPI GetFileAttributesW(LPCWSTR);
2137 BOOL WINAPI GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,PVOID);
2138 BOOL WINAPI GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,PVOID);
2139 #if (_WIN32_WINNT >= 0x0600)
2140 BOOL WINAPI GetFileBandwidthReservation(_In_ HANDLE, _Out_ LPDWORD, _Out_ LPDWORD, _Out_ LPBOOL, _Out_ LPDWORD, _Out_ LPDWORD);
2141 #endif
2142 BOOL WINAPI GetFileInformationByHandle(HANDLE,LPBY_HANDLE_FILE_INFORMATION);
2143 
2144 #if (_WIN32_WINNT >= 0x0600)
2145 BOOL
2146 WINAPI
2147 GetFileInformationByHandleEx(
2148   _In_ HANDLE hFile,
2149   _In_ FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
2150   _Out_writes_bytes_(dwBufferSize) LPVOID lpFileInformation,
2151   _In_ DWORD dwBufferSize);
2152 #endif
2153 
2154 BOOL
2155 WINAPI
2156 GetFileSecurityA(
2157   _In_ LPCSTR lpFileName,
2158   _In_ SECURITY_INFORMATION RequestedInformation,
2159   _Out_writes_bytes_to_opt_(nLength, *lpnLengthNeeded) PSECURITY_DESCRIPTOR pSecurityDescriptor,
2160   _In_ DWORD nLength,
2161   _Out_ LPDWORD lpnLengthNeeded);
2162 
2163 BOOL WINAPI GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
2164 DWORD WINAPI GetFileSize(HANDLE,PDWORD);
2165 BOOL WINAPI GetFileSizeEx(HANDLE,PLARGE_INTEGER);
2166 BOOL WINAPI GetFileTime(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME);
2167 DWORD WINAPI GetFileType(HANDLE);
2168 #define GetFreeSpace(w) (0x100000L)
2169 DWORD WINAPI GetFullPathNameA(LPCSTR,DWORD,LPSTR,LPSTR*);
2170 DWORD WINAPI GetFullPathNameW(LPCWSTR,DWORD,LPWSTR,LPWSTR*);
2171 BOOL WINAPI GetHandleInformation(HANDLE,PDWORD);
2172 BOOL WINAPI GetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
2173 DWORD WINAPI GetLastError(void);
2174 DWORD WINAPI GetLengthSid(PSID);
2175 void WINAPI GetLocalTime(LPSYSTEMTIME);
2176 DWORD WINAPI GetLogicalDrives(void);
2177 
2178 _Success_(return != 0 && return <= nBufferLength)
2179 DWORD
2180 WINAPI
2181 GetLogicalDriveStringsA(
2182   _In_ DWORD nBufferLength,
2183   _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer);
2184 
2185 DWORD WINAPI GetLogicalDriveStringsW(DWORD,LPWSTR);
2186 #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
2187 DWORD WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
2188 DWORD WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
2189 #endif
2190 BOOL WINAPI GetMailslotInfo(_In_ HANDLE, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD);
2191 DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule,LPSTR lpFilename,DWORD nSize);
2192 DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule,LPWSTR lpFilename,DWORD nSize);
2193 HMODULE WINAPI GetModuleHandleA(LPCSTR);
2194 HMODULE WINAPI GetModuleHandleW(LPCWSTR);
2195 #if (_WIN32_WINNT >= 0x0500)
2196 BOOL WINAPI GetModuleHandleExA(DWORD,LPCSTR,HMODULE*);
2197 BOOL WINAPI GetModuleHandleExW(DWORD,LPCWSTR,HMODULE*);
2198 #endif
2199 
2200 #if _WIN32_WINNT >= 0x0502
2201 WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathA(LPCSTR ExeName);
2202 WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathW(LPCWSTR ExeName);
2203 #endif
2204 
2205 BOOL
2206 WINAPI
2207 GetNamedPipeHandleStateA(
2208   _In_ HANDLE hNamedPipe,
2209   _Out_opt_ LPDWORD lpState,
2210   _Out_opt_ LPDWORD lpCurInstances,
2211   _Out_opt_ LPDWORD lpMaxCollectionCount,
2212   _Out_opt_ LPDWORD lpCollectDataTimeout,
2213   _Out_writes_opt_(nMaxUserNameSize) LPSTR lpUserName,
2214   _In_ DWORD nMaxUserNameSize);
2215 
2216 BOOL
2217 WINAPI
2218 GetNamedPipeHandleStateW(
2219   _In_ HANDLE hNamedPipe,
2220   _Out_opt_ LPDWORD lpState,
2221   _Out_opt_ LPDWORD lpCurInstances,
2222   _Out_opt_ LPDWORD lpMaxCollectionCount,
2223   _Out_opt_ LPDWORD lpCollectDataTimeout,
2224   _Out_writes_opt_(nMaxUserNameSize) LPWSTR lpUserName,
2225   _In_ DWORD nMaxUserNameSize);
2226 
2227 BOOL WINAPI GetNamedPipeInfo(_In_ HANDLE, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD);
2228 #if (_WIN32_WINNT >= 0x0501)
2229 VOID WINAPI GetNativeSystemInfo(LPSYSTEM_INFO);
2230 #endif
2231 
2232 BOOL
2233 WINAPI
2234 GetEventLogInformation(
2235   _In_ HANDLE hEventLog,
2236   _In_ DWORD dwInfoLevel,
2237   _Out_writes_bytes_to_(cbBufSize, *pcbBytesNeeded) LPVOID lpBuffer,
2238   _In_ DWORD cbBufSize,
2239   _Out_ LPDWORD pcbBytesNeeded);
2240 
2241 BOOL WINAPI GetNumberOfEventLogRecords(_In_ HANDLE, _Out_ PDWORD);
2242 BOOL WINAPI GetOldestEventLogRecord(_In_ HANDLE, _Out_ PDWORD);
2243 BOOL WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,PDWORD,BOOL);
2244 DWORD WINAPI GetPriorityClass(HANDLE);
2245 BOOL WINAPI GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
2246 UINT WINAPI GetPrivateProfileIntA(_In_ LPCSTR, _In_ LPCSTR, _In_ INT, _In_opt_ LPCSTR);
2247 UINT WINAPI GetPrivateProfileIntW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ INT, _In_opt_ LPCWSTR);
2248 
2249 DWORD
2250 WINAPI
2251 GetPrivateProfileSectionA(
2252   _In_ LPCSTR lpAppName,
2253   _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
2254   _In_ DWORD nSize,
2255   _In_opt_ LPCSTR lpFileName);
2256 
2257 DWORD
2258 WINAPI
2259 GetPrivateProfileSectionW(
2260   _In_ LPCWSTR lpAppName,
2261   _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
2262   _In_ DWORD nSize,
2263   _In_opt_ LPCWSTR lpFileName);
2264 
2265 DWORD
2266 WINAPI
2267 GetPrivateProfileSectionNamesA(
2268   _Out_writes_to_opt_(nSize, return + 1) LPSTR lpszReturnBuffer,
2269   _In_ DWORD nSize,
2270   _In_opt_ LPCSTR lpFileName);
2271 
2272 DWORD
2273 WINAPI
2274 GetPrivateProfileSectionNamesW(
2275   _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpszReturnBuffer,
2276   _In_ DWORD nSize,
2277   _In_opt_ LPCWSTR lpFileName);
2278 
2279 DWORD
2280 WINAPI
2281 GetPrivateProfileStringA(
2282   _In_opt_ LPCSTR lpAppName,
2283   _In_opt_ LPCSTR lpKeyName,
2284   _In_opt_ LPCSTR lpDefault,
2285   _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
2286   _In_ DWORD nSize,
2287   _In_opt_ LPCSTR lpFileName);
2288 
2289 DWORD
2290 WINAPI
2291 GetPrivateProfileStringW(
2292   _In_opt_ LPCWSTR lpAppName,
2293   _In_opt_ LPCWSTR lpKeyName,
2294   _In_opt_ LPCWSTR lpDefault,
2295   _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
2296   _In_ DWORD nSize,
2297   _In_opt_ LPCWSTR lpFileName);
2298 
2299 BOOL
2300 WINAPI
2301 GetPrivateProfileStructA(
2302   _In_ LPCSTR lpszSection,
2303   _In_ LPCSTR lpszKey,
2304   _Out_writes_bytes_opt_(uSizeStruct) LPVOID lpStruct,
2305   _In_ UINT uSizeStruct,
2306   _In_opt_ LPCSTR szFile);
2307 
2308 BOOL
2309 WINAPI
2310 GetPrivateProfileStructW(
2311   _In_ LPCWSTR lpszSection,
2312   _In_ LPCWSTR lpszKey,
2313   _Out_writes_bytes_opt_(uSizeStruct) LPVOID lpStruct,
2314   _In_ UINT uSizeStruct,
2315   _In_opt_ LPCWSTR szFile);
2316 
2317 FARPROC WINAPI GetProcAddress(HINSTANCE,LPCSTR);
2318 BOOL WINAPI GetProcessAffinityMask(_In_ HANDLE, _Out_ PDWORD_PTR, _Out_ PDWORD_PTR);
2319 #if (_WIN32_WINNT >= 0x0502)
2320 BOOL WINAPI GetProcessHandleCount(_In_ HANDLE, _Out_ PDWORD);
2321 #endif
2322 HANDLE WINAPI GetProcessHeap(VOID);
2323 DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE);
2324 #if (_WIN32_WINNT >= 0x0502)
2325 DWORD WINAPI GetProcessId(HANDLE);
2326 DWORD WINAPI GetProcessIdOfThread(HANDLE);
2327 #endif
2328 #if (_WIN32_WINNT >= 0x0500)
2329 BOOL WINAPI GetProcessIoCounters(_In_ HANDLE, _Out_ PIO_COUNTERS);
2330 #endif
2331 BOOL WINAPI GetProcessPriorityBoost(_In_ HANDLE, _Out_ PBOOL);
2332 BOOL WINAPI GetProcessShutdownParameters(_Out_ PDWORD, _Out_ PDWORD);
2333 BOOL WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
2334 DWORD WINAPI GetProcessVersion(DWORD);
2335 HWINSTA WINAPI GetProcessWindowStation(void);
2336 BOOL WINAPI GetProcessWorkingSetSize(_In_ HANDLE, _Out_ PSIZE_T, _Out_ PSIZE_T);
2337 UINT WINAPI GetProfileIntA(_In_ LPCSTR, _In_ LPCSTR, _In_ INT);
2338 UINT WINAPI GetProfileIntW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ INT);
2339 
2340 DWORD
2341 WINAPI
2342 GetProfileSectionA(
2343   _In_ LPCSTR lpAppName,
2344   _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
2345   _In_ DWORD nSize);
2346 
2347 DWORD
2348 WINAPI
2349 GetProfileSectionW(
2350   _In_ LPCWSTR lpAppName,
2351   _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
2352   _In_ DWORD nSize);
2353 
2354 DWORD
2355 WINAPI
2356 GetProfileStringA(
2357   _In_opt_ LPCSTR lpAppName,
2358   _In_opt_ LPCSTR lpKeyName,
2359   _In_opt_ LPCSTR lpDefault,
2360   _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
2361   _In_ DWORD nSize);
2362 
2363 DWORD
2364 WINAPI
2365 GetProfileStringW(
2366   _In_opt_ LPCWSTR lpAppName,
2367   _In_opt_ LPCWSTR lpKeyName,
2368   _In_opt_ LPCWSTR lpDefault,
2369   _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
2370   _In_ DWORD nSize);
2371 
2372 BOOL WINAPI GetQueuedCompletionStatus(HANDLE,PDWORD,PULONG_PTR,LPOVERLAPPED*,DWORD);
2373 BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,PDWORD);
2374 BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL*,LPBOOL);
2375 BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID*,LPBOOL);
2376 DWORD WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
2377 BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID*,LPBOOL);
2378 DWORD WINAPI GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR,PUCHAR);
2379 BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL*,LPBOOL);
2380 
2381 _Success_(return != 0 && return < cchBuffer)
2382 DWORD
2383 WINAPI
2384 GetShortPathNameA(
2385   _In_ LPCSTR lpszLongPath,
2386   _Out_writes_to_opt_(cchBuffer, return + 1) LPSTR  lpszShortPath,
2387   _In_ DWORD cchBuffer);
2388 
2389 DWORD WINAPI GetShortPathNameW(LPCWSTR,LPWSTR,DWORD);
2390 PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
2391 DWORD WINAPI GetSidLengthRequired(UCHAR);
2392 PDWORD WINAPI GetSidSubAuthority(PSID,DWORD);
2393 PUCHAR WINAPI GetSidSubAuthorityCount(PSID);
2394 VOID WINAPI GetStartupInfoA(_Out_ LPSTARTUPINFOA);
2395 VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW);
2396 HANDLE WINAPI GetStdHandle(_In_ DWORD);
2397 UINT WINAPI GetSystemDirectoryA(LPSTR,UINT);
2398 UINT WINAPI GetSystemDirectoryW(LPWSTR,UINT);
2399 
2400 WINBASEAPI
2401 UINT
2402 WINAPI
2403 GetSystemFirmwareTable(
2404   _In_ DWORD FirmwareTableProviderSignature,
2405   _In_ DWORD FirmwareTableID,
2406   _Out_writes_bytes_to_opt_(BufferSize,return) PVOID pFirmwareTableBuffer,
2407   _In_ DWORD BufferSize);
2408 
2409 VOID WINAPI GetSystemInfo(LPSYSTEM_INFO);
2410 BOOL WINAPI GetSystemPowerStatus(_Out_ LPSYSTEM_POWER_STATUS);
2411 #if (_WIN32_WINNT >= 0x0502)
2412 BOOL WINAPI GetSystemRegistryQuota(_Out_opt_ PDWORD, _Out_opt_ PDWORD);
2413 #endif
2414 VOID WINAPI GetSystemTime(LPSYSTEMTIME lpSystemTime);
2415 #if (_WIN32_WINNT >= 0x0501)
2416 BOOL WINAPI GetSystemTimes(_Out_opt_ LPFILETIME, _Out_opt_ LPFILETIME, _Out_opt_ LPFILETIME);
2417 #endif
2418 BOOL WINAPI GetSystemTimeAdjustment(PDWORD,PDWORD,PBOOL);
2419 void WINAPI GetSystemTimeAsFileTime(LPFILETIME);
2420 #if (_WIN32_WINNT >= 0x0500)
2421 UINT WINAPI GetSystemWindowsDirectoryA(LPSTR,UINT);
2422 UINT WINAPI GetSystemWindowsDirectoryW(LPWSTR,UINT);
2423 #endif
2424 
2425 #if (_WIN32_WINNT >= 0x0501)
2426 
2427 _Success_(return != 0 && return < uSize)
2428 UINT
2429 WINAPI
2430 GetSystemWow64DirectoryA(
2431   _Out_writes_to_opt_(uSize, return + 1) LPSTR lpBuffer,
2432   _In_ UINT uSize);
2433 
2434 _Success_(return != 0 && return < uSize)
2435 UINT
2436 WINAPI
2437 GetSystemWow64DirectoryW(
2438   _Out_writes_to_opt_(uSize, return + 1) LPWSTR lpBuffer,
2439   _In_ UINT uSize);
2440 
2441 #endif
2442 
2443 DWORD
2444 WINAPI
2445 GetTapeParameters(
2446   _In_ HANDLE hDevice,
2447   _In_ DWORD dwOperation,
2448   _Inout_ LPDWORD lpdwSize,
2449   _Out_writes_bytes_(*lpdwSize) LPVOID lpTapeInformation);
2450 
2451 DWORD WINAPI GetTapePosition(_In_ HANDLE, _In_ DWORD, _Out_ PDWORD, _Out_ PDWORD, _Out_ PDWORD);
2452 DWORD WINAPI GetTapeStatus(_In_ HANDLE);
2453 
2454 UINT
2455 WINAPI
2456 GetTempFileNameA(
2457   _In_ LPCSTR lpPathName,
2458   _In_ LPCSTR lpPrefixString,
2459   _In_ UINT uUnique,
2460   _Out_writes_(MAX_PATH) LPSTR lpTempFileName);
2461 
2462 UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
2463 
2464 DWORD
2465 WINAPI
2466 GetTempPathA(
2467   _In_ DWORD nBufferLength,
2468   _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer);
2469 
2470 DWORD WINAPI GetTempPathW(DWORD,LPWSTR);
2471 BOOL WINAPI GetThreadContext(HANDLE,LPCONTEXT);
2472 #if (_WIN32_WINNT >= 0x0502)
2473 BOOL WINAPI GetThreadIOPendingFlag(_In_ HANDLE, _Out_ PBOOL);
2474 #endif
2475 int WINAPI GetThreadPriority(HANDLE);
2476 BOOL WINAPI GetThreadPriorityBoost(HANDLE,PBOOL);
2477 BOOL WINAPI GetThreadSelectorEntry(_In_ HANDLE, _In_ DWORD, _Out_ LPLDT_ENTRY);
2478 BOOL WINAPI GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
2479 DWORD WINAPI GetTickCount(VOID);
2480 #if (_WIN32_WINNT >= 0x0600)
2481 ULONGLONG WINAPI GetTickCount64(VOID);
2482 #endif
2483 DWORD WINAPI GetThreadId(HANDLE);
2484 DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
2485 BOOL WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,DWORD,PDWORD);
2486 
2487 BOOL
2488 WINAPI
2489 GetUserNameA(
2490   _Out_writes_to_opt_(*pcbBuffer, *pcbBuffer) LPSTR lpBuffer,
2491   _Inout_ LPDWORD pcbBuffer);
2492 
2493 BOOL
2494 WINAPI
2495 GetUserNameW(
2496   _Out_writes_to_opt_(*pcbBuffer, *pcbBuffer) LPWSTR lpBuffer,
2497   _Inout_ LPDWORD pcbBuffer);
2498 
2499 DWORD WINAPI GetVersion(void);
2500 BOOL WINAPI GetVersionExA(LPOSVERSIONINFOA);
2501 BOOL WINAPI GetVersionExW(LPOSVERSIONINFOW);
2502 
2503 BOOL
2504 WINAPI
2505 GetVolumeInformationA(
2506   _In_opt_ LPCSTR lpRootPathName,
2507   _Out_writes_opt_(nVolumeNameSize) LPSTR lpVolumeNameBuffer,
2508   _In_ DWORD nVolumeNameSize,
2509   _Out_opt_ LPDWORD lpVolumeSerialNumber,
2510   _Out_opt_ LPDWORD lpMaximumComponentLength,
2511   _Out_opt_ LPDWORD lpFileSystemFlags,
2512   _Out_writes_opt_(nFileSystemNameSize) LPSTR lpFileSystemNameBuffer,
2513   _In_ DWORD nFileSystemNameSize);
2514 
2515 BOOL WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,PDWORD,PDWORD,PDWORD,LPWSTR,DWORD);
2516 
2517 #if (_WIN32_WINNT >= 0x0500)
2518 
2519 BOOL
2520 WINAPI
2521 GetVolumeNameForVolumeMountPointA(
2522   _In_ LPCSTR lpszVolumeMountPoint,
2523   _Out_writes_(cchBufferLength) LPSTR lpszVolumeName,
2524   _In_ DWORD cchBufferLength);
2525 
2526 BOOL WINAPI GetVolumeNameForVolumeMountPointW(LPCWSTR,LPWSTR,DWORD);
2527 
2528 BOOL
2529 WINAPI
2530 GetVolumePathNameA(
2531   _In_ LPCSTR lpszFileName,
2532   _Out_writes_(cchBufferLength) LPSTR lpszVolumePathName,
2533   _In_ DWORD cchBufferLength);
2534 
2535 BOOL WINAPI GetVolumePathNameW(LPCWSTR,LPWSTR,DWORD);
2536 
2537 #endif
2538 
2539 #if (_WIN32_WINNT >= 0x0501)
2540 
2541 BOOL
2542 WINAPI
2543 GetVolumePathNamesForVolumeNameA(
2544   _In_ LPCSTR lpszVolumeName,
2545   _Out_writes_to_opt_(cchBufferLength, *lpcchReturnLength) _Post_ _NullNull_terminated_ LPCH lpszVolumePathNames,
2546   _In_ DWORD cchBufferLength,
2547   _Out_ PDWORD lpcchReturnLength);
2548 
2549 BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD);
2550 
2551 #endif
2552 
2553 UINT WINAPI GetWindowsDirectoryA(LPSTR,UINT);
2554 UINT WINAPI GetWindowsDirectoryW(LPWSTR,UINT);
2555 DWORD WINAPI GetWindowThreadProcessId(HWND hWnd,PDWORD lpdwProcessId);
2556 UINT WINAPI GetWriteWatch(DWORD,PVOID,SIZE_T,PVOID*,PULONG_PTR,PULONG);
2557 ATOM WINAPI GlobalAddAtomA(_In_opt_ LPCSTR);
2558 ATOM WINAPI GlobalAddAtomW(_In_opt_ LPCWSTR);
2559 HGLOBAL WINAPI GlobalAlloc(UINT,SIZE_T);
2560 SIZE_T WINAPI GlobalCompact(_In_ DWORD); /* Obsolete: Has no effect. */
2561 ATOM WINAPI GlobalDeleteAtom(_In_ ATOM);
2562 #define GlobalDiscard(m) GlobalReAlloc((m),0,GMEM_MOVEABLE)
2563 ATOM WINAPI GlobalFindAtomA(_In_opt_ LPCSTR);
2564 ATOM WINAPI GlobalFindAtomW(_In_opt_ LPCWSTR);
2565 VOID WINAPI GlobalFix(_In_ HGLOBAL); /* Obsolete: Has no effect. */
2566 UINT WINAPI GlobalFlags(_In_ HGLOBAL); /* Obsolete: Has no effect. */
2567 HGLOBAL WINAPI GlobalFree(HGLOBAL);
2568 
2569 UINT
2570 WINAPI
2571 GlobalGetAtomNameA(
2572   _In_ ATOM nAtom,
2573   _Out_writes_to_(nSize, return + 1) LPSTR lpBuffer,
2574   _In_ int nSize);
2575 
2576 UINT
2577 WINAPI
2578 GlobalGetAtomNameW(
2579   _In_ ATOM nAtom,
2580   _Out_writes_to_(nSize, return + 1) LPWSTR lpBuffer,
2581   _In_ int nSize);
2582 
2583 _Ret_maybenull_ HGLOBAL WINAPI GlobalHandle(_In_ LPCVOID);
2584 _Ret_maybenull_ LPVOID WINAPI GlobalLock(_In_ HGLOBAL);
2585 VOID WINAPI GlobalMemoryStatus(_Out_ LPMEMORYSTATUS);
2586 #if (_WIN32_WINNT >= 0x0500)
2587 BOOL WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX);
2588 #endif
2589 HGLOBAL WINAPI GlobalReAlloc(HGLOBAL,SIZE_T,UINT);
2590 SIZE_T WINAPI GlobalSize(_In_ HGLOBAL);
2591 VOID WINAPI GlobalUnfix(_In_ HGLOBAL); /* Obsolete: Has no effect. */
2592 BOOL WINAPI GlobalUnlock(_In_ HGLOBAL);
2593 BOOL WINAPI GlobalUnWire(_In_ HGLOBAL); /* Obsolete: Has no effect. */
2594 PVOID WINAPI GlobalWire(_In_ HGLOBAL); /* Obsolete: Has no effect. */
2595 #define HasOverlappedIoCompleted(lpOverlapped)  ((lpOverlapped)->Internal != STATUS_PENDING)
2596 PVOID WINAPI HeapAlloc(HANDLE,DWORD,SIZE_T);
2597 SIZE_T WINAPI HeapCompact(HANDLE,DWORD);
2598 HANDLE WINAPI HeapCreate(DWORD,SIZE_T,SIZE_T);
2599 BOOL WINAPI HeapDestroy(HANDLE);
2600 BOOL WINAPI HeapFree(HANDLE,DWORD,PVOID);
2601 BOOL WINAPI HeapLock(HANDLE);
2602 #if (_WIN32_WINNT >= 0x0501)
2603 BOOL WINAPI HeapQueryInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
2604 #endif
2605 PVOID WINAPI HeapReAlloc(HANDLE,DWORD,PVOID,SIZE_T);
2606 #if (_WIN32_WINNT >= 0x0501)
2607 BOOL WINAPI HeapSetInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
2608 #endif
2609 SIZE_T WINAPI HeapSize(HANDLE,DWORD,LPCVOID);
2610 BOOL WINAPI HeapUnlock(HANDLE);
2611 BOOL WINAPI HeapValidate(HANDLE,DWORD,LPCVOID);
2612 BOOL WINAPI HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
2613 BOOL WINAPI ImpersonateAnonymousToken(HANDLE);
2614 BOOL WINAPI ImpersonateLoggedOnUser(HANDLE);
2615 BOOL WINAPI ImpersonateNamedPipeClient(HANDLE);
2616 BOOL WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
2617 BOOL WINAPI InitAtomTable(_In_ DWORD);
2618 BOOL WINAPI InitializeAcl(PACL,DWORD,DWORD);
2619 #if (_WIN32_WINNT >= 0x0600)
2620 VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE);
2621 #endif
2622 VOID WINAPI InitializeCriticalSection(LPCRITICAL_SECTION);
2623 BOOL WINAPI InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION,DWORD);
2624 DWORD WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION,DWORD);
2625 BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
2626 BOOL WINAPI InitializeSid (PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
2627 
2628 #if (_WIN32_WINNT >= 0x0600)
2629 VOID WINAPI InitializeSRWLock(PSRWLOCK);
2630 #endif
2631 
2632 BOOL WINAPI IsBadCodePtr(_In_opt_ FARPROC);
2633 BOOL WINAPI IsBadHugeReadPtr(_In_opt_ CONST VOID*, _In_ UINT_PTR);
2634 BOOL WINAPI IsBadHugeWritePtr(_In_opt_ PVOID, _In_ UINT_PTR);
2635 BOOL WINAPI IsBadReadPtr(_In_opt_ CONST VOID*, _In_ UINT_PTR);
2636 BOOL WINAPI IsBadStringPtrA(_In_opt_ LPCSTR, _In_ UINT_PTR);
2637 BOOL WINAPI IsBadStringPtrW(_In_opt_ LPCWSTR, _In_ UINT_PTR);
2638 BOOL WINAPI IsBadWritePtr(_In_opt_ PVOID, _In_ UINT_PTR);
2639 BOOL WINAPI IsDebuggerPresent(void);
2640 #if (_WIN32_WINNT >= 0x0501)
2641 BOOL WINAPI IsProcessInJob(HANDLE,HANDLE,PBOOL);
2642 #endif
2643 BOOL WINAPI IsProcessorFeaturePresent(DWORD);
2644 BOOL WINAPI IsSystemResumeAutomatic(void);
2645 
2646 BOOL
2647 WINAPI
2648 IsTextUnicode(
2649   _In_reads_bytes_(iSize) CONST VOID *lpv,
2650   _In_ int iSize,
2651   _Inout_opt_ LPINT lpiResult);
2652 
2653 #if (_WIN32_WINNT >= 0x0600)
2654 BOOL WINAPI IsThreadAFiber(VOID);
2655 #endif
2656 BOOL WINAPI IsValidAcl(PACL);
2657 BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
2658 BOOL WINAPI IsValidSid(PSID);
2659 #if (_WIN32_WINNT >= 0x0501)
2660 BOOL WINAPI IsWellKnownSid(PSID,WELL_KNOWN_SID_TYPE);
2661 BOOL WINAPI IsWow64Process(HANDLE,PBOOL);
2662 #endif
2663 void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION);
2664 #define LimitEmsPages(n)
2665 _Ret_maybenull_ HINSTANCE WINAPI LoadLibraryA(_In_ LPCSTR);
2666 _Ret_maybenull_ HINSTANCE WINAPI LoadLibraryW(_In_ LPCWSTR);
2667 HINSTANCE WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD);
2668 HINSTANCE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);
2669 DWORD WINAPI LoadModule(_In_ LPCSTR, _In_ PVOID);
2670 HGLOBAL WINAPI LoadResource(HINSTANCE,HRSRC);
2671 HLOCAL WINAPI LocalAlloc(UINT,SIZE_T);
2672 SIZE_T WINAPI LocalCompact(_In_ UINT); /* Obsolete: Has no effect. */
2673 #define LocalDiscard(m) (LocalReAlloc((m),0,LMEM_MOVEABLE))
2674 BOOL WINAPI LocalFileTimeToFileTime(CONST FILETIME *,LPFILETIME);
2675 UINT WINAPI LocalFlags(_In_ HLOCAL); /* Obsolete: Has no effect. */
2676 HLOCAL WINAPI LocalFree(HLOCAL);
2677 _Ret_maybenull_ HLOCAL WINAPI LocalHandle(_In_ LPCVOID);
2678 PVOID WINAPI LocalLock(HLOCAL);
2679 HLOCAL WINAPI LocalReAlloc(HLOCAL,SIZE_T,UINT);
2680 SIZE_T WINAPI LocalShrink(_In_ HLOCAL, _In_ UINT);  /* Obsolete: Has no effect. */
2681 SIZE_T WINAPI LocalSize(_In_ HLOCAL);
2682 BOOL WINAPI LocalUnlock(HLOCAL);
2683 BOOL WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
2684 BOOL WINAPI LockFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPOVERLAPPED);
2685 PVOID WINAPI LockResource(HGLOBAL);
2686 #define LockSegment(w) GlobalFix((HANDLE)(w)) /* Obsolete: Has no effect. */
2687 BOOL WINAPI LogonUserA(_In_ LPSTR, _In_opt_ LPSTR, _In_opt_ LPSTR, _In_ DWORD, _In_ DWORD, _Outptr_ PHANDLE);
2688 BOOL WINAPI LogonUserW(_In_ LPWSTR, _In_opt_ LPWSTR, _In_opt_ LPWSTR, _In_ DWORD, _In_ DWORD, _Outptr_ PHANDLE);
2689 
2690 _Success_(return != FALSE)
2691 BOOL
2692 WINAPI
2693 LogonUserExA(
2694   _In_ LPSTR lpszUsername,
2695   _In_opt_ LPSTR lpszDomain,
2696   _In_opt_ LPSTR lpszPassword,
2697   _In_ DWORD dwLogonType,
2698   _In_ DWORD dwLogonProvider,
2699   _Out_opt_ PHANDLE phToken,
2700   _Out_opt_ PSID *ppLogonSid,
2701   _Out_opt_ PVOID *ppProfileBuffer,
2702   _Out_opt_ LPDWORD pdwProfileLength,
2703   _Out_opt_ PQUOTA_LIMITS pQuotaLimits);
2704 
2705 _Success_(return != FALSE)
2706 BOOL
2707 WINAPI
2708 LogonUserExW(
2709   _In_ LPWSTR lpszUsername,
2710   _In_opt_ LPWSTR lpszDomain,
2711   _In_opt_ LPWSTR lpszPassword,
2712   _In_ DWORD dwLogonType,
2713   _In_ DWORD dwLogonProvider,
2714   _Out_opt_ PHANDLE phToken,
2715   _Out_opt_ PSID *ppLogonSid,
2716   _Out_opt_ PVOID *ppProfileBuffer,
2717   _Out_opt_ LPDWORD pdwProfileLength,
2718   _Out_opt_ PQUOTA_LIMITS pQuotaLimits);
2719 
2720 _Success_(return != FALSE)
2721 BOOL
2722 WINAPI
2723 LookupAccountNameA(
2724   _In_opt_ LPCSTR lpSystemName,
2725   _In_ LPCSTR lpAccountName,
2726   _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid,
2727   _Inout_ LPDWORD cbSid,
2728   _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPSTR ReferencedDomainName,
2729   _Inout_ LPDWORD cchReferencedDomainName,
2730   _Out_ PSID_NAME_USE peUse);
2731 
2732 _Success_(return != FALSE)
2733 BOOL
2734 WINAPI
2735 LookupAccountNameW(
2736   _In_opt_ LPCWSTR lpSystemName,
2737   _In_ LPCWSTR lpAccountName,
2738   _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid,
2739   _Inout_ LPDWORD cbSid,
2740   _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPWSTR ReferencedDomainName,
2741   _Inout_ LPDWORD cchReferencedDomainName,
2742   _Out_ PSID_NAME_USE peUse);
2743 
2744 _Success_(return != FALSE)
2745 BOOL
2746 WINAPI
2747 LookupAccountSidA(
2748   _In_opt_ LPCSTR lpSystemName,
2749   _In_ PSID Sid,
2750   _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR Name,
2751   _Inout_ LPDWORD cchName,
2752   _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPSTR ReferencedDomainName,
2753   _Inout_ LPDWORD cchReferencedDomainName,
2754   _Out_ PSID_NAME_USE peUse);
2755 
2756 _Success_(return != FALSE)
2757 BOOL
2758 WINAPI
2759 LookupAccountSidW(
2760   _In_opt_ LPCWSTR lpSystemName,
2761   _In_ PSID Sid,
2762   _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR Name,
2763   _Inout_  LPDWORD cchName,
2764   _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPWSTR ReferencedDomainName,
2765   _Inout_ LPDWORD cchReferencedDomainName,
2766   _Out_ PSID_NAME_USE peUse);
2767 
2768 _Success_(return != FALSE)
2769 BOOL
2770 WINAPI
2771 LookupPrivilegeDisplayNameA(
2772   _In_opt_ LPCSTR lpSystemName,
2773   _In_ LPCSTR lpName,
2774   _Out_writes_to_opt_(*cchDisplayName, *cchDisplayName + 1) LPSTR lpDisplayName,
2775   _Inout_ LPDWORD cchDisplayName,
2776   _Out_ LPDWORD lpLanguageId);
2777 
2778 _Success_(return != FALSE)
2779 BOOL
2780 WINAPI
2781 LookupPrivilegeDisplayNameW(
2782   _In_opt_ LPCWSTR lpSystemName,
2783   _In_ LPCWSTR lpName,
2784   _Out_writes_to_opt_(*cchDisplayName, *cchDisplayName + 1) LPWSTR lpDisplayName,
2785   _Inout_ LPDWORD cchDisplayName,
2786   _Out_ LPDWORD lpLanguageId);
2787 
2788 _Success_(return != FALSE)
2789 BOOL
2790 WINAPI
2791 LookupPrivilegeNameA(
2792   _In_opt_ LPCSTR lpSystemName,
2793   _In_ PLUID lpLuid,
2794   _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR lpName,
2795   _Inout_ LPDWORD cchName);
2796 
2797 _Success_(return != FALSE)
2798 BOOL
2799 WINAPI
2800 LookupPrivilegeNameW(
2801   _In_opt_ LPCWSTR lpSystemName,
2802   _In_ PLUID lpLuid,
2803   _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR lpName,
2804   _Inout_ LPDWORD cchName);
2805 
2806 BOOL WINAPI LookupPrivilegeValueA(_In_opt_ LPCSTR, _In_ LPCSTR, _Out_ PLUID);
2807 BOOL WINAPI LookupPrivilegeValueW(_In_opt_ LPCWSTR, _In_ LPCWSTR, _Out_ PLUID);
2808 
2809 LPSTR
2810 WINAPI
2811 lstrcatA(
2812   _Inout_updates_z_(_String_length_(lpString1) + _String_length_(lpString2) + 1) LPSTR lpString1,
2813   _In_ LPCSTR lpString2);
2814 
2815 LPWSTR
2816 WINAPI
2817 lstrcatW(
2818   _Inout_updates_z_(_String_length_(lpString1) + _String_length_(lpString2) + 1) LPWSTR lpString1,
2819   _In_ LPCWSTR lpString2);
2820 
2821 int WINAPI lstrcmpA(LPCSTR,LPCSTR);
2822 int WINAPI lstrcmpiA(LPCSTR,LPCSTR);
2823 int WINAPI lstrcmpiW( LPCWSTR,LPCWSTR);
2824 int WINAPI lstrcmpW(LPCWSTR,LPCWSTR);
2825 
2826 LPSTR
2827 WINAPI
2828 lstrcpyA(
2829   _Out_writes_(_String_length_(lpString2) + 1) LPSTR lpString1,
2830   _In_ LPCSTR lpString2);
2831 
2832 LPWSTR
2833 WINAPI
2834 lstrcpyW(
2835   _Out_writes_(_String_length_(lpString2) + 1) LPWSTR lpString1,
2836   _In_ LPCWSTR lpString2);
2837 
2838 LPSTR WINAPI lstrcpynA(LPSTR,LPCSTR,int);
2839 LPWSTR WINAPI lstrcpynW(LPWSTR,LPCWSTR,int);
2840 int WINAPI lstrlenA(LPCSTR);
2841 int WINAPI lstrlenW(LPCWSTR);
2842 BOOL WINAPI MakeAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
2843 #define MakeProcInstance(p,i) (p)
2844 BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD);
2845 VOID WINAPI MapGenericMask(PDWORD,PGENERIC_MAPPING);
2846 PVOID WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,SIZE_T);
2847 PVOID WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,SIZE_T,PVOID);
2848 BOOL WINAPI MoveFileA(_In_ LPCSTR, _In_ LPCSTR);
2849 BOOL WINAPI MoveFileW(_In_ LPCWSTR, _In_ LPCWSTR);
2850 BOOL WINAPI MoveFileExA(_In_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD);
2851 BOOL WINAPI MoveFileExW(_In_ LPCWSTR, _In_opt_ LPCWSTR, _In_ DWORD);
2852 BOOL WINAPI MoveFileWithProgressA(_In_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPPROGRESS_ROUTINE, _In_opt_ LPVOID, _In_ DWORD);
2853 BOOL WINAPI MoveFileWithProgressW(_In_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPPROGRESS_ROUTINE, _In_opt_ LPVOID, _In_ DWORD);
2854 int WINAPI MulDiv(_In_ int, _In_ int, _In_ int);
2855 BOOL WINAPI NotifyChangeEventLog(_In_ HANDLE, _In_ HANDLE);
2856 BOOL WINAPI ObjectCloseAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ BOOL);
2857 BOOL WINAPI ObjectCloseAuditAlarmW(LPCWSTR,PVOID,BOOL);
2858 BOOL WINAPI ObjectDeleteAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ BOOL);
2859 BOOL WINAPI ObjectDeleteAuditAlarmW(LPCWSTR,PVOID,BOOL);
2860 BOOL WINAPI ObjectOpenAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ LPSTR, _In_opt_ LPSTR, _In_ PSECURITY_DESCRIPTOR, _In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_opt_ PPRIVILEGE_SET, _In_ BOOL, _In_ BOOL, _Out_ PBOOL);
2861 BOOL WINAPI ObjectOpenAuditAlarmW(LPCWSTR,PVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,PBOOL);
2862 BOOL WINAPI ObjectPrivilegeAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ HANDLE, _In_ DWORD, _In_ PPRIVILEGE_SET, _In_ BOOL);
2863 BOOL WINAPI ObjectPrivilegeAuditAlarmW(LPCWSTR,PVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL);
2864 HANDLE WINAPI OpenBackupEventLogA(_In_opt_ LPCSTR, _In_ LPCSTR);
2865 HANDLE WINAPI OpenBackupEventLogW(_In_opt_ LPCWSTR, _In_ LPCWSTR);
2866 HANDLE WINAPI OpenEventA(DWORD,BOOL,LPCSTR);
2867 HANDLE WINAPI OpenEventLogA(_In_opt_ LPCSTR, _In_ LPCSTR);
2868 HANDLE WINAPI OpenEventLogW(_In_opt_ LPCWSTR, _In_ LPCWSTR);
2869 HANDLE WINAPI OpenEventW(DWORD,BOOL,LPCWSTR);
2870 HFILE WINAPI OpenFile(_In_ LPCSTR, _Inout_ LPOFSTRUCT, _In_ UINT);
2871 #if (_WIN32_WINNT >= 0x0600)
2872 HANDLE WINAPI OpenFileById(_In_ HANDLE, _In_ LPFILE_ID_DESCRIPTOR, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES, _In_ DWORD);
2873 #endif
2874 HANDLE WINAPI OpenFileMappingA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR);
2875 HANDLE WINAPI OpenFileMappingW(DWORD,BOOL,LPCWSTR);
2876 _Ret_maybenull_ HANDLE WINAPI OpenMutexA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR);
2877 HANDLE WINAPI OpenMutexW(DWORD,BOOL,LPCWSTR);
2878 HANDLE WINAPI OpenProcess(DWORD,BOOL,DWORD);
2879 BOOL WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);
2880 _Ret_maybenull_ HANDLE WINAPI OpenSemaphoreA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR);
2881 HANDLE WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR);
2882 #if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0490)
2883 HANDLE WINAPI OpenThread(DWORD,BOOL,DWORD);
2884 #endif
2885 BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE);
2886 _Ret_maybenull_ HANDLE WINAPI OpenWaitableTimerA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR);
2887 HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR);
2888 WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR);
2889 WINBASEAPI void WINAPI OutputDebugStringW(LPCWSTR);
2890 BOOL WINAPI PeekNamedPipe(HANDLE,PVOID,DWORD,PDWORD,PDWORD,PDWORD);
2891 BOOL WINAPI PostQueuedCompletionStatus(HANDLE,DWORD,ULONG_PTR,LPOVERLAPPED);
2892 DWORD WINAPI PrepareTape(_In_ HANDLE, _In_ DWORD, _In_ BOOL);
2893 BOOL WINAPI PrivilegeCheck (HANDLE,PPRIVILEGE_SET,PBOOL);
2894 BOOL WINAPI PrivilegedServiceAuditAlarmA(_In_ LPCSTR, _In_ LPCSTR, _In_ HANDLE, _In_ PPRIVILEGE_SET, _In_ BOOL);
2895 BOOL WINAPI PrivilegedServiceAuditAlarmW(LPCWSTR,LPCWSTR,HANDLE,PPRIVILEGE_SET,BOOL);
2896 #if (_WIN32_WINNT >= 0x0500)
2897 BOOL WINAPI ProcessIdToSessionId(DWORD,DWORD*);
2898 #endif
2899 BOOL WINAPI PulseEvent(HANDLE);
2900 BOOL WINAPI PurgeComm(_In_ HANDLE, _In_ DWORD);
2901 
2902 #if (_WIN32_WINNT >= 0x0501)
2903 BOOL
2904 WINAPI
2905 QueryActCtxW(
2906   _In_ DWORD dwFlags,
2907   _In_ HANDLE hActCtx,
2908   _In_opt_ PVOID pvSubInstance,
2909   _In_ ULONG ulInfoClass,
2910   _Out_writes_bytes_to_opt_(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer,
2911   _In_ SIZE_T cbBuffer,
2912   _Out_opt_ SIZE_T *pcbWrittenOrRequired);
2913 #endif
2914 
2915 DWORD
2916 WINAPI
2917 QueryDosDeviceA(
2918   _In_opt_ LPCSTR lpDeviceName,
2919   _Out_writes_to_opt_(ucchMax, return) LPSTR lpTargetPath,
2920   _In_ DWORD ucchMax);
2921 
2922 DWORD WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);
2923 #if (_WIN32_WINNT >= 0x0501)
2924 BOOL WINAPI QueryMemoryResourceNotification(HANDLE,PBOOL);
2925 #endif
2926 BOOL WINAPI QueryPerformanceCounter(PLARGE_INTEGER);
2927 BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER);
2928 #if (_WIN32_WINNT >= 0x0600)
2929 VOID WINAPI QuerySecurityAccessMask(SECURITY_INFORMATION,LPDWORD);
2930 #endif
2931 DWORD WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
2932 #if (_WIN32_WINNT >= 0x0500)
2933 BOOL WINAPI QueueUserWorkItem(LPTHREAD_START_ROUTINE,PVOID,ULONG);
2934 #endif
2935 void WINAPI RaiseException(DWORD,DWORD,DWORD,const ULONG_PTR*);
2936 
2937 BOOL
2938 WINAPI
2939 QueryInformationJobObject(
2940   _In_opt_ HANDLE hJob,
2941   _In_ JOBOBJECTINFOCLASS JobObjectInformationClass,
2942   _Out_writes_bytes_to_(cbJobObjectInformationLength, *lpReturnLength) LPVOID lpJobObjectInformation,
2943   _In_ DWORD cbJobObjectInformationLength,
2944   _Out_opt_ LPDWORD lpReturnLength);
2945 
2946 BOOL
2947 WINAPI
2948 ReadDirectoryChangesW(
2949   _In_ HANDLE hDirectory,
2950   _Out_writes_bytes_to_(nBufferLength, *lpBytesReturned) LPVOID lpBuffer,
2951   _In_ DWORD nBufferLength,
2952   _In_ BOOL bWatchSubtree,
2953   _In_ DWORD dwNotifyFilter,
2954   _Out_opt_ LPDWORD lpBytesReturned,
2955   _Inout_opt_ LPOVERLAPPED lpOverlapped,
2956   _In_opt_ LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
2957 
2958 BOOL
2959 WINAPI
2960 ReadEventLogA(
2961   _In_ HANDLE hEventLog,
2962   _In_ DWORD dwReadFlags,
2963   _In_ DWORD dwRecordOffset,
2964   _Out_writes_bytes_to_(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffer,
2965   _In_ DWORD nNumberOfBytesToRead,
2966   _Out_ DWORD *pnBytesRead,
2967   _Out_ DWORD *pnMinNumberOfBytesNeeded);
2968 
2969 BOOL
2970 WINAPI
2971 ReadEventLogW(
2972   _In_ HANDLE hEventLog,
2973   _In_ DWORD dwReadFlags,
2974   _In_ DWORD dwRecordOffset,
2975   _Out_writes_bytes_to_(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffer,
2976   _In_ DWORD nNumberOfBytesToRead,
2977   _Out_ DWORD *pnBytesRead,
2978   _Out_ DWORD *pnMinNumberOfBytesNeeded);
2979 
2980 BOOL WINAPI ReadFile(HANDLE,PVOID,DWORD,PDWORD,LPOVERLAPPED);
2981 BOOL WINAPI ReadFileEx(HANDLE,PVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
2982 BOOL WINAPI ReadFileScatter(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED);
2983 BOOL WINAPI ReadProcessMemory(HANDLE,LPCVOID,LPVOID,SIZE_T,PSIZE_T);
2984 #if (_WIN32_WINNT >= 0x0600)
2985 VOID WINAPI RecoveryFinished(BOOL);
2986 HRESULT WINAPI RecoveryInProgress(OUT PBOOL);
2987 HRESULT WINAPI RegisterApplicationRecoveryCallback(_In_ APPLICATION_RECOVERY_CALLBACK, _In_opt_ PVOID, _In_ DWORD, _In_ DWORD);
2988 HRESULT WINAPI RegisterApplicationRestart(_In_opt_ PCWSTR, _In_ DWORD);
2989 #endif
2990 HANDLE WINAPI RegisterEventSourceA(_In_opt_ LPCSTR, _In_ LPCSTR);
2991 HANDLE WINAPI RegisterEventSourceW(_In_opt_ LPCWSTR, _In_ LPCWSTR);
2992 #if (_WIN32_WINNT >= 0x0500)
2993 BOOL WINAPI RegisterWaitForSingleObject(_Outptr_ PHANDLE, _In_ HANDLE, _In_ WAITORTIMERCALLBACK, _In_opt_ PVOID, _In_ ULONG, _In_ ULONG);
2994 HANDLE WINAPI RegisterWaitForSingleObjectEx(HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG);
2995 #endif
2996 #if (_WIN32_WINNT >= 0x0501)
2997 void WINAPI ReleaseActCtx(_Inout_ HANDLE);
2998 #endif
2999 BOOL WINAPI ReleaseMutex(HANDLE);
3000 BOOL WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG);
3001 #if (_WIN32_WINNT >= 0x0600)
3002 VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK);
3003 VOID WINAPI ReleaseSRWLockShared(PSRWLOCK);
3004 #endif
3005 BOOL WINAPI RemoveDirectoryA(LPCSTR);
3006 BOOL WINAPI RemoveDirectoryW(LPCWSTR);
3007 #if (_WIN32_WINNT >= 0x0500)
3008 ULONG WINAPI RemoveVectoredExceptionHandler(_In_ PVOID);
3009 ULONG WINAPI RemoveVectoredContinueHandler(_In_ PVOID);
3010 #endif
3011 #if (_WIN32_WINNT >= 0x0500)
3012 BOOL WINAPI ReplaceFileA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD, _Reserved_ LPVOID, _Reserved_ LPVOID);
3013 BOOL WINAPI ReplaceFileW(_In_ LPCWSTR, _In_ LPCWSTR, _In_opt_ LPCWSTR, _In_ DWORD, _Reserved_ LPVOID, _Reserved_ LPVOID);
3014 #endif
3015 
3016 BOOL
3017 WINAPI
3018 ReportEventA(
3019   _In_ HANDLE hEventLog,
3020   _In_ WORD wType,
3021   _In_ WORD wCategory,
3022   _In_ DWORD dwEventID,
3023   _In_opt_ PSID lpUserSid,
3024   _In_ WORD wNumStrings,
3025   _In_ DWORD dwDataSize,
3026   _In_reads_opt_(wNumStrings) LPCSTR *lpStrings,
3027   _In_reads_bytes_opt_(dwDataSize) LPVOID lpRawData);
3028 
3029 BOOL
3030 WINAPI
3031 ReportEventW(
3032   _In_ HANDLE hEventLog,
3033   _In_ WORD wType,
3034   _In_ WORD wCategory,
3035   _In_ DWORD dwEventID,
3036   _In_opt_ PSID lpUserSid,
3037   _In_ WORD wNumStrings,
3038   _In_ DWORD dwDataSize,
3039   _In_reads_opt_(wNumStrings) LPCWSTR *lpStrings,
3040   _In_reads_bytes_opt_(dwDataSize) LPVOID lpRawData);
3041 
3042 BOOL WINAPI ResetEvent(HANDLE);
3043 UINT WINAPI ResetWriteWatch(LPVOID,SIZE_T);
3044 #if (_WIN32_WINNT >= 0x0510)
3045 VOID WINAPI RestoreLastError(_In_ DWORD);
3046 #endif
3047 DWORD WINAPI ResumeThread(HANDLE);
3048 BOOL WINAPI RevertToSelf(void);
3049 
3050 _Success_(return != 0 && return < nBufferLength)
3051 DWORD
3052 WINAPI
3053 SearchPathA(
3054   _In_opt_ LPCSTR lpPath,
3055   _In_ LPCSTR lpFileName,
3056   _In_opt_ LPCSTR lpExtension,
3057   _In_ DWORD nBufferLength,
3058   _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer,
3059   _Out_opt_ LPSTR *lpFilePart);
3060 
3061 DWORD WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
3062 BOOL WINAPI SetAclInformation(PACL,PVOID,DWORD,ACL_INFORMATION_CLASS);
3063 BOOL WINAPI SetCommBreak(_In_ HANDLE);
3064 
3065 BOOL
3066 WINAPI
3067 SetCommConfig(
3068   _In_ HANDLE hCommDev,
3069   _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC,
3070   _In_ DWORD dwSize);
3071 
3072 BOOL WINAPI SetCommMask(_In_ HANDLE, _In_ DWORD);
3073 BOOL WINAPI SetCommState(_In_ HANDLE, _In_ LPDCB);
3074 BOOL WINAPI SetCommTimeouts(_In_ HANDLE, _In_ LPCOMMTIMEOUTS);
3075 BOOL WINAPI SetComputerNameA(_In_ LPCSTR);
3076 BOOL WINAPI SetComputerNameW(_In_ LPCWSTR);
3077 #if (_WIN32_WINNT >= 0x0500)
3078 BOOL WINAPI SetComputerNameExA(_In_ COMPUTER_NAME_FORMAT, _In_ LPCSTR);
3079 BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT,LPCWSTR);
3080 #endif
3081 BOOL WINAPI SetCurrentDirectoryA(LPCSTR);
3082 BOOL WINAPI SetCurrentDirectoryW(LPCWSTR);
3083 
3084 BOOL
3085 WINAPI
3086 SetDefaultCommConfigA(
3087   _In_ LPCSTR lpszName,
3088   _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC,
3089   _In_ DWORD dwSize);
3090 
3091 BOOL
3092 WINAPI
3093 SetDefaultCommConfigW(
3094   _In_ LPCWSTR lpszName,
3095   _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC,
3096   _In_ DWORD dwSize);
3097 
3098 #if (_WIN32_WINNT >= 0x0502)
3099 BOOL WINAPI SetDllDirectoryA(_In_opt_ LPCSTR);
3100 BOOL WINAPI SetDllDirectoryW(_In_opt_ LPCWSTR);
3101 #endif
3102 BOOL WINAPI SetEndOfFile(HANDLE);
3103 BOOL WINAPI SetEnvironmentVariableA(LPCSTR,LPCSTR);
3104 BOOL WINAPI SetEnvironmentVariableW(LPCWSTR,LPCWSTR);
3105 UINT WINAPI SetErrorMode(UINT);
3106 BOOL WINAPI SetEvent(HANDLE);
3107 VOID WINAPI SetFileApisToANSI(void);
3108 VOID WINAPI SetFileApisToOEM(void);
3109 BOOL WINAPI SetFileAttributesA(LPCSTR,DWORD);
3110 #if (_WIN32_WINNT >= 0x0600)
3111 BOOL WINAPI SetFileAttributesByHandle(HANDLE,DWORD,DWORD);
3112 #endif
3113 BOOL WINAPI SetFileAttributesW(LPCWSTR,DWORD);
3114 #if (_WIN32_WINNT >= 0x0600)
3115 BOOL WINAPI SetFileBandwidthReservation(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ BOOL, _Out_ LPDWORD, _Out_ LPDWORD);
3116 BOOL WINAPI SetFileCompletionNotificationModes(_In_ HANDLE, _In_ UCHAR);
3117 #endif
3118 DWORD WINAPI SetFilePointer(HANDLE,LONG,PLONG,DWORD);
3119 BOOL WINAPI SetFilePointerEx(HANDLE,LARGE_INTEGER,PLARGE_INTEGER,DWORD);
3120 BOOL WINAPI SetFileSecurityA(_In_ LPCSTR, _In_ SECURITY_INFORMATION, _In_ PSECURITY_DESCRIPTOR);
3121 BOOL WINAPI SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
3122 #if (_WIN32_WINNT >= 0x0501)
3123 BOOL WINAPI SetFileShortNameA(_In_ HANDLE, _In_ LPCSTR);
3124 BOOL WINAPI SetFileShortNameW(_In_ HANDLE, _In_ LPCWSTR);
3125 #endif
3126 BOOL WINAPI SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*);
3127 #if (_WIN32_WINNT >= 0x0501)
3128 BOOL WINAPI SetFileValidData(HANDLE,LONGLONG);
3129 #endif
3130 
3131 #if (_WIN32_WINNT >= 0x0502)
3132 
3133 BOOL
3134 WINAPI
3135 SetFirmwareEnvironmentVariableA(
3136   _In_ LPCSTR lpName,
3137   _In_ LPCSTR lpGuid,
3138   _In_reads_bytes_opt_(nSize) PVOID pValue,
3139   _In_ DWORD nSize);
3140 
3141 BOOL
3142 WINAPI
3143 SetFirmwareEnvironmentVariableW(
3144   _In_ LPCWSTR lpName,
3145   _In_ LPCWSTR lpGuid,
3146   _In_reads_bytes_opt_(nSize) PVOID pValue,
3147   _In_ DWORD nSize);
3148 
3149 #endif
3150 
3151 UINT WINAPI SetHandleCount(UINT);
3152 BOOL WINAPI SetHandleInformation(HANDLE,DWORD,DWORD);
3153 
3154 BOOL
3155 WINAPI
3156 SetInformationJobObject(
3157   _In_ HANDLE hJob,
3158   _In_ JOBOBJECTINFOCLASS JobObjectInformationClass,
3159   _In_reads_bytes_(cbJobObjectInformationLength) LPVOID lpJobObjectInformation,
3160   _In_ DWORD cbJobObjectInformationLength);
3161 
3162 BOOL WINAPI SetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
3163 void WINAPI SetLastError(DWORD);
3164 void WINAPI SetLastErrorEx(DWORD,DWORD);
3165 BOOL WINAPI SetLocalTime(const SYSTEMTIME*);
3166 BOOL WINAPI SetMailslotInfo(_In_ HANDLE, _In_ DWORD);
3167 BOOL WINAPI SetNamedPipeHandleState(HANDLE,PDWORD,PDWORD,PDWORD);
3168 BOOL WINAPI SetPriorityClass(HANDLE,DWORD);
3169 BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR *,PGENERIC_MAPPING,HANDLE);
3170 BOOL WINAPI SetProcessAffinityMask(_In_ HANDLE, _In_ DWORD_PTR);
3171 BOOL WINAPI SetProcessPriorityBoost(_In_ HANDLE, _In_ BOOL);
3172 BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD);
3173 BOOL WINAPI SetProcessWorkingSetSize(_In_ HANDLE, _In_ SIZE_T, _In_ SIZE_T);
3174 #if (_WIN32_WINNT >= 0x0600)
3175 VOID WINAPI SetSecurityAccessMask(SECURITY_INFORMATION,LPDWORD);
3176 #endif
3177 BOOL WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
3178 BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
3179 BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID,BOOL);
3180 BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID,BOOL);
3181 DWORD WINAPI SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR,PUCHAR);
3182 BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
3183 BOOL WINAPI SetStdHandle(_In_ DWORD, _In_ HANDLE);
3184 #define SetSwapAreaSize(w) (w)
3185 BOOL WINAPI SetSystemPowerState(_In_ BOOL, _In_ BOOL);
3186 BOOL WINAPI SetSystemTime(const SYSTEMTIME*);
3187 BOOL WINAPI SetSystemTimeAdjustment(_In_ DWORD, _In_ BOOL);
3188 DWORD WINAPI SetTapeParameters(_In_ HANDLE, _In_ DWORD, _In_ PVOID);
3189 DWORD WINAPI SetTapePosition(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ BOOL);
3190 DWORD_PTR WINAPI SetThreadAffinityMask(_In_ HANDLE, _In_ DWORD_PTR);
3191 BOOL WINAPI SetThreadContext(HANDLE,const CONTEXT*);
3192 DWORD WINAPI SetThreadIdealProcessor(_In_ HANDLE, _In_ DWORD);
3193 BOOL WINAPI SetThreadPriority(HANDLE,int);
3194 BOOL WINAPI SetThreadPriorityBoost(HANDLE,BOOL);
3195 BOOL WINAPI SetThreadToken (PHANDLE,HANDLE);
3196 BOOL WINAPI SetTimeZoneInformation(const TIME_ZONE_INFORMATION *);
3197 BOOL WINAPI SetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,DWORD);
3198 LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER);
3199 BOOL WINAPI SetupComm(_In_ HANDLE, _In_ DWORD, _In_ DWORD);
3200 BOOL WINAPI SetVolumeLabelA(_In_opt_ LPCSTR, _In_opt_ LPCSTR);
3201 BOOL WINAPI SetVolumeLabelW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR);
3202 #if (_WIN32_WINNT >= 0x0500)
3203 BOOL WINAPI SetVolumeMountPointA(_In_ LPCSTR, _In_ LPCSTR);
3204 BOOL WINAPI SetVolumeMountPointW(_In_ LPCWSTR, _In_ LPCWSTR);
3205 #endif
3206 BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,PVOID,BOOL);
3207 DWORD WINAPI SignalObjectAndWait(_In_ HANDLE, _In_ HANDLE, _In_ DWORD, _In_ BOOL);
3208 DWORD WINAPI SizeofResource(HINSTANCE,HRSRC);
3209 WINBASEAPI void WINAPI Sleep(DWORD);
3210 #if (_WIN32_WINNT >= 0x0600)
3211 BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE,PCRITICAL_SECTION,DWORD);
3212 BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE,PSRWLOCK,DWORD,ULONG);
3213 #endif
3214 DWORD WINAPI SleepEx(DWORD,BOOL);
3215 DWORD WINAPI SuspendThread(HANDLE);
3216 void WINAPI SwitchToFiber(_In_ PVOID);
3217 BOOL WINAPI SwitchToThread(void);
3218 BOOL WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
3219 BOOL WINAPI SystemTimeToTzSpecificLocalTime(CONST TIME_ZONE_INFORMATION*,CONST SYSTEMTIME*,LPSYSTEMTIME);
3220 BOOL WINAPI TerminateProcess(HANDLE hProcess, UINT uExitCode);
3221 BOOL WINAPI TerminateThread(HANDLE hThread,DWORD dwExitCode);
3222 DWORD WINAPI TlsAlloc(VOID);
3223 BOOL WINAPI TlsFree(DWORD);
3224 PVOID WINAPI TlsGetValue(DWORD);
3225 BOOL WINAPI TlsSetValue(DWORD,PVOID);
3226 BOOL WINAPI TransactNamedPipe(HANDLE,PVOID,DWORD,PVOID,DWORD,PDWORD,LPOVERLAPPED);
3227 BOOL WINAPI TransmitCommChar(_In_ HANDLE, _In_ char);
3228 BOOL WINAPI TryEnterCriticalSection(LPCRITICAL_SECTION);
3229 BOOL WINAPI TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION,LPSYSTEMTIME,LPSYSTEMTIME);
3230 LONG WINAPI UnhandledExceptionFilter(LPEXCEPTION_POINTERS);
3231 BOOL WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
3232 BOOL WINAPI UnlockFileEx(HANDLE,DWORD,DWORD,DWORD,LPOVERLAPPED);
3233 #define UnlockResource(handle) ((handle), 0)
3234 #define UnlockSegment(w) GlobalUnfix((HANDLE)(w)) /* Obsolete: Has no effect. */
3235 BOOL WINAPI UnmapViewOfFile(LPCVOID);
3236 #if (_WIN32_WINNT >= 0x0500)
3237 _Must_inspect_result_ BOOL WINAPI UnregisterWait(_In_ HANDLE);
3238 BOOL WINAPI UnregisterWaitEx(HANDLE,HANDLE);
3239 #endif
3240 
3241 BOOL
3242 WINAPI
3243 UpdateResourceA(
3244   _In_ HANDLE hUpdate,
3245   _In_ LPCSTR lpType,
3246   _In_ LPCSTR lpName,
3247   _In_ WORD wLanguage,
3248   _In_reads_bytes_opt_(cb) LPVOID lpData,
3249   _In_ DWORD cb);
3250 
3251 BOOL
3252 WINAPI
3253 UpdateResourceW(
3254   _In_ HANDLE hUpdate,
3255   _In_ LPCWSTR lpType,
3256   _In_ LPCWSTR lpName,
3257   _In_ WORD wLanguage,
3258   _In_reads_bytes_opt_(cb) LPVOID lpData,
3259   _In_ DWORD cb);
3260 
3261 BOOL WINAPI VerifyVersionInfoA(_Inout_ LPOSVERSIONINFOEXA, _In_ DWORD, _In_ DWORDLONG);
3262 BOOL WINAPI VerifyVersionInfoW(_Inout_ LPOSVERSIONINFOEXW, _In_ DWORD, _In_ DWORDLONG);
3263 PVOID WINAPI VirtualAlloc(PVOID,SIZE_T,DWORD,DWORD);
3264 PVOID WINAPI VirtualAllocEx(HANDLE,PVOID,SIZE_T,DWORD,DWORD);
3265 BOOL WINAPI VirtualFree(PVOID,SIZE_T,DWORD);
3266 BOOL WINAPI VirtualFreeEx(HANDLE,PVOID,SIZE_T,DWORD);
3267 BOOL WINAPI VirtualLock(PVOID,SIZE_T);
3268 BOOL WINAPI VirtualProtect(PVOID,SIZE_T,DWORD,PDWORD);
3269 BOOL WINAPI VirtualProtectEx(HANDLE,PVOID,SIZE_T,DWORD,PDWORD);
3270 SIZE_T WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T);
3271 SIZE_T WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T);
3272 BOOL WINAPI VirtualUnlock(PVOID,SIZE_T);
3273 BOOL WINAPI WaitCommEvent(_In_ HANDLE, _Inout_ PDWORD, _Inout_opt_ LPOVERLAPPED);
3274 BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
3275 
3276 DWORD
3277 WINAPI
3278 WaitForMultipleObjects(
3279   _In_ DWORD nCount,
3280   _In_reads_(nCount) CONST HANDLE *lpHandles,
3281   _In_ BOOL bWaitAll,
3282   _In_ DWORD dwMilliseconds);
3283 
3284 DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,BOOL,DWORD,BOOL);
3285 DWORD WINAPI WaitForSingleObject(_In_ HANDLE hHandle, _In_ DWORD dwMilliseconds);
3286 DWORD WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL);
3287 BOOL WINAPI WaitNamedPipeA(_In_ LPCSTR, _In_ DWORD);
3288 BOOL WINAPI WaitNamedPipeW(_In_ LPCWSTR, _In_ DWORD);
3289 #if (_WIN32_WINNT >= 0x0600)
3290 VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE);
3291 VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE);
3292 #endif
3293 BOOL WINAPI WinLoadTrustProvider(GUID*);
3294 BOOL WINAPI Wow64DisableWow64FsRedirection(PVOID*);
3295 BOOLEAN WINAPI Wow64EnableWow64FsRedirection(_In_ BOOLEAN);
3296 BOOL WINAPI Wow64RevertWow64FsRedirection(PVOID);
3297 DWORD WINAPI WriteEncryptedFileRaw(_In_ PFE_IMPORT_FUNC, _In_opt_ PVOID, _In_ PVOID);
3298 BOOL WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
3299 BOOL WINAPI WriteFileEx(HANDLE,LPCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
3300 BOOL WINAPI WriteFileGather(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED);
3301 BOOL WINAPI WritePrivateProfileSectionA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR);
3302 BOOL WINAPI WritePrivateProfileSectionW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR);
3303 BOOL WINAPI WritePrivateProfileStringA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR);
3304 BOOL WINAPI WritePrivateProfileStringW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR);
3305 
3306 BOOL
3307 WINAPI
3308 WritePrivateProfileStructA(
3309   _In_ LPCSTR lpszSection,
3310   _In_ LPCSTR lpszKey,
3311   _In_reads_bytes_opt_(uSizeStruct) LPVOID lpStruct,
3312   _In_ UINT uSizeStruct,
3313   _In_opt_ LPCSTR szFile);
3314 
3315 BOOL
3316 WINAPI
3317 WritePrivateProfileStructW(
3318   _In_ LPCWSTR lpszSection,
3319   _In_ LPCWSTR lpszKey,
3320   _In_reads_bytes_opt_(uSizeStruct) LPVOID lpStruct,
3321   _In_ UINT uSizeStruct,
3322   _In_opt_ LPCWSTR szFile);
3323 
3324 BOOL WINAPI WriteProcessMemory(HANDLE,LPVOID,LPCVOID,SIZE_T,SIZE_T*);
3325 BOOL WINAPI WriteProfileSectionA(_In_ LPCSTR, _In_ LPCSTR);
3326 BOOL WINAPI WriteProfileSectionW(_In_ LPCWSTR, _In_ LPCWSTR);
3327 BOOL WINAPI WriteProfileStringA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR);
3328 BOOL WINAPI WriteProfileStringW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR);
3329 DWORD WINAPI WriteTapemark(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ BOOL);
3330 
3331 #define Yield()
3332 
3333 #if (_WIN32_WINNT >= 0x0501)
3334 DWORD WINAPI WTSGetActiveConsoleSessionId(VOID);
3335 BOOL WINAPI ZombifyActCtx(_Inout_ HANDLE);
3336 #endif
3337 
3338 #if (_WIN32_WINNT >= 0x0500)
3339 
3340 BOOL
3341 WINAPI
3342 AllocateUserPhysicalPages(
3343   _In_ HANDLE hProcess,
3344   _Inout_ PULONG_PTR NumberOfPages,
3345   _Out_writes_to_(*NumberOfPages, *NumberOfPages) PULONG_PTR PageArray);
3346 
3347 BOOL
3348 WINAPI
3349 FreeUserPhysicalPages(
3350   _In_ HANDLE hProcess,
3351   _Inout_ PULONG_PTR NumberOfPages,
3352   _In_reads_(*NumberOfPages) PULONG_PTR PageArray);
3353 
3354 BOOL
3355 WINAPI
3356 MapUserPhysicalPages(
3357   _In_ PVOID VirtualAddress,
3358   _In_ ULONG_PTR NumberOfPages,
3359   _In_reads_opt_(NumberOfPages) PULONG_PTR PageArray);
3360 
3361 BOOL
3362 WINAPI
3363 MapUserPhysicalPagesScatter(
3364   _In_reads_(NumberOfPages) PVOID *VirtualAddresses,
3365   _In_ ULONG_PTR NumberOfPages,
3366   _In_reads_opt_(NumberOfPages) PULONG_PTR PageArray);
3367 
3368 #endif
3369 
3370 #ifdef UNICODE
3371 typedef STARTUPINFOW STARTUPINFO,*LPSTARTUPINFO;
3372 typedef WIN32_FIND_DATAW WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;
3373 typedef HW_PROFILE_INFOW HW_PROFILE_INFO,*LPHW_PROFILE_INFO;
3374 typedef ENUMRESLANGPROCW ENUMRESLANGPROC;
3375 typedef ENUMRESNAMEPROCW ENUMRESNAMEPROC;
3376 typedef ENUMRESTYPEPROCW ENUMRESTYPEPROC;
3377 #if (_WIN32_WINNT >= 0x0501)
3378 typedef ACTCTXW ACTCTX,*PACTCTX;
3379 typedef PCACTCTXW PCACTCTX;
3380 #endif
3381 #define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmW
3382 #define AddAtom AddAtomW
3383 #define BackupEventLog BackupEventLogW
3384 #define BeginUpdateResource BeginUpdateResourceW
3385 #define BuildCommDCB BuildCommDCBW
3386 #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW
3387 #define CallNamedPipe CallNamedPipeW
3388 #if (_WIN32_WINNT >= 0x0501)
3389 #define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3W
3390 #endif
3391 #define ClearEventLog ClearEventLogW
3392 #define CommConfigDialog CommConfigDialogW
3393 #define CopyFile CopyFileW
3394 #define CopyFileEx CopyFileExW
3395 #if (_WIN32_WINNT >= 0x0501)
3396 #define CreateActCtx CreateActCtxW
3397 #endif
3398 #define CreateDirectory CreateDirectoryW
3399 #define CreateDirectoryEx CreateDirectoryExW
3400 #define CreateEvent CreateEventW
3401 #define CreateFile CreateFileW
3402 #define CreateFileMapping CreateFileMappingW
3403 #if (_WIN32_WINNT >= 0x0500)
3404 #define CreateHardLink CreateHardLinkW
3405 #define CreateJobObject CreateJobObjectW
3406 #endif
3407 #define CreateMailslot CreateMailslotW
3408 #define CreateMutex CreateMutexW
3409 #define CreateNamedPipe CreateNamedPipeW
3410 #define CreateProcess CreateProcessW
3411 #define CreateProcessAsUser CreateProcessAsUserW
3412 #define CreateSemaphore CreateSemaphoreW
3413 #define CreateWaitableTimer CreateWaitableTimerW
3414 #define DecryptFile DecryptFileW
3415 #define DefineDosDevice DefineDosDeviceW
3416 #define DeleteFile DeleteFileW
3417 #if (_WIN32_WINNT >= 0x0500)
3418 #define DeleteVolumeMountPoint DeleteVolumeMountPointW
3419 #define DnsHostnameToComputerName DnsHostnameToComputerNameW
3420 #endif
3421 #define EncryptFile EncryptFileW
3422 #define EndUpdateResource EndUpdateResourceW
3423 #define EnumResourceLanguages EnumResourceLanguagesW
3424 #define EnumResourceNames EnumResourceNamesW
3425 #define EnumResourceTypes EnumResourceTypesW
3426 #define ExpandEnvironmentStrings ExpandEnvironmentStringsW
3427 #define FatalAppExit FatalAppExitW
3428 #define FileEncryptionStatus FileEncryptionStatusW
3429 #if (_WIN32_WINNT >= 0x0501)
3430 #define FindActCtxSectionString FindActCtxSectionStringW
3431 #endif
3432 #define FindAtom FindAtomW
3433 #define FindFirstChangeNotification FindFirstChangeNotificationW
3434 #define FindFirstFile FindFirstFileW
3435 #define FindFirstFileEx FindFirstFileExW
3436 #if (_WIN32_WINNT >= 0x0500)
3437 #define FindFirstVolume FindFirstVolumeW
3438 #define FindFirstVolumeMountPoint FindFirstVolumeMountPointW
3439 #endif
3440 #define FindNextFile FindNextFileW
3441 #if (_WIN32_WINNT >= 0x0500)
3442 #define FindNextVolume FindNextVolumeW
3443 #define FindNextVolumeMountPoint  FindNextVolumeMountPointW
3444 #endif
3445 #define FindResource FindResourceW
3446 #define FindResourceEx FindResourceExW
3447 #define FormatMessage FormatMessageW
3448 #define FreeEnvironmentStrings FreeEnvironmentStringsW
3449 #define GetAtomName GetAtomNameW
3450 #define GetBinaryType GetBinaryTypeW
3451 #define GetCommandLine GetCommandLineW
3452 #define GetCompressedFileSize GetCompressedFileSizeW
3453 #define GetComputerName GetComputerNameW
3454 #if (_WIN32_WINNT >= 0x0500)
3455 #define GetComputerNameEx GetComputerNameExW
3456 #endif
3457 #define GetCurrentDirectory GetCurrentDirectoryW
3458 #define GetDefaultCommConfig GetDefaultCommConfigW
3459 #define GetDiskFreeSpace GetDiskFreeSpaceW
3460 #define GetDiskFreeSpaceEx GetDiskFreeSpaceExW
3461 #if (_WIN32_WINNT >= 0x0502)
3462 #define GetDllDirectory GetDllDirectoryW
3463 #endif
3464 #define GetDriveType GetDriveTypeW
3465 #define GetEnvironmentStrings GetEnvironmentStringsW
3466 #define GetEnvironmentVariable GetEnvironmentVariableW
3467 #define GetFileAttributes GetFileAttributesW
3468 #define GetFileAttributesEx GetFileAttributesExW
3469 #define GetFileSecurity GetFileSecurityW
3470 #if (_WIN32_WINNT >= 0x0600)
3471 #define GetFinalPathNameByHandle GetFinalPathNameByHandleW
3472 #endif
3473 #define GetFullPathName GetFullPathNameW
3474 #define GetLogicalDriveStrings GetLogicalDriveStringsW
3475 #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
3476 #define GetLongPathName GetLongPathNameW
3477 #endif
3478 #define GetModuleFileName GetModuleFileNameW
3479 #define GetModuleHandle GetModuleHandleW
3480 #if (_WIN32_WINNT >= 0x0500)
3481 #define GetModuleHandleEx GetModuleHandleExW
3482 #endif
3483 #define GetNamedPipeHandleState GetNamedPipeHandleStateW
3484 #define GetPrivateProfileInt GetPrivateProfileIntW
3485 #define GetPrivateProfileSection GetPrivateProfileSectionW
3486 #define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesW
3487 #define GetPrivateProfileString GetPrivateProfileStringW
3488 #define GetPrivateProfileStruct GetPrivateProfileStructW
3489 #define GetProfileInt GetProfileIntW
3490 #define GetProfileSection GetProfileSectionW
3491 #define GetProfileString GetProfileStringW
3492 #define GetShortPathName GetShortPathNameW
3493 #define GetStartupInfo GetStartupInfoW
3494 #define GetSystemDirectory GetSystemDirectoryW
3495 #if (_WIN32_WINNT >= 0x0500)
3496 #define GetSystemWindowsDirectory GetSystemWindowsDirectoryW
3497 #endif
3498 #if (_WIN32_WINNT >= 0x0501)
3499 #define GetSystemWow64Directory GetSystemWow64DirectoryW
3500 #endif
3501 #define GetTempFileName GetTempFileNameW
3502 #define GetTempPath GetTempPathW
3503 #define GetUserName GetUserNameW
3504 #define GetVersionEx GetVersionExW
3505 #define GetVolumeInformation GetVolumeInformationW
3506 #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointW
3507 #define GetVolumePathName GetVolumePathNameW
3508 #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameW
3509 #define GetWindowsDirectory GetWindowsDirectoryW
3510 #define GlobalAddAtom GlobalAddAtomW
3511 #define GlobalFindAtom GlobalFindAtomW
3512 #define GlobalGetAtomName GlobalGetAtomNameW
3513 #define IsBadStringPtr IsBadStringPtrW
3514 #define LoadLibrary LoadLibraryW
3515 #define LoadLibraryEx LoadLibraryExW
3516 #define LogonUser LogonUserW
3517 #define LogonUserEx LogonUserExW
3518 #define LookupAccountName LookupAccountNameW
3519 #define LookupAccountSid LookupAccountSidW
3520 #define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW
3521 #define LookupPrivilegeName LookupPrivilegeNameW
3522 #define LookupPrivilegeValue LookupPrivilegeValueW
3523 #define lstrcat lstrcatW
3524 #define lstrcmp lstrcmpW
3525 #define lstrcmpi lstrcmpiW
3526 #define lstrcpy lstrcpyW
3527 #define lstrcpyn lstrcpynW
3528 #define lstrlen lstrlenW
3529 #define MoveFile MoveFileW
3530 #define MoveFileEx MoveFileExW
3531 #define MoveFileWithProgress MoveFileWithProgressW
3532 #define ObjectCloseAuditAlarm ObjectCloseAuditAlarmW
3533 #define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmW
3534 #define ObjectOpenAuditAlarm ObjectOpenAuditAlarmW
3535 #define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmW
3536 #define OpenBackupEventLog OpenBackupEventLogW
3537 #define OpenEvent OpenEventW
3538 #define OpenEventLog OpenEventLogW
3539 #define OpenFileMapping OpenFileMappingW
3540 #define OpenMutex OpenMutexW
3541 #define OpenSemaphore OpenSemaphoreW
3542 #define OutputDebugString OutputDebugStringW
3543 #define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmW
3544 #define QueryDosDevice QueryDosDeviceW
3545 #define ReadEventLog ReadEventLogW
3546 #define RegisterEventSource RegisterEventSourceW
3547 #define RemoveDirectory RemoveDirectoryW
3548 #if (_WIN32_WINNT >= 0x0500)
3549 #define ReplaceFile ReplaceFileW
3550 #endif
3551 #define ReportEvent ReportEventW
3552 #define SearchPath SearchPathW
3553 #define SetComputerName SetComputerNameW
3554 #define SetComputerNameEx SetComputerNameExW
3555 #define SetCurrentDirectory SetCurrentDirectoryW
3556 #define SetDefaultCommConfig SetDefaultCommConfigW
3557 #if (_WIN32_WINNT >= 0x0502)
3558 #define SetDllDirectory SetDllDirectoryW
3559 #endif
3560 #define SetEnvironmentVariable SetEnvironmentVariableW
3561 #define SetFileAttributes SetFileAttributesW
3562 #define SetFileSecurity SetFileSecurityW
3563 #if (_WIN32_WINNT >= 0x0501)
3564 #define SetFileShortName SetFileShortNameW
3565 #endif
3566 #if (_WIN32_WINNT >= 0x0502)
3567 #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW
3568 #endif
3569 #define SetVolumeLabel SetVolumeLabelW
3570 #define SetVolumeMountPoint SetVolumeMountPointW
3571 #define UpdateResource UpdateResourceW
3572 #define VerifyVersionInfo VerifyVersionInfoW
3573 #define WaitNamedPipe WaitNamedPipeW
3574 #define WritePrivateProfileSection WritePrivateProfileSectionW
3575 #define WritePrivateProfileString WritePrivateProfileStringW
3576 #define WritePrivateProfileStruct WritePrivateProfileStructW
3577 #define WriteProfileSection WriteProfileSectionW
3578 #define WriteProfileString WriteProfileStringW
3579 #else
3580 typedef STARTUPINFOA STARTUPINFO,*LPSTARTUPINFO;
3581 typedef WIN32_FIND_DATAA WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;
3582 typedef HW_PROFILE_INFOA HW_PROFILE_INFO,*LPHW_PROFILE_INFO;
3583 #if (_WIN32_WINNT >= 0x0501)
3584 typedef ACTCTXA ACTCTX,*PACTCTX;
3585 typedef PCACTCTXA PCACTCTX;
3586 #endif
3587 typedef ENUMRESLANGPROCA ENUMRESLANGPROC;
3588 typedef ENUMRESNAMEPROCA ENUMRESNAMEPROC;
3589 typedef ENUMRESTYPEPROCA ENUMRESTYPEPROC;
3590 #define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA
3591 #define AddAtom AddAtomA
3592 #define BackupEventLog BackupEventLogA
3593 #define BeginUpdateResource BeginUpdateResourceA
3594 #define BuildCommDCB BuildCommDCBA
3595 #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA
3596 #define CallNamedPipe CallNamedPipeA
3597 #if (_WIN32_WINNT >= 0x0501)
3598 #define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3A
3599 #endif
3600 #define ClearEventLog ClearEventLogA
3601 #define CommConfigDialog CommConfigDialogA
3602 #define CopyFile CopyFileA
3603 #define CopyFileEx CopyFileExA
3604 #if (_WIN32_WINNT >= 0x0501)
3605 #define CreateActCtx CreateActCtxA
3606 #endif
3607 #define CreateDirectory CreateDirectoryA
3608 #define CreateDirectoryEx CreateDirectoryExA
3609 #define CreateEvent CreateEventA
3610 #define CreateFile CreateFileA
3611 #define CreateFileMapping CreateFileMappingA
3612 #if (_WIN32_WINNT >= 0x0500)
3613 #define CreateHardLink CreateHardLinkA
3614 #define CreateJobObject CreateJobObjectA
3615 #endif
3616 #define CreateMailslot CreateMailslotA
3617 #define CreateMutex CreateMutexA
3618 #define CreateNamedPipe CreateNamedPipeA
3619 #define CreateProcess CreateProcessA
3620 #define CreateProcessAsUser CreateProcessAsUserA
3621 #define CreateSemaphore CreateSemaphoreA
3622 #define CreateWaitableTimer CreateWaitableTimerA
3623 #define DecryptFile DecryptFileA
3624 #define DefineDosDevice DefineDosDeviceA
3625 #define DeleteFile DeleteFileA
3626 #if (_WIN32_WINNT >= 0x0500)
3627 #define DeleteVolumeMountPoint DeleteVolumeMountPointA
3628 #define DnsHostnameToComputerName DnsHostnameToComputerNameA
3629 #endif
3630 #define EncryptFile EncryptFileA
3631 #define EndUpdateResource EndUpdateResourceA
3632 #define EnumResourceLanguages EnumResourceLanguagesA
3633 #define EnumResourceNames EnumResourceNamesA
3634 #define EnumResourceTypes EnumResourceTypesA
3635 #define ExpandEnvironmentStrings ExpandEnvironmentStringsA
3636 #define FatalAppExit FatalAppExitA
3637 #define FileEncryptionStatus FileEncryptionStatusA
3638 #if (_WIN32_WINNT >= 0x0501)
3639 #define FindActCtxSectionString FindActCtxSectionStringA
3640 #endif
3641 #define FindAtom FindAtomA
3642 #define FindFirstChangeNotification FindFirstChangeNotificationA
3643 #define FindFirstFile FindFirstFileA
3644 #define FindFirstFileEx FindFirstFileExA
3645 #if (_WIN32_WINNT >= 0x0500)
3646 #define FindFirstVolume FindFirstVolumeA
3647 #define FindFirstVolumeMountPoint FindFirstVolumeMountPointA
3648 #endif
3649 #define FindNextFile FindNextFileA
3650 #if (_WIN32_WINNT >= 0x0500)
3651 #define FindNextVolume FindNextVolumeA
3652 #define FindNextVolumeMountPoint FindNextVolumeMountPointA
3653 #endif
3654 #define FindResource FindResourceA
3655 #define FindResourceEx FindResourceExA
3656 #define FormatMessage FormatMessageA
3657 #define FreeEnvironmentStrings FreeEnvironmentStringsA
3658 #define GetAtomName GetAtomNameA
3659 #define GetBinaryType GetBinaryTypeA
3660 #define GetCommandLine GetCommandLineA
3661 #define GetComputerName GetComputerNameA
3662 #if (_WIN32_WINNT >= 0x0500)
3663 #define GetComputerNameEx GetComputerNameExA
3664 #endif
3665 #define GetCompressedFileSize GetCompressedFileSizeA
3666 #define GetCurrentDirectory GetCurrentDirectoryA
3667 #define GetDefaultCommConfig GetDefaultCommConfigA
3668 #define GetDiskFreeSpace GetDiskFreeSpaceA
3669 #define GetDiskFreeSpaceEx GetDiskFreeSpaceExA
3670 #if (_WIN32_WINNT >= 0x0502)
3671 #define GetDllDirectory GetDllDirectoryA
3672 #endif
3673 #define GetDriveType GetDriveTypeA
3674 #define GetEnvironmentStringsA GetEnvironmentStrings
3675 #define GetEnvironmentVariable GetEnvironmentVariableA
3676 #define GetFileAttributes GetFileAttributesA
3677 #define GetFileAttributesEx GetFileAttributesExA
3678 #define GetFileSecurity GetFileSecurityA
3679 #if (_WIN32_WINNT >= 0x0600)
3680 #define GetFinalPathNameByHandle GetFinalPathNameByHandleA
3681 #endif
3682 #define GetFullPathName GetFullPathNameA
3683 #define GetLogicalDriveStrings GetLogicalDriveStringsA
3684 #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
3685 #define GetLongPathName GetLongPathNameA
3686 #endif
3687 #define GetNamedPipeHandleState GetNamedPipeHandleStateA
3688 #define GetModuleHandle GetModuleHandleA
3689 #if (_WIN32_WINNT >= 0x0500)
3690 #define GetModuleHandleEx GetModuleHandleExA
3691 #endif
3692 #define GetModuleFileName GetModuleFileNameA
3693 #define GetPrivateProfileInt GetPrivateProfileIntA
3694 #define GetPrivateProfileSection GetPrivateProfileSectionA
3695 #define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesA
3696 #define GetPrivateProfileString GetPrivateProfileStringA
3697 #define GetPrivateProfileStruct GetPrivateProfileStructA
3698 #define GetProfileInt GetProfileIntA
3699 #define GetProfileSection GetProfileSectionA
3700 #define GetProfileString GetProfileStringA
3701 #define GetShortPathName GetShortPathNameA
3702 #define GetStartupInfo GetStartupInfoA
3703 #define GetSystemDirectory GetSystemDirectoryA
3704 #if (_WIN32_WINNT >= 0x0500)
3705 #define GetSystemWindowsDirectory GetSystemWindowsDirectoryA
3706 #endif
3707 #if (_WIN32_WINNT >= 0x0501)
3708 #define GetSystemWow64Directory GetSystemWow64DirectoryA
3709 #endif
3710 #define GetTempFileName GetTempFileNameA
3711 #define GetTempPath GetTempPathA
3712 #define GetUserName GetUserNameA
3713 #define GetVersionEx GetVersionExA
3714 #define GetVolumeInformation GetVolumeInformationA
3715 #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointA
3716 #define GetVolumePathName GetVolumePathNameA
3717 #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameA
3718 #define GetWindowsDirectory GetWindowsDirectoryA
3719 #define GlobalAddAtom GlobalAddAtomA
3720 #define GlobalFindAtom GlobalFindAtomA
3721 #define GlobalGetAtomName GlobalGetAtomNameA
3722 #define IsBadStringPtr IsBadStringPtrA
3723 #define LoadLibrary LoadLibraryA
3724 #define LoadLibraryEx LoadLibraryExA
3725 #define LogonUser LogonUserA
3726 #define LogonUserEx LogonUserExA
3727 #define LookupAccountName LookupAccountNameA
3728 #define LookupAccountSid LookupAccountSidA
3729 #define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA
3730 #define LookupPrivilegeName LookupPrivilegeNameA
3731 #define LookupPrivilegeValue LookupPrivilegeValueA
3732 #define lstrcat lstrcatA
3733 #define lstrcmp lstrcmpA
3734 #define lstrcmpi lstrcmpiA
3735 #define lstrcpy lstrcpyA
3736 #define lstrcpyn lstrcpynA
3737 #define lstrlen lstrlenA
3738 #define MoveFile MoveFileA
3739 #define MoveFileEx MoveFileExA
3740 #define MoveFileWithProgress MoveFileWithProgressA
3741 #define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA
3742 #define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA
3743 #define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA
3744 #define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA
3745 #define OpenBackupEventLog OpenBackupEventLogA
3746 #define OpenEvent OpenEventA
3747 #define OpenEventLog OpenEventLogA
3748 #define OpenFileMapping OpenFileMappingA
3749 #define OpenMutex OpenMutexA
3750 #define OpenSemaphore OpenSemaphoreA
3751 #define OutputDebugString OutputDebugStringA
3752 #define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA
3753 #define QueryDosDevice QueryDosDeviceA
3754 #define ReadEventLog ReadEventLogA
3755 #define RegisterEventSource RegisterEventSourceA
3756 #define RemoveDirectory RemoveDirectoryA
3757 #if (_WIN32_WINNT >= 0x0500)
3758 #define ReplaceFile ReplaceFileA
3759 #endif
3760 #define ReportEvent ReportEventA
3761 #define SearchPath SearchPathA
3762 #define SetComputerName SetComputerNameA
3763 #define SetComputerNameEx SetComputerNameExA
3764 #define SetCurrentDirectory SetCurrentDirectoryA
3765 #define SetDefaultCommConfig SetDefaultCommConfigA
3766 #if (_WIN32_WINNT >= 0x0502)
3767 #define SetDllDirectory SetDllDirectoryA
3768 #endif
3769 #define SetEnvironmentVariable SetEnvironmentVariableA
3770 #define SetFileAttributes SetFileAttributesA
3771 #define SetFileSecurity SetFileSecurityA
3772 #if (_WIN32_WINNT >= 0x0501)
3773 #define SetFileShortName SetFileShortNameA
3774 #endif
3775 #if (_WIN32_WINNT >= 0x0502)
3776 #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA
3777 #endif
3778 #define SetVolumeLabel SetVolumeLabelA
3779 #define SetVolumeMountPoint SetVolumeMountPointA
3780 #define UpdateResource UpdateResourceA
3781 #define VerifyVersionInfo VerifyVersionInfoA
3782 #define WaitNamedPipe WaitNamedPipeA
3783 #define WritePrivateProfileSection WritePrivateProfileSectionA
3784 #define WritePrivateProfileString WritePrivateProfileStringA
3785 #define WritePrivateProfileStruct WritePrivateProfileStructA
3786 #define WriteProfileSection WriteProfileSectionA
3787 #define WriteProfileString WriteProfileStringA
3788 #endif
3789 #endif
3790 
3791 /* one-time initialisation API */
3792 typedef RTL_RUN_ONCE INIT_ONCE;
3793 typedef PRTL_RUN_ONCE PINIT_ONCE;
3794 typedef PRTL_RUN_ONCE LPINIT_ONCE;
3795 
3796 #define INIT_ONCE_CHECK_ONLY RTL_RUN_ONCE_CHECK_ONLY
3797 #define INIT_ONCE_ASYNC RTL_RUN_ONCE_ASYNC
3798 #define INIT_ONCE_INIT_FAILED RTL_RUN_ONCE_INIT_FAILED
3799 
3800 typedef BOOL
3801 (WINAPI *PINIT_ONCE_FN)(
3802   _Inout_ PINIT_ONCE InitOnce,
3803   _Inout_opt_ PVOID Parameter,
3804   _Outptr_opt_result_maybenull_ PVOID *Context);
3805 
3806 #if _WIN32_WINNT >= 0x0601
3807 
3808 #define COPYFILE2_MESSAGE_COPY_OFFLOAD 0x00000001L
3809 
3810 typedef enum _COPYFILE2_MESSAGE_TYPE {
3811   COPYFILE2_CALLBACK_NONE = 0,
3812   COPYFILE2_CALLBACK_CHUNK_STARTED,
3813   COPYFILE2_CALLBACK_CHUNK_FINISHED,
3814   COPYFILE2_CALLBACK_STREAM_STARTED,
3815   COPYFILE2_CALLBACK_STREAM_FINISHED,
3816   COPYFILE2_CALLBACK_POLL_CONTINUE,
3817   COPYFILE2_CALLBACK_ERROR,
3818   COPYFILE2_CALLBACK_MAX,
3819 } COPYFILE2_MESSAGE_TYPE;
3820 
3821 typedef enum _COPYFILE2_MESSAGE_ACTION {
3822   COPYFILE2_PROGRESS_CONTINUE = 0,
3823   COPYFILE2_PROGRESS_CANCEL,
3824   COPYFILE2_PROGRESS_STOP,
3825   COPYFILE2_PROGRESS_QUIET,
3826   COPYFILE2_PROGRESS_PAUSE,
3827 } COPYFILE2_MESSAGE_ACTION;
3828 
3829 typedef enum _COPYFILE2_COPY_PHASE {
3830   COPYFILE2_PHASE_NONE = 0,
3831   COPYFILE2_PHASE_PREPARE_SOURCE,
3832   COPYFILE2_PHASE_PREPARE_DEST,
3833   COPYFILE2_PHASE_READ_SOURCE,
3834   COPYFILE2_PHASE_WRITE_DESTINATION,
3835   COPYFILE2_PHASE_SERVER_COPY,
3836   COPYFILE2_PHASE_NAMEGRAFT_COPY,
3837   COPYFILE2_PHASE_MAX,
3838 } COPYFILE2_COPY_PHASE;
3839 
3840 typedef struct COPYFILE2_MESSAGE {
3841   COPYFILE2_MESSAGE_TYPE Type;
3842   DWORD dwPadding;
3843   union {
3844     struct {
3845       DWORD dwStreamNumber;
3846       DWORD dwReserved;
3847       HANDLE hSourceFile;
3848       HANDLE hDestinationFile;
3849       ULARGE_INTEGER uliChunkNumber;
3850       ULARGE_INTEGER uliChunkSize;
3851       ULARGE_INTEGER uliStreamSize;
3852       ULARGE_INTEGER uliTotalFileSize;
3853     } ChunkStarted;
3854     struct {
3855       DWORD dwStreamNumber;
3856       DWORD dwFlags;
3857       HANDLE hSourceFile;
3858       HANDLE hDestinationFile;
3859       ULARGE_INTEGER uliChunkNumber;
3860       ULARGE_INTEGER uliChunkSize;
3861       ULARGE_INTEGER uliStreamSize;
3862       ULARGE_INTEGER uliStreamBytesTransferred;
3863       ULARGE_INTEGER uliTotalFileSize;
3864       ULARGE_INTEGER uliTotalBytesTransferred;
3865     } ChunkFinished;
3866     struct {
3867       DWORD dwStreamNumber;
3868       DWORD dwReserved;
3869       HANDLE hSourceFile;
3870       HANDLE hDestinationFile;
3871       ULARGE_INTEGER uliStreamSize;
3872       ULARGE_INTEGER uliTotalFileSize;
3873     } StreamStarted;
3874     struct {
3875       DWORD dwStreamNumber;
3876       DWORD dwReserved;
3877       HANDLE hSourceFile;
3878       HANDLE hDestinationFile;
3879       ULARGE_INTEGER uliStreamSize;
3880       ULARGE_INTEGER uliStreamBytesTransferred;
3881       ULARGE_INTEGER uliTotalFileSize;
3882       ULARGE_INTEGER uliTotalBytesTransferred;
3883     } StreamFinished;
3884     struct {
3885       DWORD dwReserved;
3886     } PollContinue;
3887     struct {
3888       COPYFILE2_COPY_PHASE CopyPhase;
3889       DWORD dwStreamNumber;
3890       HRESULT hrFailure;
3891       DWORD dwReserved;
3892       ULARGE_INTEGER uliChunkNumber;
3893       ULARGE_INTEGER uliStreamSize;
3894       ULARGE_INTEGER uliStreamBytesTransferred;
3895       ULARGE_INTEGER uliTotalFileSize;
3896       ULARGE_INTEGER uliTotalBytesTransferred;
3897     } Error;
3898   } Info;
3899 } COPYFILE2_MESSAGE;
3900 
3901 typedef COPYFILE2_MESSAGE_ACTION
3902 (CALLBACK *PCOPYFILE2_PROGRESS_ROUTINE)(
3903   _In_ const COPYFILE2_MESSAGE *pMessage,
3904   _In_opt_ PVOID pvCallbackContext);
3905 
3906 typedef struct COPYFILE2_EXTENDED_PARAMETERS {
3907   DWORD dwSize;
3908   DWORD dwCopyFlags;
3909   BOOL *pfCancel;
3910   PCOPYFILE2_PROGRESS_ROUTINE pProgressRoutine;
3911   PVOID pvCallbackContext;
3912 } COPYFILE2_EXTENDED_PARAMETERS;
3913 
3914 WINBASEAPI
3915 HRESULT
3916 WINAPI
3917 CopyFile2(
3918   _In_ PCWSTR pwszExistingFileName,
3919   _In_ PCWSTR pwszNewFileName,
3920   _In_opt_ COPYFILE2_EXTENDED_PARAMETERS *pExtendedParameters);
3921 
3922 #endif /* _WIN32_WINNT >= 0x0601 */
3923 
3924 WINBASEAPI
3925 BOOL
3926 WINAPI
3927 InitOnceExecuteOnce(
3928   _Inout_ PINIT_ONCE InitOnce,
3929   _In_ __callback PINIT_ONCE_FN InitFn,
3930   _Inout_opt_ PVOID Parameter,
3931   _Outptr_opt_result_maybenull_ LPVOID *Context);
3932 
3933 
3934 #if defined(_SLIST_HEADER_) && !defined(_NTOS_) && !defined(_NTOSP_)
3935 
3936 WINBASEAPI
3937 VOID
3938 WINAPI
3939 InitializeSListHead(
3940   _Out_ PSLIST_HEADER ListHead);
3941 
3942 WINBASEAPI
3943 PSLIST_ENTRY
3944 WINAPI
3945 InterlockedPopEntrySList(
3946   _Inout_ PSLIST_HEADER ListHead);
3947 
3948 WINBASEAPI
3949 PSLIST_ENTRY
3950 WINAPI
3951 InterlockedPushEntrySList(
3952   _Inout_ PSLIST_HEADER ListHead,
3953   _Inout_ PSLIST_ENTRY ListEntry);
3954 
3955 WINBASEAPI
3956 PSLIST_ENTRY
3957 WINAPI
3958 InterlockedFlushSList(
3959   _Inout_ PSLIST_HEADER ListHead);
3960 
3961 WINBASEAPI
3962 USHORT
3963 WINAPI
3964 QueryDepthSList(
3965   _In_ PSLIST_HEADER ListHead);
3966 
3967 #endif /* _SLIST_HEADER_ */
3968 
3969 #ifdef __WINESRC__
3970 /* Wine specific. Basically MultiByteToWideChar for us. */
3971 WCHAR * CDECL wine_get_dos_file_name(LPCSTR str);
3972 #endif
3973 
3974 #ifdef _MSC_VER
3975 #pragma warning(pop)
3976 #endif
3977 
3978 #ifdef __cplusplus
3979 }
3980 #endif
3981 #endif /* _WINBASE_H */
3982