jscript: Check the correct heap return condition (Coverity).
[wine] / include / winbase.h
1 /*
2  * Copyright (C) the Wine project
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef __WINE_WINBASE_H
20 #define __WINE_WINBASE_H
21
22 #include <winerror.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #ifdef _KERNEL32_
29 #define WINBASEAPI
30 #else
31 #define WINBASEAPI DECLSPEC_IMPORT
32 #endif
33
34 #ifdef _ADVAPI32_
35 #define WINADVAPI
36 #else
37 #define WINADVAPI DECLSPEC_IMPORT
38 #endif
39
40   /* Windows Exit Procedure flag values */
41 #define WEP_FREE_DLL        0
42 #define WEP_SYSTEM_EXIT     1
43
44 typedef DWORD (CALLBACK *LPTHREAD_START_ROUTINE)(LPVOID);
45
46 typedef VOID (WINAPI *PFIBER_START_ROUTINE)( LPVOID lpFiberParameter );
47 typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
48
49 #define FIBER_FLAG_FLOAT_SWITCH     1
50
51 typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
52 typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
53 typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
54
55 typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
56 typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
57 typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
58
59 #define CRITICAL_SECTION_NO_DEBUG_INFO RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO
60
61 typedef RTL_SRWLOCK SRWLOCK;
62 typedef PRTL_SRWLOCK PSRWLOCK;
63
64 typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
65
66 #define CONDITION_VARIABLE_INIT RTL_CONDITION_VARIABLE_INIT
67 #define CONDITION_VARIABLE_LOCKMODE_SHARED RTL_CONDITION_VARIABLE_LOCKMODE_SHARED
68 typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
69
70 #define EXCEPTION_DEBUG_EVENT       1
71 #define CREATE_THREAD_DEBUG_EVENT   2
72 #define CREATE_PROCESS_DEBUG_EVENT  3
73 #define EXIT_THREAD_DEBUG_EVENT     4
74 #define EXIT_PROCESS_DEBUG_EVENT    5
75 #define LOAD_DLL_DEBUG_EVENT        6
76 #define UNLOAD_DLL_DEBUG_EVENT      7
77 #define OUTPUT_DEBUG_STRING_EVENT   8
78 #define RIP_EVENT                   9
79
80 typedef struct _EXCEPTION_DEBUG_INFO {
81     EXCEPTION_RECORD ExceptionRecord;
82     DWORD dwFirstChance;
83 } EXCEPTION_DEBUG_INFO;
84
85 typedef struct _CREATE_THREAD_DEBUG_INFO {
86     HANDLE hThread;
87     LPVOID lpThreadLocalBase;
88     LPTHREAD_START_ROUTINE lpStartAddress;
89 } CREATE_THREAD_DEBUG_INFO;
90
91 typedef struct _CREATE_PROCESS_DEBUG_INFO {
92     HANDLE hFile;
93     HANDLE hProcess;
94     HANDLE hThread;
95     LPVOID lpBaseOfImage;
96     DWORD dwDebugInfoFileOffset;
97     DWORD nDebugInfoSize;
98     LPVOID lpThreadLocalBase;
99     LPTHREAD_START_ROUTINE lpStartAddress;
100     LPVOID lpImageName;
101     WORD fUnicode;
102 } CREATE_PROCESS_DEBUG_INFO;
103
104 typedef struct _EXIT_THREAD_DEBUG_INFO {
105     DWORD dwExitCode;
106 } EXIT_THREAD_DEBUG_INFO;
107
108 typedef struct _EXIT_PROCESS_DEBUG_INFO {
109     DWORD dwExitCode;
110 } EXIT_PROCESS_DEBUG_INFO;
111
112 typedef struct _LOAD_DLL_DEBUG_INFO {
113     HANDLE hFile;
114     LPVOID   lpBaseOfDll;
115     DWORD    dwDebugInfoFileOffset;
116     DWORD    nDebugInfoSize;
117     LPVOID   lpImageName;
118     WORD     fUnicode;
119 } LOAD_DLL_DEBUG_INFO;
120
121 typedef struct _UNLOAD_DLL_DEBUG_INFO {
122     LPVOID lpBaseOfDll;
123 } UNLOAD_DLL_DEBUG_INFO;
124
125 typedef struct _OUTPUT_DEBUG_STRING_INFO {
126     LPSTR lpDebugStringData;
127     WORD  fUnicode;
128     WORD  nDebugStringLength;
129 } OUTPUT_DEBUG_STRING_INFO;
130
131 typedef struct _RIP_INFO {
132     DWORD dwError;
133     DWORD dwType;
134 } RIP_INFO;
135
136 typedef struct _DEBUG_EVENT {
137     DWORD dwDebugEventCode;
138     DWORD dwProcessId;
139     DWORD dwThreadId;
140     union {
141         EXCEPTION_DEBUG_INFO      Exception;
142         CREATE_THREAD_DEBUG_INFO  CreateThread;
143         CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
144         EXIT_THREAD_DEBUG_INFO    ExitThread;
145         EXIT_PROCESS_DEBUG_INFO   ExitProcess;
146         LOAD_DLL_DEBUG_INFO       LoadDll;
147         UNLOAD_DLL_DEBUG_INFO     UnloadDll;
148         OUTPUT_DEBUG_STRING_INFO  DebugString;
149         RIP_INFO                  RipInfo;
150     } u;
151 } DEBUG_EVENT, *LPDEBUG_EVENT;
152
153 typedef PCONTEXT LPCONTEXT;
154 typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
155 typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
156
157 typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
158 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
159
160 #define OFS_MAXPATHNAME 128
161 typedef struct _OFSTRUCT
162 {
163     BYTE cBytes;
164     BYTE fFixedDisk;
165     WORD nErrCode;
166     WORD Reserved1;
167     WORD Reserved2;
168     CHAR szPathName[OFS_MAXPATHNAME];
169 } OFSTRUCT, *POFSTRUCT, *LPOFSTRUCT;
170
171 #define OF_READ               0x0000
172 #define OF_WRITE              0x0001
173 #define OF_READWRITE          0x0002
174 #define OF_SHARE_COMPAT       0x0000
175 #define OF_SHARE_EXCLUSIVE    0x0010
176 #define OF_SHARE_DENY_WRITE   0x0020
177 #define OF_SHARE_DENY_READ    0x0030
178 #define OF_SHARE_DENY_NONE    0x0040
179 #define OF_PARSE              0x0100
180 #define OF_DELETE             0x0200
181 #define OF_VERIFY             0x0400   /* Used with OF_REOPEN */
182 #define OF_SEARCH             0x0400   /* Used without OF_REOPEN */
183 #define OF_CANCEL             0x0800
184 #define OF_CREATE             0x1000
185 #define OF_PROMPT             0x2000
186 #define OF_EXIST              0x4000
187 #define OF_REOPEN             0x8000
188
189 /* SetErrorMode values */
190 #define SEM_FAILCRITICALERRORS      0x0001
191 #define SEM_NOGPFAULTERRORBOX       0x0002
192 #define SEM_NOALIGNMENTFAULTEXCEPT  0x0004
193 #define SEM_NOOPENFILEERRORBOX      0x8000
194
195 /* CopyFileEx flags */
196 #define COPY_FILE_FAIL_IF_EXISTS        0x00000001
197 #define COPY_FILE_RESTARTABLE           0x00000002
198 #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
199 #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION  0x00000008
200 #define COPY_FILE_COPY_SYMLINK          0x00000800
201 #define COPY_FILE_NO_BUFFERING          0x00001000
202
203 /* return values for CopyProgressRoutine */
204 #define PROGRESS_CONTINUE   0
205 #define PROGRESS_CANCEL     1
206 #define PROGRESS_STOP       2
207 #define PROGRESS_QUIET      3
208
209 /* reason codes for CopyProgressRoutine */
210 #define CALLBACK_CHUNK_FINISHED 0
211 #define CALLBACK_STREAM_SWITCH  1
212
213 /* GetTempFileName() Flags */
214 #define TF_FORCEDRIVE           0x80
215
216 #define DRIVE_UNKNOWN              0
217 #define DRIVE_NO_ROOT_DIR          1
218 #define DRIVE_REMOVABLE            2
219 #define DRIVE_FIXED                3
220 #define DRIVE_REMOTE               4
221 /* Win32 additions */
222 #define DRIVE_CDROM                5
223 #define DRIVE_RAMDISK              6
224
225 #define MAX_COMPUTERNAME_LENGTH    15
226
227 /* The security attributes structure */
228 typedef struct _SECURITY_ATTRIBUTES
229 {
230     DWORD   nLength;
231     LPVOID  lpSecurityDescriptor;
232     BOOL  bInheritHandle;
233 } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
234
235 #ifndef _FILETIME_
236 #define _FILETIME_
237 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
238 typedef struct _FILETIME
239 {
240 #ifdef WORDS_BIGENDIAN
241   DWORD  dwHighDateTime;
242   DWORD  dwLowDateTime;
243 #else
244   DWORD  dwLowDateTime;
245   DWORD  dwHighDateTime;
246 #endif
247 } FILETIME, *PFILETIME, *LPFILETIME;
248 #endif /* _FILETIME_ */
249
250 /* Find* structures */
251 typedef struct _WIN32_FIND_DATAA
252 {
253     DWORD     dwFileAttributes;
254     FILETIME  ftCreationTime;
255     FILETIME  ftLastAccessTime;
256     FILETIME  ftLastWriteTime;
257     DWORD     nFileSizeHigh;
258     DWORD     nFileSizeLow;
259     DWORD     dwReserved0;
260     DWORD     dwReserved1;
261     CHAR      cFileName[260];
262     CHAR      cAlternateFileName[14];
263 } WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
264
265 typedef struct _WIN32_FIND_DATAW
266 {
267     DWORD     dwFileAttributes;
268     FILETIME  ftCreationTime;
269     FILETIME  ftLastAccessTime;
270     FILETIME  ftLastWriteTime;
271     DWORD     nFileSizeHigh;
272     DWORD     nFileSizeLow;
273     DWORD     dwReserved0;
274     DWORD     dwReserved1;
275     WCHAR     cFileName[260];
276     WCHAR     cAlternateFileName[14];
277 } WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
278
279 DECL_WINELIB_TYPE_AW(WIN32_FIND_DATA)
280 DECL_WINELIB_TYPE_AW(PWIN32_FIND_DATA)
281 DECL_WINELIB_TYPE_AW(LPWIN32_FIND_DATA)
282
283 typedef enum _FINDEX_INFO_LEVELS
284 {
285         FindExInfoStandard,
286         FindExInfoMaxInfoLevel
287 } FINDEX_INFO_LEVELS;
288
289 typedef enum _FINDEX_SEARCH_OPS
290 {
291         FindExSearchNameMatch,
292         FindExSearchLimitToDirectories,
293         FindExSearchLimitToDevices,
294         FindExSearchMaxSearchOp
295 } FINDEX_SEARCH_OPS;
296
297 typedef struct _PROCESS_HEAP_ENTRY
298 {
299     LPVOID lpData;
300     DWORD cbData;
301     BYTE cbOverhead;
302     BYTE iRegionIndex;
303     WORD wFlags;
304     union {
305         struct {
306             HANDLE hMem;
307             DWORD dwReserved[3];
308         } Block;
309         struct {
310             DWORD dwCommittedSize;
311             DWORD dwUnCommittedSize;
312             LPVOID lpFirstBlock;
313             LPVOID lpLastBlock;
314         } Region;
315     } DUMMYUNIONNAME;
316 } PROCESS_HEAP_ENTRY, *PPROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
317
318 #define PROCESS_HEAP_REGION                   0x0001
319 #define PROCESS_HEAP_UNCOMMITTED_RANGE        0x0002
320 #define PROCESS_HEAP_ENTRY_BUSY               0x0004
321 #define PROCESS_HEAP_ENTRY_MOVEABLE           0x0010
322 #define PROCESS_HEAP_ENTRY_DDESHARE           0x0020
323
324 #define INVALID_HANDLE_VALUE     ((HANDLE)~(ULONG_PTR)0)
325 #define INVALID_FILE_SIZE        (~0u)
326 #define INVALID_SET_FILE_POINTER (~0u)
327 #define INVALID_FILE_ATTRIBUTES  (~0u)
328
329 #define LOCKFILE_FAIL_IMMEDIATELY   1
330 #define LOCKFILE_EXCLUSIVE_LOCK     2
331
332 #define FLS_OUT_OF_INDEXES (~0u)
333 #define TLS_OUT_OF_INDEXES (~0u)
334
335 #define SHUTDOWN_NORETRY 1
336
337 /* comm */
338
339 #define CBR_110 0xFF10
340 #define CBR_300 0xFF11
341 #define CBR_600 0xFF12
342 #define CBR_1200        0xFF13
343 #define CBR_2400        0xFF14
344 #define CBR_4800        0xFF15
345 #define CBR_9600        0xFF16
346 #define CBR_14400       0xFF17
347 #define CBR_19200       0xFF18
348 #define CBR_38400       0xFF1B
349 #define CBR_56000       0xFF1F
350 #define CBR_57600       0xFF20
351 #define CBR_115200      0xFF21
352 #define CBR_128000      0xFF23
353 #define CBR_256000      0xFF27
354
355 #define NOPARITY        0
356 #define ODDPARITY       1
357 #define EVENPARITY      2
358 #define MARKPARITY      3
359 #define SPACEPARITY     4
360 #define ONESTOPBIT      0
361 #define ONE5STOPBITS    1
362 #define TWOSTOPBITS     2
363
364 #define IGNORE          0
365 #define INFINITE      0xFFFFFFFF
366
367 #define CE_RXOVER       0x0001
368 #define CE_OVERRUN      0x0002
369 #define CE_RXPARITY     0x0004
370 #define CE_FRAME        0x0008
371 #define CE_BREAK        0x0010
372 #define CE_CTSTO        0x0020
373 #define CE_DSRTO        0x0040
374 #define CE_RLSDTO       0x0080
375 #define CE_TXFULL       0x0100
376 #define CE_PTO          0x0200
377 #define CE_IOE          0x0400
378 #define CE_DNS          0x0800
379 #define CE_OOP          0x1000
380 #define CE_MODE 0x8000
381
382 #define IE_BADID        -1
383 #define IE_OPEN -2
384 #define IE_NOPEN        -3
385 #define IE_MEMORY       -4
386 #define IE_DEFAULT      -5
387 #define IE_HARDWARE     -10
388 #define IE_BYTESIZE     -11
389 #define IE_BAUDRATE     -12
390
391 #define EV_RXCHAR    0x0001
392 #define EV_RXFLAG    0x0002
393 #define EV_TXEMPTY   0x0004
394 #define EV_CTS       0x0008
395 #define EV_DSR       0x0010
396 #define EV_RLSD      0x0020
397 #define EV_BREAK     0x0040
398 #define EV_ERR       0x0080
399 #define EV_RING      0x0100
400 #define EV_PERR      0x0200
401 #define EV_RX80FULL  0x0400
402 #define EV_EVENT1    0x0800
403 #define EV_EVENT2    0x1000
404
405 #define SETXOFF 1
406 #define SETXON          2
407 #define SETRTS          3
408 #define CLRRTS          4
409 #define SETDTR          5
410 #define CLRDTR          6
411 #define RESETDEV        7
412 #define SETBREAK        8
413 #define CLRBREAK        9
414
415 /* Purge functions for Comm Port */
416 #define PURGE_TXABORT       0x0001  /* Kill the pending/current writes to the
417                                        comm port */
418 #define PURGE_RXABORT       0x0002  /*Kill the pending/current reads to
419                                      the comm port */
420 #define PURGE_TXCLEAR       0x0004  /* Kill the transmit queue if there*/
421 #define PURGE_RXCLEAR       0x0008  /* Kill the typeahead buffer if there*/
422
423
424 /* Modem Status Flags */
425 #define MS_CTS_ON           ((DWORD)0x0010)
426 #define MS_DSR_ON           ((DWORD)0x0020)
427 #define MS_RING_ON          ((DWORD)0x0040)
428 #define MS_RLSD_ON          ((DWORD)0x0080)
429
430 #define RTS_CONTROL_DISABLE     0
431 #define RTS_CONTROL_ENABLE      1
432 #define RTS_CONTROL_HANDSHAKE   2
433 #define RTS_CONTROL_TOGGLE      3
434
435 #define DTR_CONTROL_DISABLE     0
436 #define DTR_CONTROL_ENABLE      1
437 #define DTR_CONTROL_HANDSHAKE   2
438
439
440 #define LMEM_FIXED          0
441 #define LMEM_MOVEABLE       0x0002
442 #define LMEM_NOCOMPACT      0x0010
443 #define LMEM_NODISCARD      0x0020
444 #define LMEM_ZEROINIT       0x0040
445 #define LMEM_MODIFY         0x0080
446 #define LMEM_DISCARDABLE    0x0F00
447 #define LMEM_DISCARDED      0x4000
448 #define LMEM_INVALID_HANDLE 0x8000
449 #define LMEM_LOCKCOUNT      0x00FF
450
451 #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
452 #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
453
454 #define NONZEROLHND         (LMEM_MOVEABLE)
455 #define NONZEROLPTR         (LMEM_FIXED)
456
457 #define LocalDiscard(h)     (LocalReAlloc((h),0,LMEM_MOVEABLE))
458
459 #define GMEM_FIXED          0x0000
460 #define GMEM_MOVEABLE       0x0002
461 #define GMEM_NOCOMPACT      0x0010
462 #define GMEM_NODISCARD      0x0020
463 #define GMEM_ZEROINIT       0x0040
464 #define GMEM_MODIFY         0x0080
465 #define GMEM_DISCARDABLE    0x0100
466 #define GMEM_NOT_BANKED     0x1000
467 #define GMEM_SHARE          0x2000
468 #define GMEM_DDESHARE       0x2000
469 #define GMEM_NOTIFY         0x4000
470 #define GMEM_LOWER          GMEM_NOT_BANKED
471 #define GMEM_DISCARDED      0x4000
472 #define GMEM_LOCKCOUNT      0x00ff
473 #define GMEM_INVALID_HANDLE 0x8000
474
475 #define GHND                (GMEM_MOVEABLE | GMEM_ZEROINIT)
476 #define GPTR                (GMEM_FIXED | GMEM_ZEROINIT)
477
478 #define GlobalLRUNewest(h)  ((HANDLE)(h))
479 #define GlobalLRUOldest(h)  ((HANDLE)(h))
480 #define GlobalDiscard(h)    (GlobalReAlloc((h),0,GMEM_MOVEABLE))
481
482 #define INVALID_ATOM        ((ATOM)0)
483 #define MAXINTATOM          0xc000
484 #ifdef WINE_NO_UNICODE_MACROS /* force using a cast */
485 #define MAKEINTATOM(atom)   ((ULONG_PTR)((WORD)(atom)))
486 #else
487 #define MAKEINTATOM(atom)   ((LPTSTR)((ULONG_PTR)((WORD)(atom))))
488 #endif
489
490 typedef struct tagMEMORYSTATUS
491 {
492     DWORD    dwLength;
493     DWORD    dwMemoryLoad;
494     SIZE_T   dwTotalPhys;
495     SIZE_T   dwAvailPhys;
496     SIZE_T   dwTotalPageFile;
497     SIZE_T   dwAvailPageFile;
498     SIZE_T   dwTotalVirtual;
499     SIZE_T   dwAvailVirtual;
500 } MEMORYSTATUS, *LPMEMORYSTATUS;
501
502 #include <pshpack8.h>
503 typedef struct tagMEMORYSTATUSEX {
504   DWORD dwLength;
505   DWORD dwMemoryLoad;
506   DWORDLONG DECLSPEC_ALIGN(8) ullTotalPhys;
507   DWORDLONG DECLSPEC_ALIGN(8) ullAvailPhys;
508   DWORDLONG DECLSPEC_ALIGN(8) ullTotalPageFile;
509   DWORDLONG DECLSPEC_ALIGN(8) ullAvailPageFile;
510   DWORDLONG DECLSPEC_ALIGN(8) ullTotalVirtual;
511   DWORDLONG DECLSPEC_ALIGN(8) ullAvailVirtual;
512   DWORDLONG DECLSPEC_ALIGN(8) ullAvailExtendedVirtual;
513 } MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
514 #include <poppack.h>
515
516 typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE {
517     LowMemoryResourceNotification,
518     HighMemoryResourceNotification
519 } MEMORY_RESOURCE_NOTIFICATION_TYPE;
520
521 #ifndef _SYSTEMTIME_
522 #define _SYSTEMTIME_
523 typedef struct _SYSTEMTIME{
524         WORD wYear;
525         WORD wMonth;
526         WORD wDayOfWeek;
527         WORD wDay;
528         WORD wHour;
529         WORD wMinute;
530         WORD wSecond;
531         WORD wMilliseconds;
532 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
533 #endif /* _SYSTEMTIME_ */
534
535 /* The 'overlapped' data structure used by async I/O functions.
536  */
537 typedef struct _OVERLAPPED {
538 #ifdef WORDS_BIGENDIAN
539         ULONG_PTR InternalHigh;
540         ULONG_PTR Internal;
541 #else
542         ULONG_PTR Internal;
543         ULONG_PTR InternalHigh;
544 #endif
545         union {
546             struct {
547 #ifdef WORDS_BIGENDIAN
548                 DWORD OffsetHigh;
549                 DWORD Offset;
550 #else
551                 DWORD Offset;
552                 DWORD OffsetHigh;
553 #endif
554             } DUMMYSTRUCTNAME;
555             PVOID Pointer;
556         } DUMMYUNIONNAME;
557         HANDLE hEvent;
558 } OVERLAPPED, *LPOVERLAPPED;
559
560 typedef VOID (CALLBACK *LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPOVERLAPPED);
561
562 /* Process startup information.
563  */
564
565 /* STARTUPINFO.dwFlags */
566 #define STARTF_USESHOWWINDOW    0x00000001
567 #define STARTF_USESIZE          0x00000002
568 #define STARTF_USEPOSITION      0x00000004
569 #define STARTF_USECOUNTCHARS    0x00000008
570 #define STARTF_USEFILLATTRIBUTE 0x00000010
571 #define STARTF_RUNFULLSCREEN    0x00000020
572 #define STARTF_FORCEONFEEDBACK  0x00000040
573 #define STARTF_FORCEOFFFEEDBACK 0x00000080
574 #define STARTF_USESTDHANDLES    0x00000100
575 #define STARTF_USEHOTKEY        0x00000200
576
577 typedef struct _STARTUPINFOA{
578         DWORD cb;               /* 00: size of struct */
579         LPSTR lpReserved;       /* 04: */
580         LPSTR lpDesktop;        /* 08: */
581         LPSTR lpTitle;          /* 0c: */
582         DWORD dwX;              /* 10: */
583         DWORD dwY;              /* 14: */
584         DWORD dwXSize;          /* 18: */
585         DWORD dwYSize;          /* 1c: */
586         DWORD dwXCountChars;    /* 20: */
587         DWORD dwYCountChars;    /* 24: */
588         DWORD dwFillAttribute;  /* 28: */
589         DWORD dwFlags;          /* 2c: */
590         WORD wShowWindow;       /* 30: */
591         WORD cbReserved2;       /* 32: */
592         BYTE *lpReserved2;      /* 34: */
593         HANDLE hStdInput;       /* 38: */
594         HANDLE hStdOutput;      /* 3c: */
595         HANDLE hStdError;       /* 40: */
596 } STARTUPINFOA, *LPSTARTUPINFOA;
597
598 typedef struct _STARTUPINFOW{
599         DWORD cb;
600         LPWSTR lpReserved;
601         LPWSTR lpDesktop;
602         LPWSTR lpTitle;
603         DWORD dwX;
604         DWORD dwY;
605         DWORD dwXSize;
606         DWORD dwYSize;
607         DWORD dwXCountChars;
608         DWORD dwYCountChars;
609         DWORD dwFillAttribute;
610         DWORD dwFlags;
611         WORD wShowWindow;
612         WORD cbReserved2;
613         BYTE *lpReserved2;
614         HANDLE hStdInput;
615         HANDLE hStdOutput;
616         HANDLE hStdError;
617 } STARTUPINFOW, *LPSTARTUPINFOW;
618
619 DECL_WINELIB_TYPE_AW(STARTUPINFO)
620 DECL_WINELIB_TYPE_AW(LPSTARTUPINFO)
621
622 typedef struct _PROCESS_INFORMATION{
623         HANDLE  hProcess;
624         HANDLE  hThread;
625         DWORD           dwProcessId;
626         DWORD           dwThreadId;
627 } PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
628
629 typedef struct _TIME_DYNAMIC_ZONE_INFORMATION
630 {
631     LONG Bias;
632     WCHAR StandardName[32];
633     SYSTEMTIME StandardDate;
634     LONG StandardBias;
635     WCHAR DaylightName[32];
636     SYSTEMTIME DaylightDate;
637     LONG DaylightBias;
638     WCHAR TimeZoneKeyName[128];
639     BOOLEAN DynamicDaylightTimeDisabled;
640 } DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION;
641
642 typedef struct _TIME_ZONE_INFORMATION{
643         LONG Bias;
644         WCHAR StandardName[32];
645         SYSTEMTIME StandardDate;
646         LONG StandardBias;
647         WCHAR DaylightName[32];
648         SYSTEMTIME DaylightDate;
649         LONG DaylightBias;
650 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
651
652 #define TIME_ZONE_ID_INVALID    ((DWORD)0xFFFFFFFF)
653 #define TIME_ZONE_ID_UNKNOWN    0
654 #define TIME_ZONE_ID_STANDARD   1
655 #define TIME_ZONE_ID_DAYLIGHT   2
656
657 /* CreateProcess: dwCreationFlag values
658  */
659 #define DEBUG_PROCESS               0x00000001
660 #define DEBUG_ONLY_THIS_PROCESS     0x00000002
661 #define CREATE_SUSPENDED            0x00000004
662 #define DETACHED_PROCESS            0x00000008
663 #define CREATE_NEW_CONSOLE          0x00000010
664 #define NORMAL_PRIORITY_CLASS       0x00000020
665 #define IDLE_PRIORITY_CLASS         0x00000040
666 #define HIGH_PRIORITY_CLASS         0x00000080
667 #define REALTIME_PRIORITY_CLASS     0x00000100
668 #define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
669 #define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
670 #define CREATE_NEW_PROCESS_GROUP    0x00000200
671 #define CREATE_UNICODE_ENVIRONMENT  0x00000400
672 #define CREATE_SEPARATE_WOW_VDM     0x00000800
673 #define CREATE_SHARED_WOW_VDM       0x00001000
674 #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
675 #define CREATE_DEFAULT_ERROR_MODE   0x04000000
676 #define CREATE_NO_WINDOW            0x08000000
677 #define PROFILE_USER                0x10000000
678 #define PROFILE_KERNEL              0x20000000
679 #define PROFILE_SERVER              0x40000000
680
681
682 /* File object type definitions
683  */
684 #define FILE_TYPE_UNKNOWN       0
685 #define FILE_TYPE_DISK          1
686 #define FILE_TYPE_CHAR          2
687 #define FILE_TYPE_PIPE          3
688 #define FILE_TYPE_REMOTE        32768
689
690 /* File encryption status
691  */
692 #define FILE_ENCRYPTABLE         0
693 #define FILE_IS_ENCRYPTED        1
694 #define FILE_SYSTEM_ATTR         2
695 #define FILE_ROOT_DIR            3
696 #define FILE_SYSTEM_DIR          4
697 #define FILE_UNKNOWN             5
698 #define FILE_SYSTEM_NOT_SUPPORT  6
699 #define FILE_USER_DISALLOWED     7
700 #define FILE_READ_ONLY           8
701 #define FILE_DIR_DISALOWED       9
702
703 /* File creation flags
704  */
705 #define FILE_FLAG_WRITE_THROUGH         0x80000000
706 #define FILE_FLAG_OVERLAPPED            0x40000000
707 #define FILE_FLAG_NO_BUFFERING          0x20000000
708 #define FILE_FLAG_RANDOM_ACCESS         0x10000000
709 #define FILE_FLAG_SEQUENTIAL_SCAN       0x08000000
710 #define FILE_FLAG_DELETE_ON_CLOSE       0x04000000
711 #define FILE_FLAG_BACKUP_SEMANTICS      0x02000000
712 #define FILE_FLAG_POSIX_SEMANTICS       0x01000000
713 #define FILE_FLAG_OPEN_REPARSE_POINT    0x00200000
714 #define FILE_FLAG_OPEN_NO_RECALL        0x00100000
715 #define FILE_FLAG_FIRST_PIPE_INSTANCE   0x00080000
716
717 #define CREATE_NEW              1
718 #define CREATE_ALWAYS           2
719 #define OPEN_EXISTING           3
720 #define OPEN_ALWAYS             4
721 #define TRUNCATE_EXISTING       5
722
723 /* Standard handle identifiers
724  */
725 #define STD_INPUT_HANDLE        ((DWORD) -10)
726 #define STD_OUTPUT_HANDLE       ((DWORD) -11)
727 #define STD_ERROR_HANDLE        ((DWORD) -12)
728
729 typedef struct _BY_HANDLE_FILE_INFORMATION
730 {
731   DWORD dwFileAttributes;
732   FILETIME ftCreationTime;
733   FILETIME ftLastAccessTime;
734   FILETIME ftLastWriteTime;
735   DWORD dwVolumeSerialNumber;
736   DWORD nFileSizeHigh;
737   DWORD nFileSizeLow;
738   DWORD nNumberOfLinks;
739   DWORD nFileIndexHigh;
740   DWORD nFileIndexLow;
741 } BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION ;
742
743 typedef enum _FILE_ID_TYPE {
744     FileIdType,
745     ObjectIdType,
746     ExtendedFileIdType,
747     MaximumFileIdType
748 } FILE_ID_TYPE, *PFILE_ID_TYPE;
749
750 typedef struct _FILE_ID_DESCRIPTOR {
751     DWORD        dwSize;
752     FILE_ID_TYPE Type;
753     union {
754         LARGE_INTEGER FileId;
755         GUID          ObjectId;
756     } DUMMYUNIONNAME;
757 } FILE_ID_DESCRIPTOR, *LPFILE_ID_DESCRIPTOR;
758
759 typedef enum _FILE_INFO_BY_HANDLE_CLASS {
760     FileBasicInfo,
761     FileStandardInfo,
762     FileNameInfo,
763     FileRenameInfo,
764     FileDispositionInfo,
765     FileAllocationInfo,
766     FileEndOfFileInfo,
767     FileStreamInfo,
768     FileCompressionInfo,
769     FileAttributeTagInfo,
770     FileIdBothDirectoryInfo,
771     FileIdBothDirectoryRestartInfo,
772     FileIoPriorityHintInfo,
773     FileRemoteProtocolInfo,
774     FileFullDirectoryInfo,
775     FileFullDirectoryRestartInfo,
776     FileStorageInfo,
777     FileAlignmentInfo,
778     FileIdInfo,
779     FileIdExtdDirectoryInfo,
780     FileIdExtdDirectoryRestartInfo,
781     MaximumFileInfoByHandlesClass
782 } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS;
783
784 typedef struct _FILE_ID_BOTH_DIR_INFO {
785     DWORD         NextEntryOffset;
786     DWORD         FileIndex;
787     LARGE_INTEGER CreationTime;
788     LARGE_INTEGER LastAccessTime;
789     LARGE_INTEGER LastWriteTime;
790     LARGE_INTEGER ChangeTime;
791     LARGE_INTEGER EndOfFile;
792     LARGE_INTEGER AllocationSize;
793     DWORD         FileAttributes;
794     DWORD         FileNameLength;
795     DWORD         EaSize;
796     CCHAR         ShortNameLength;
797     WCHAR         ShortName[12];
798     LARGE_INTEGER FileId;
799     WCHAR         FileName[1];
800 } FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO;
801
802 #define PIPE_ACCESS_INBOUND  1
803 #define PIPE_ACCESS_OUTBOUND 2
804 #define PIPE_ACCESS_DUPLEX   3
805
806 #define PIPE_CLIENT_END       0
807 #define PIPE_SERVER_END       1
808 #define PIPE_READMODE_BYTE    0
809 #define PIPE_READMODE_MESSAGE 2
810 #define PIPE_TYPE_BYTE        0
811 #define PIPE_TYPE_MESSAGE     4
812
813 #define PIPE_WAIT   0
814 #define PIPE_NOWAIT 1
815
816 #define PIPE_UNLIMITED_INSTANCES 255
817
818 #define NMPWAIT_WAIT_FOREVER            0xffffffff
819 #define NMPWAIT_NOWAIT                  0x00000001
820 #define NMPWAIT_USE_DEFAULT_WAIT        0x00000000
821
822 /* Security flags for dwFlagsAndAttributes of CreateFile */
823 #define SECURITY_ANONYMOUS          (SecurityAnonymous << 16)
824 #define SECURITY_IDENTIFICATION     (SecurityIdentification << 16)
825 #define SECURITY_IMPERSONATION      (SecurityImpersonation << 16)
826 #define SECURITY_DELEGATION         (SecurityDelegation << 16)
827
828 #define SECURITY_CONTEXT_TRACKING   0x00040000
829 #define SECURITY_EFFECTIVE_ONLY     0x00080000
830
831 #define SECURITY_SQOS_PRESENT       0x00100000
832 #define SECURITY_VALID_SQOS_FLAGS   0x001f0000
833
834 typedef struct _SYSTEM_POWER_STATUS
835 {
836   BYTE    ACLineStatus;
837   BYTE    BatteryFlag;
838   BYTE    BatteryLifePercent;
839   BYTE    Reserved1;
840   DWORD   BatteryLifeTime;
841   DWORD   BatteryFullLifeTime;
842 } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
843
844
845 typedef struct _SYSTEM_INFO
846 {
847     union {
848         DWORD   dwOemId; /* Obsolete field - do not use */
849         struct {
850                 WORD wProcessorArchitecture;
851                 WORD wReserved;
852         } DUMMYSTRUCTNAME;
853     } DUMMYUNIONNAME;
854     DWORD       dwPageSize;
855     LPVOID      lpMinimumApplicationAddress;
856     LPVOID      lpMaximumApplicationAddress;
857     DWORD_PTR   dwActiveProcessorMask;
858     DWORD       dwNumberOfProcessors;
859     DWORD       dwProcessorType;
860     DWORD       dwAllocationGranularity;
861     WORD        wProcessorLevel;
862     WORD        wProcessorRevision;
863 } SYSTEM_INFO, *LPSYSTEM_INFO;
864
865 typedef BOOL (CALLBACK *ENUMRESTYPEPROCA)(HMODULE,LPSTR,LONG_PTR);
866 typedef BOOL (CALLBACK *ENUMRESTYPEPROCW)(HMODULE,LPWSTR,LONG_PTR);
867 typedef BOOL (CALLBACK *ENUMRESNAMEPROCA)(HMODULE,LPCSTR,LPSTR,LONG_PTR);
868 typedef BOOL (CALLBACK *ENUMRESNAMEPROCW)(HMODULE,LPCWSTR,LPWSTR,LONG_PTR);
869 typedef BOOL (CALLBACK *ENUMRESLANGPROCA)(HMODULE,LPCSTR,LPCSTR,WORD,LONG_PTR);
870 typedef BOOL (CALLBACK *ENUMRESLANGPROCW)(HMODULE,LPCWSTR,LPCWSTR,WORD,LONG_PTR);
871
872 DECL_WINELIB_TYPE_AW(ENUMRESTYPEPROC)
873 DECL_WINELIB_TYPE_AW(ENUMRESNAMEPROC)
874 DECL_WINELIB_TYPE_AW(ENUMRESLANGPROC)
875
876 /* flags that can be passed to LoadLibraryEx */
877 #define DONT_RESOLVE_DLL_REFERENCES         0x00000001
878 #define LOAD_LIBRARY_AS_DATAFILE            0x00000002
879 #define LOAD_WITH_ALTERED_SEARCH_PATH       0x00000008
880 #define LOAD_IGNORE_CODE_AUTHZ_LEVEL        0x00000010
881 #define LOAD_LIBRARY_AS_IMAGE_RESOURCE      0x00000020
882 #define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE  0x00000040
883 #define LOAD_LIBRARY_REQUIRE_SIGNED_TARGET  0x00000080
884
885 #define GET_MODULE_HANDLE_EX_FLAG_PIN                 1
886 #define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT  2
887 #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS        4
888
889 typedef PLDT_ENTRY LPLDT_ENTRY;
890
891 typedef enum _GET_FILEEX_INFO_LEVELS {
892     GetFileExInfoStandard
893 } GET_FILEEX_INFO_LEVELS;
894
895 typedef struct _WIN32_FILE_ATTRIBUTES_DATA {
896     DWORD    dwFileAttributes;
897     FILETIME ftCreationTime;
898     FILETIME ftLastAccessTime;
899     FILETIME ftLastWriteTime;
900     DWORD    nFileSizeHigh;
901     DWORD    nFileSizeLow;
902 } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
903
904 /*
905  * This one seems to be a Win32 only definition. It also is defined with
906  * WINAPI instead of CALLBACK in the windows headers.
907  */
908 typedef DWORD (CALLBACK *LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER,
909                                            LARGE_INTEGER, DWORD, DWORD, HANDLE,
910                                            HANDLE, LPVOID);
911
912 typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK)(PVOID);
913
914 #define CREATE_EVENT_MANUAL_RESET 1
915 #define CREATE_EVENT_INITIAL_SET  2
916
917 #define CREATE_MUTEX_INITIAL_OWNER 1
918
919 #define CREATE_WAITABLE_TIMER_MANUAL_RESET 1
920
921 #define WAIT_FAILED             0xffffffff
922 #define WAIT_OBJECT_0           0
923 #define WAIT_ABANDONED          STATUS_ABANDONED_WAIT_0
924 #define WAIT_ABANDONED_0        STATUS_ABANDONED_WAIT_0
925 #define WAIT_IO_COMPLETION      STATUS_USER_APC
926 #define WAIT_TIMEOUT            STATUS_TIMEOUT
927 #define STILL_ACTIVE            STATUS_PENDING
928
929 #define FILE_BEGIN              0
930 #define FILE_CURRENT            1
931 #define FILE_END                2
932
933 #define FILE_MAP_COPY                   0x00000001
934 #define FILE_MAP_WRITE                  0x00000002
935 #define FILE_MAP_READ                   0x00000004
936 #define FILE_MAP_ALL_ACCESS             0x000f001f
937 #define FILE_MAP_EXECUTE                0x00000020
938
939 #define MOVEFILE_REPLACE_EXISTING       0x00000001
940 #define MOVEFILE_COPY_ALLOWED           0x00000002
941 #define MOVEFILE_DELAY_UNTIL_REBOOT     0x00000004
942 #define MOVEFILE_WRITE_THROUGH          0x00000008
943
944 #define REPLACEFILE_WRITE_THROUGH       0x00000001
945 #define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
946
947 #define FS_CASE_SENSITIVE               FILE_CASE_SENSITIVE_SEARCH
948 #define FS_CASE_IS_PRESERVED            FILE_CASE_PRESERVED_NAMES
949 #define FS_UNICODE_STORED_ON_DISK       FILE_UNICODE_ON_DISK
950 #define FS_PERSISTENT_ACLS              FILE_PERSISTENT_ACLS
951 #define FS_VOL_IS_COMPRESSED            FILE_VOLUME_IS_COMPRESSED
952 #define FS_FILE_COMPRESSION             FILE_FILE_COMPRESSION
953
954 #define MUTEX_MODIFY_STATE              MUTANT_QUERY_STATE
955 #define MUTEX_ALL_ACCESS                MUTANT_ALL_ACCESS
956
957 #define EXCEPTION_ACCESS_VIOLATION          STATUS_ACCESS_VIOLATION
958 #define EXCEPTION_DATATYPE_MISALIGNMENT     STATUS_DATATYPE_MISALIGNMENT
959 #define EXCEPTION_BREAKPOINT                STATUS_BREAKPOINT
960 #define EXCEPTION_SINGLE_STEP               STATUS_SINGLE_STEP
961 #define EXCEPTION_ARRAY_BOUNDS_EXCEEDED     STATUS_ARRAY_BOUNDS_EXCEEDED
962 #define EXCEPTION_FLT_DENORMAL_OPERAND      STATUS_FLOAT_DENORMAL_OPERAND
963 #define EXCEPTION_FLT_DIVIDE_BY_ZERO        STATUS_FLOAT_DIVIDE_BY_ZERO
964 #define EXCEPTION_FLT_INEXACT_RESULT        STATUS_FLOAT_INEXACT_RESULT
965 #define EXCEPTION_FLT_INVALID_OPERATION     STATUS_FLOAT_INVALID_OPERATION
966 #define EXCEPTION_FLT_OVERFLOW              STATUS_FLOAT_OVERFLOW
967 #define EXCEPTION_FLT_STACK_CHECK           STATUS_FLOAT_STACK_CHECK
968 #define EXCEPTION_FLT_UNDERFLOW             STATUS_FLOAT_UNDERFLOW
969 #define EXCEPTION_INT_DIVIDE_BY_ZERO        STATUS_INTEGER_DIVIDE_BY_ZERO
970 #define EXCEPTION_INT_OVERFLOW              STATUS_INTEGER_OVERFLOW
971 #define EXCEPTION_PRIV_INSTRUCTION          STATUS_PRIVILEGED_INSTRUCTION
972 #define EXCEPTION_IN_PAGE_ERROR             STATUS_IN_PAGE_ERROR
973 #define EXCEPTION_ILLEGAL_INSTRUCTION       STATUS_ILLEGAL_INSTRUCTION
974 #define EXCEPTION_NONCONTINUABLE_EXCEPTION  STATUS_NONCONTINUABLE_EXCEPTION
975 #define EXCEPTION_STACK_OVERFLOW            STATUS_STACK_OVERFLOW
976 #define EXCEPTION_INVALID_DISPOSITION       STATUS_INVALID_DISPOSITION
977 #define EXCEPTION_GUARD_PAGE                STATUS_GUARD_PAGE_VIOLATION
978 #define EXCEPTION_INVALID_HANDLE            STATUS_INVALID_HANDLE
979 #define CONTROL_C_EXIT                      STATUS_CONTROL_C_EXIT
980
981 #define HANDLE_FLAG_INHERIT             0x00000001
982 #define HANDLE_FLAG_PROTECT_FROM_CLOSE  0x00000002
983
984 #define HINSTANCE_ERROR 32
985
986 #define THREAD_PRIORITY_LOWEST          THREAD_BASE_PRIORITY_MIN
987 #define THREAD_PRIORITY_BELOW_NORMAL    (THREAD_PRIORITY_LOWEST+1)
988 #define THREAD_PRIORITY_NORMAL          0
989 #define THREAD_PRIORITY_HIGHEST         THREAD_BASE_PRIORITY_MAX
990 #define THREAD_PRIORITY_ABOVE_NORMAL    (THREAD_PRIORITY_HIGHEST-1)
991 #define THREAD_PRIORITY_ERROR_RETURN    (0x7fffffff)
992 #define THREAD_PRIORITY_TIME_CRITICAL   THREAD_BASE_PRIORITY_LOWRT
993 #define THREAD_PRIORITY_IDLE            THREAD_BASE_PRIORITY_IDLE
994
995 /* flags to FormatMessage */
996 #define FORMAT_MESSAGE_ALLOCATE_BUFFER  0x00000100
997 #define FORMAT_MESSAGE_IGNORE_INSERTS   0x00000200
998 #define FORMAT_MESSAGE_FROM_STRING      0x00000400
999 #define FORMAT_MESSAGE_FROM_HMODULE     0x00000800
1000 #define FORMAT_MESSAGE_FROM_SYSTEM      0x00001000
1001 #define FORMAT_MESSAGE_ARGUMENT_ARRAY   0x00002000
1002 #define FORMAT_MESSAGE_MAX_WIDTH_MASK   0x000000FF
1003
1004 /* flags to ACTCTX[AW] */
1005 #define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID  (0x00000001)
1006 #define ACTCTX_FLAG_LANGID_VALID                  (0x00000002)
1007 #define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID      (0x00000004)
1008 #define ACTCTX_FLAG_RESOURCE_NAME_VALID           (0x00000008)
1009 #define ACTCTX_FLAG_SET_PROCESS_DEFAULT           (0x00000010)
1010 #define ACTCTX_FLAG_APPLICATION_NAME_VALID        (0x00000020)
1011 #define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF         (0x00000040)
1012 #define ACTCTX_FLAG_HMODULE_VALID                 (0x00000080)
1013
1014 /* flags to DeactiveActCtx */
1015 #define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION  (0x00000001)
1016
1017 /* flags to FindActCtxSection{Guid,String[AW]} */
1018 #define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX            (0x00000001)
1019 #define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS              (0x00000002)
1020 #define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA  (0x00000004)
1021
1022 /* flags to QueryActCtxW */
1023 #define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX  (0x00000004)
1024 #define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE  (0x00000008)
1025 #define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS  (0x00000010)
1026 #define QUERY_ACTCTX_FLAG_NO_ADDREF          (0x80000000)
1027
1028 typedef struct tagACTCTXA {
1029     ULONG   cbSize;
1030     DWORD   dwFlags;
1031     LPCSTR  lpSource;
1032     USHORT  wProcessorArchitecture;
1033     LANGID  wLangId;
1034     LPCSTR  lpAssemblyDirectory;
1035     LPCSTR  lpResourceName;
1036     LPCSTR  lpApplicationName;
1037     HMODULE hModule;
1038 } ACTCTXA, *PACTCTXA;
1039
1040 typedef struct tagACTCTXW {
1041     ULONG   cbSize;
1042     DWORD   dwFlags;
1043     LPCWSTR lpSource;
1044     USHORT  wProcessorArchitecture;
1045     LANGID  wLangId;
1046     LPCWSTR lpAssemblyDirectory;
1047     LPCWSTR lpResourceName;
1048     LPCWSTR lpApplicationName;
1049     HMODULE hModule;
1050 } ACTCTXW, *PACTCTXW;
1051
1052 DECL_WINELIB_TYPE_AW(ACTCTX)
1053 DECL_WINELIB_TYPE_AW(PACTCTX)
1054
1055 typedef const ACTCTXA *PCACTCTXA;
1056 typedef const ACTCTXW *PCACTCTXW;
1057 DECL_WINELIB_TYPE_AW(PCACTCTX)
1058
1059 typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
1060     ULONG  cbSize;
1061     ULONG  ulDataFormatVersion;
1062     PVOID  lpData;
1063     ULONG  ulLength;
1064     PVOID  lpSectionGlobalData;
1065     ULONG  ulSectionGlobalDataLength;
1066     PVOID  lpSectionBase;
1067     ULONG  ulSectionTotalLength;
1068     HANDLE hActCtx;
1069     ULONG  ulAssemblyRosterIndex;
1070 } ACTCTX_SECTION_KEYED_DATA_2600, *PACTCTX_SECTION_KEYED_DATA_2600;
1071 typedef const ACTCTX_SECTION_KEYED_DATA_2600 *PCACTCTX_SECTION_KEYED_DATA_2600;
1072
1073 typedef struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA {
1074     PVOID lpInformation;
1075     PVOID lpSectionBase;
1076     ULONG ulSectionLength;
1077     PVOID lpSectionGlobalDataBase;
1078     ULONG ulSectionGlobalDataLength;
1079 } ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, *PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
1080 typedef const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA *PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
1081
1082 typedef struct tagACTCTX_SECTION_KEYED_DATA {
1083     ULONG  cbSize;
1084     ULONG  ulDataFormatVersion;
1085     PVOID  lpData;
1086     ULONG  ulLength;
1087     PVOID  lpSectionGlobalData;
1088     ULONG  ulSectionGlobalDataLength;
1089     PVOID  lpSectionBase;
1090     ULONG  ulSectionTotalLength;
1091     HANDLE hActCtx;
1092     ULONG  ulAssemblyRosterIndex;
1093
1094     /* Non 2600 extra fields */
1095     ULONG ulFlags;
1096     ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
1097 } ACTCTX_SECTION_KEYED_DATA, *PACTCTX_SECTION_KEYED_DATA;
1098 typedef const ACTCTX_SECTION_KEYED_DATA *PCACTCTX_SECTION_KEYED_DATA;
1099
1100 typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
1101     HANDLE hActCtx;
1102     DWORD  dwFlags;
1103 } ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION;
1104
1105 typedef BOOL (WINAPI *PQUERYACTCTXW_FUNC)(DWORD,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T *);
1106
1107 typedef struct tagCOMSTAT
1108 {
1109     DWORD fCtsHold : 1;
1110     DWORD fDsrHold : 1;
1111     DWORD fRlsdHold : 1;
1112     DWORD fXoffHold : 1;
1113     DWORD fXoffSent : 1;
1114     DWORD fEof : 1;
1115     DWORD fTxim : 1;
1116     DWORD fReserved : 25;
1117     DWORD cbInQue;
1118     DWORD cbOutQue;
1119 } COMSTAT, *LPCOMSTAT;
1120
1121 typedef struct tagDCB
1122 {
1123     DWORD DCBlength;
1124     DWORD BaudRate;
1125     unsigned fBinary               :1;
1126     unsigned fParity               :1;
1127     unsigned fOutxCtsFlow          :1;
1128     unsigned fOutxDsrFlow          :1;
1129     unsigned fDtrControl           :2;
1130     unsigned fDsrSensitivity       :1;
1131     unsigned fTXContinueOnXoff     :1;
1132     unsigned fOutX                 :1;
1133     unsigned fInX                  :1;
1134     unsigned fErrorChar            :1;
1135     unsigned fNull                 :1;
1136     unsigned fRtsControl           :2;
1137     unsigned fAbortOnError         :1;
1138     unsigned fDummy2               :17;
1139     WORD wReserved;
1140     WORD XonLim;
1141     WORD XoffLim;
1142     BYTE ByteSize;
1143     BYTE Parity;
1144     BYTE StopBits;
1145     char XonChar;
1146     char XoffChar;
1147     char ErrorChar;
1148     char EofChar;
1149     char EvtChar;
1150     WORD wReserved1;
1151 } DCB, *LPDCB;
1152
1153 typedef struct tagCOMMCONFIG {
1154         DWORD dwSize;
1155         WORD  wVersion;
1156         WORD  wReserved;
1157         DCB   dcb;
1158         DWORD dwProviderSubType;
1159         DWORD dwProviderOffset;
1160         DWORD dwProviderSize;
1161         DWORD wcProviderData[1];
1162 } COMMCONFIG, *LPCOMMCONFIG;
1163
1164 typedef struct tagCOMMPROP {
1165         WORD  wPacketLength;
1166         WORD  wPacketVersion;
1167         DWORD dwServiceMask;
1168         DWORD dwReserved1;
1169         DWORD dwMaxTxQueue;
1170         DWORD dwMaxRxQueue;
1171         DWORD dwMaxBaud;
1172         DWORD dwProvSubType;
1173         DWORD dwProvCapabilities;
1174         DWORD dwSettableParams;
1175         DWORD dwSettableBaud;
1176         WORD  wSettableData;
1177         WORD  wSettableStopParity;
1178         DWORD dwCurrentTxQueue;
1179         DWORD dwCurrentRxQueue;
1180         DWORD dwProvSpec1;
1181         DWORD dwProvSpec2;
1182         WCHAR wcProvChar[1];
1183 } COMMPROP, *LPCOMMPROP;
1184
1185 #define SP_SERIALCOMM ((DWORD)1)
1186
1187 #define BAUD_075     ((DWORD)0x01)
1188 #define BAUD_110     ((DWORD)0x02)
1189 #define BAUD_134_5   ((DWORD)0x04)
1190 #define BAUD_150     ((DWORD)0x08)
1191 #define BAUD_300     ((DWORD)0x10)
1192 #define BAUD_600     ((DWORD)0x20)
1193 #define BAUD_1200    ((DWORD)0x40)
1194 #define BAUD_1800    ((DWORD)0x80)
1195 #define BAUD_2400    ((DWORD)0x100)
1196 #define BAUD_4800    ((DWORD)0x200)
1197 #define BAUD_7200    ((DWORD)0x400)
1198 #define BAUD_9600    ((DWORD)0x800)
1199 #define BAUD_14400   ((DWORD)0x1000)
1200 #define BAUD_19200   ((DWORD)0x2000)
1201 #define BAUD_38400   ((DWORD)0x4000)
1202 #define BAUD_56K     ((DWORD)0x8000)
1203 #define BAUD_57600   ((DWORD)0x40000)
1204 #define BAUD_115200  ((DWORD)0x20000)
1205 #define BAUD_128K    ((DWORD)0x10000)
1206 #define BAUD_USER    ((DWORD)0x10000000)
1207
1208 #define PST_FAX            ((DWORD)0x21)
1209 #define PST_LAT            ((DWORD)0x101)
1210 #define PST_MODEM          ((DWORD)0x06)
1211 #define PST_NETWORK_BRIDGE ((DWORD)0x100)
1212 #define PST_PARALLELPORT   ((DWORD)0x02)
1213 #define PST_RS232          ((DWORD)0x01)
1214 #define PST_RS442          ((DWORD)0x03)
1215 #define PST_RS423          ((DWORD)0x04)
1216 #define PST_RS449          ((DWORD)0x06)
1217 #define PST_SCANNER        ((DWORD)0x22)
1218 #define PST_TCPIP_TELNET   ((DWORD)0x102)
1219 #define PST_UNSPECIFIED    ((DWORD)0x00)
1220 #define PST_X25            ((DWORD)0x103)
1221
1222 #define PCF_16BITMODE     ((DWORD)0x200)
1223 #define PCF_DTRDSR        ((DWORD)0x01)
1224 #define PCF_INTTIMEOUTS   ((DWORD)0x80)
1225 #define PCF_PARITY_CHECK  ((DWORD)0x08)
1226 #define PCF_RLSD          ((DWORD)0x04)
1227 #define PCF_RTSCTS        ((DWORD)0x02)
1228 #define PCF_SETXCHAR      ((DWORD)0x20)
1229 #define PCF_SPECIALCHARS  ((DWORD)0x100)
1230 #define PCF_TOTALTIMEOUTS ((DWORD)0x40)
1231 #define PCF_XONXOFF       ((DWORD)0x10)
1232
1233 #define SP_BAUD         ((DWORD)0x02)
1234 #define SP_DATABITS     ((DWORD)0x04)
1235 #define SP_HANDSHAKING  ((DWORD)0x10)
1236 #define SP_PARITY       ((DWORD)0x01)
1237 #define SP_PARITY_CHECK ((DWORD)0x20)
1238 #define SP_RLSD         ((DWORD)0x40)
1239 #define SP_STOPBITS     ((DWORD)0x08)
1240
1241 #define DATABITS_5   ((DWORD)0x01)
1242 #define DATABITS_6   ((DWORD)0x02)
1243 #define DATABITS_7   ((DWORD)0x04)
1244 #define DATABITS_8   ((DWORD)0x08)
1245 #define DATABITS_16  ((DWORD)0x10)
1246 #define DATABITS_16X ((DWORD)0x20)
1247
1248 #define STOPBITS_10 ((DWORD)1)
1249 #define STOPBITS_15 ((DWORD)2)
1250 #define STOPBITS_20 ((DWORD)4)
1251
1252 #define PARITY_NONE  ((DWORD)0x100)
1253 #define PARITY_ODD   ((DWORD)0x200)
1254 #define PARITY_EVEN  ((DWORD)0x400)
1255 #define PARITY_MARK  ((DWORD)0x800)
1256 #define PARITY_SPACE ((DWORD)0x1000)
1257
1258 typedef struct tagCOMMTIMEOUTS {
1259         DWORD   ReadIntervalTimeout;
1260         DWORD   ReadTotalTimeoutMultiplier;
1261         DWORD   ReadTotalTimeoutConstant;
1262         DWORD   WriteTotalTimeoutMultiplier;
1263         DWORD   WriteTotalTimeoutConstant;
1264 } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
1265
1266 #define GET_TAPE_MEDIA_INFORMATION 0
1267 #define GET_TAPE_DRIVE_INFORMATION 1
1268 #define SET_TAPE_MEDIA_INFORMATION 0
1269 #define SET_TAPE_DRIVE_INFORMATION 1
1270
1271 #define PROCESS_NAME_NATIVE        1
1272
1273 typedef void (CALLBACK *PAPCFUNC)(ULONG_PTR);
1274 typedef void (CALLBACK *PTIMERAPCROUTINE)(LPVOID,DWORD,DWORD);
1275
1276 typedef enum _COMPUTER_NAME_FORMAT
1277 {
1278         ComputerNameNetBIOS,
1279         ComputerNameDnsHostname,
1280         ComputerNameDnsDomain,
1281         ComputerNameDnsFullyQualified,
1282         ComputerNamePhysicalNetBIOS,
1283         ComputerNamePhysicalDnsHostname,
1284         ComputerNamePhysicalDnsDomain,
1285         ComputerNamePhysicalDnsFullyQualified,
1286         ComputerNameMax
1287 } COMPUTER_NAME_FORMAT;
1288
1289 #define HW_PROFILE_GUIDLEN      39
1290 #define MAX_PROFILE_LEN         80
1291
1292 #define DOCKINFO_UNDOCKED       0x1
1293 #define DOCKINFO_DOCKED         0x2
1294 #define DOCKINFO_USER_SUPPLIED  0x4
1295 #define DOCKINFO_USER_UNDOCKED  (DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED)
1296 #define DOCKINFO_USER_DOCKED    (DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED)
1297
1298 typedef struct tagHW_PROFILE_INFOA {
1299     DWORD dwDockInfo;
1300     CHAR  szHwProfileGuid[HW_PROFILE_GUIDLEN];
1301     CHAR  szHwProfileName[MAX_PROFILE_LEN];
1302 } HW_PROFILE_INFOA, *LPHW_PROFILE_INFOA;
1303
1304 typedef struct tagHW_PROFILE_INFOW {
1305     DWORD dwDockInfo;
1306     WCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
1307     WCHAR szHwProfileName[MAX_PROFILE_LEN];
1308 } HW_PROFILE_INFOW, *LPHW_PROFILE_INFOW;
1309
1310 DECL_WINELIB_TYPE_AW(HW_PROFILE_INFO)
1311 DECL_WINELIB_TYPE_AW(LPHW_PROFILE_INFO)
1312
1313 typedef enum _DEP_SYSTEM_POLICY_TYPE {
1314     AlwaysOff = 0,
1315     AlwaysOn = 1,
1316     OptIn = 2,
1317     OptOut = 3
1318 } DEP_SYSTEM_POLICY_TYPE;
1319
1320 /* Event Logging */
1321
1322 #define EVENTLOG_FULL_INFO          0
1323
1324 typedef struct _EVENTLOG_FULL_INFORMATION {
1325     DWORD dwFull;
1326 } EVENTLOG_FULL_INFORMATION, *LPEVENTLOG_FULL_INFORMATION;
1327
1328
1329 /* Stream data structures and defines */
1330 /*the types of backup data -- WIN32_STREAM_ID.dwStreamId below*/
1331 #define BACKUP_INVALID        0
1332 #define BACKUP_DATA           1
1333 #define BACKUP_EA_DATA        2
1334 #define BACKUP_SECURITY_DATA  3
1335 #define BACKUP_ALTERNATE_DATA 4
1336 #define BACKUP_LINK           5
1337 #define BACKUP_PROPERTY_DATA  6
1338 #define BACKUP_OBJECT_ID      7
1339 #define BACKUP_REPARSE_DATA   8
1340 #define BACKUP_SPARSE_BLOCK   9
1341
1342 /*flags for WIN32_STREAM_ID.dwStreamAttributes below*/
1343 #define STREAM_NORMAL_ATTRIBUTE    0
1344 #define STREAM_MODIFIED_WHEN_READ  1
1345 #define STREAM_CONTAINS_SECURITY   2
1346 #define STREAM_CONTAINS_PROPERTIES 4
1347 #define STREAM_SPARSE_ATTRIBUTE    8
1348
1349 #include <pshpack8.h>
1350 typedef struct _WIN32_STREAM_ID {
1351         DWORD   dwStreamId;
1352         DWORD   dwStreamAttributes;
1353         LARGE_INTEGER DECLSPEC_ALIGN(8) Size;
1354         DWORD   dwStreamNameSize;
1355         WCHAR   cStreamName[ANYSIZE_ARRAY];
1356 } WIN32_STREAM_ID, *LPWIN32_STREAM_ID;
1357 #include <poppack.h>
1358
1359
1360 /* GetBinaryType return values.
1361  */
1362
1363 #define SCS_32BIT_BINARY    0
1364 #define SCS_DOS_BINARY      1
1365 #define SCS_WOW_BINARY      2
1366 #define SCS_PIF_BINARY      3
1367 #define SCS_POSIX_BINARY    4
1368 #define SCS_OS216_BINARY    5
1369 #define SCS_64BIT_BINARY    6
1370
1371 /* flags for DefineDosDevice */
1372 #define DDD_RAW_TARGET_PATH         0x00000001
1373 #define DDD_REMOVE_DEFINITION       0x00000002
1374 #define DDD_EXACT_MATCH_ON_REMOVE   0x00000004
1375 #define DDD_NO_BROADCAST_SYSTEM     0x00000008
1376 #define DDD_LUID_BROADCAST_DRIVE    0x00000010
1377
1378 #define LOGON_WITH_PROFILE          0x00000001
1379 #define LOGON_NETCREDENTIALS_ONLY   0x00000002
1380 #define LOGON_ZERO_PASSWORD_BUFFER  0x80000000
1381
1382 /* one-time initialisation API */
1383 typedef RTL_RUN_ONCE  INIT_ONCE;
1384 typedef PRTL_RUN_ONCE PINIT_ONCE;
1385 typedef PRTL_RUN_ONCE LPINIT_ONCE;
1386 #define INIT_ONCE_STATIC_INIT       RTL_RUN_ONCE_INIT
1387 #define INIT_ONCE_CHECK_ONLY        RTL_RUN_ONCE_CHECK_ONLY
1388 #define INIT_ONCE_ASYNC             RTL_RUN_ONCE_ASYNC
1389 #define INIT_ONCE_INIT_FAILED       RTL_RUN_ONCE_INIT_FAILED
1390 /* initialization callback prototype */
1391 typedef BOOL (WINAPI *PINIT_ONCE_FN)(PINIT_ONCE,PVOID,PVOID*);
1392
1393 WINBASEAPI BOOL        WINAPI ActivateActCtx(HANDLE,ULONG_PTR *);
1394 WINADVAPI  BOOL        WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1395 WINADVAPI  BOOL        WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1396 WINADVAPI  BOOL        WINAPI AddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1397 WINADVAPI  BOOL        WINAPI AddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1398 WINADVAPI  BOOL        WINAPI AddAce(PACL,DWORD,DWORD,LPVOID,DWORD);
1399 WINBASEAPI ATOM        WINAPI AddAtomA(LPCSTR);
1400 WINBASEAPI ATOM        WINAPI AddAtomW(LPCWSTR);
1401 #define                       AddAtom WINELIB_NAME_AW(AddAtom)
1402 WINADVAPI  BOOL        WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
1403 WINADVAPI  BOOL        WINAPI AddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
1404 WINBASEAPI VOID        WINAPI AddRefActCtx(HANDLE);
1405 WINBASEAPI PVOID       WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1406 WINADVAPI  BOOL        WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD);
1407 WINADVAPI  BOOL        WINAPI AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL);
1408 WINADVAPI  BOOL        WINAPI AccessCheckAndAuditAlarmA(LPCSTR,LPVOID,LPSTR,LPSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,LPDWORD,LPBOOL,LPBOOL);
1409 WINADVAPI  BOOL        WINAPI AccessCheckAndAuditAlarmW(LPCWSTR,LPVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,LPDWORD,LPBOOL,LPBOOL);
1410 #define                       AccessCheckAndAuditAlarm WINELIB_NAME_AW(AccessCheckAndAuditAlarm)
1411 WINADVAPI  BOOL        WINAPI AccessCheckByType(PSECURITY_DESCRIPTOR,PSID,HANDLE,DWORD,POBJECT_TYPE_LIST,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL);
1412 WINBASEAPI VOID        WINAPI AcquireSRWLockExclusive(PSRWLOCK);
1413 WINBASEAPI VOID        WINAPI AcquireSRWLockShared(PSRWLOCK);
1414 WINADVAPI  BOOL        WINAPI AdjustTokenPrivileges(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1415 WINADVAPI  BOOL        WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1416 WINADVAPI  BOOL        WINAPI AllocateLocallyUniqueId(PLUID);
1417 WINADVAPI  BOOL        WINAPI AreAllAccessesGranted(DWORD,DWORD);
1418 WINADVAPI  BOOL        WINAPI AreAnyAccessesGranted(DWORD,DWORD);
1419 WINBASEAPI BOOL        WINAPI AreFileApisANSI(void);
1420 WINBASEAPI BOOL        WINAPI AssignProcessToJobObject(HANDLE,HANDLE);
1421 WINADVAPI  BOOL        WINAPI BackupEventLogA(HANDLE,LPCSTR);
1422 WINADVAPI  BOOL        WINAPI BackupEventLogW(HANDLE,LPCWSTR);
1423 #define                       BackupEventLog WINELIB_NAME_AW(BackupEventLog)
1424 WINBASEAPI BOOL        WINAPI BackupRead(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
1425 WINBASEAPI BOOL        WINAPI BackupSeek(HANDLE,DWORD,DWORD,LPDWORD,LPDWORD,LPVOID*);
1426 WINBASEAPI BOOL        WINAPI BackupWrite(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
1427 WINBASEAPI BOOL        WINAPI Beep(DWORD,DWORD);
1428 WINBASEAPI HANDLE      WINAPI BeginUpdateResourceA(LPCSTR,BOOL);
1429 WINBASEAPI HANDLE      WINAPI BeginUpdateResourceW(LPCWSTR,BOOL);
1430 #define                       BeginUpdateResource WINELIB_NAME_AW(BeginUpdateResource)
1431 WINBASEAPI BOOL        WINAPI BindIoCompletionCallback(HANDLE,LPOVERLAPPED_COMPLETION_ROUTINE,ULONG);
1432 WINBASEAPI BOOL        WINAPI BuildCommDCBA(LPCSTR,LPDCB);
1433 WINBASEAPI BOOL        WINAPI BuildCommDCBW(LPCWSTR,LPDCB);
1434 #define                       BuildCommDCB WINELIB_NAME_AW(BuildCommDCB)
1435 WINBASEAPI BOOL        WINAPI BuildCommDCBAndTimeoutsA(LPCSTR,LPDCB,LPCOMMTIMEOUTS);
1436 WINBASEAPI BOOL        WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);
1437 #define                       BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
1438 WINBASEAPI BOOL        WINAPI CallNamedPipeA(LPCSTR,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,DWORD);
1439 WINBASEAPI BOOL        WINAPI CallNamedPipeW(LPCWSTR,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,DWORD);
1440 #define                       CallNamedPipe WINELIB_NAME_AW(CallNamedPipe)
1441 WINBASEAPI BOOL        WINAPI CancelIo(HANDLE);
1442 WINBASEAPI BOOL        WINAPI CancelIoEx(HANDLE,LPOVERLAPPED);
1443 WINBASEAPI BOOL        WINAPI CancelTimerQueueTimer(HANDLE,HANDLE);
1444 WINBASEAPI BOOL        WINAPI CancelWaitableTimer(HANDLE);
1445 WINBASEAPI BOOL        WINAPI ChangeTimerQueueTimer(HANDLE,HANDLE,ULONG,ULONG);
1446 WINADVAPI  BOOL        WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
1447 WINBASEAPI BOOL        WINAPI ClearCommBreak(HANDLE);
1448 WINBASEAPI BOOL        WINAPI ClearCommError(HANDLE,LPDWORD,LPCOMSTAT);
1449 WINADVAPI  BOOL        WINAPI ClearEventLogA(HANDLE,LPCSTR);
1450 WINADVAPI  BOOL        WINAPI ClearEventLogW(HANDLE,LPCWSTR);
1451 #define                       ClearEventLog WINELIB_NAME_AW(ClearEventLog)
1452 WINADVAPI  BOOL        WINAPI CloseEventLog(HANDLE);
1453 WINBASEAPI BOOL        WINAPI CloseHandle(HANDLE);
1454 WINBASEAPI BOOL        WINAPI CommConfigDialogA(LPCSTR,HWND,LPCOMMCONFIG);
1455 WINBASEAPI BOOL        WINAPI CommConfigDialogW(LPCWSTR,HWND,LPCOMMCONFIG);
1456 #define                       CommConfigDialog WINELIB_NAME_AW(CommConfigDialog)
1457 WINBASEAPI BOOL        WINAPI ConnectNamedPipe(HANDLE,LPOVERLAPPED);
1458 WINBASEAPI BOOL        WINAPI ContinueDebugEvent(DWORD,DWORD,DWORD);
1459 WINBASEAPI HANDLE      WINAPI ConvertToGlobalHandle(HANDLE hSrc);
1460 WINBASEAPI BOOL        WINAPI CopyFileA(LPCSTR,LPCSTR,BOOL);
1461 WINBASEAPI BOOL        WINAPI CopyFileW(LPCWSTR,LPCWSTR,BOOL);
1462 #define                       CopyFile WINELIB_NAME_AW(CopyFile)
1463 WINBASEAPI BOOL        WINAPI CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
1464 WINBASEAPI BOOL        WINAPI CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
1465 #define                       CopyFileEx WINELIB_NAME_AW(CopyFileEx)
1466 WINADVAPI  BOOL        WINAPI CopySid(DWORD,PSID,PSID);
1467 WINBASEAPI INT         WINAPI CompareFileTime(const FILETIME*,const FILETIME*);
1468 WINBASEAPI BOOL        WINAPI ConvertFiberToThread(void);
1469 WINBASEAPI LPVOID      WINAPI ConvertThreadToFiber(LPVOID);
1470 WINBASEAPI LPVOID      WINAPI ConvertThreadToFiberEx(LPVOID,DWORD);
1471 WINADVAPI  BOOL        WINAPI ConvertToAutoInheritPrivateObjectSecurity(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOL,PGENERIC_MAPPING);
1472 WINBASEAPI HANDLE      WINAPI CreateActCtxA(PCACTCTXA);
1473 WINBASEAPI HANDLE      WINAPI CreateActCtxW(PCACTCTXW);
1474 #define                       CreateActCtx WINELIB_NAME_AW(CreateActCtx)
1475 WINBASEAPI BOOL        WINAPI CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES);
1476 WINBASEAPI BOOL        WINAPI CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES);
1477 #define                       CreateDirectory WINELIB_NAME_AW(CreateDirectory)
1478 WINBASEAPI BOOL        WINAPI CreateDirectoryExA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES);
1479 WINBASEAPI BOOL        WINAPI CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
1480 #define                       CreateDirectoryEx WINELIB_NAME_AW(CreateDirectoryEx)
1481 WINBASEAPI HANDLE      WINAPI CreateEventA(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCSTR);
1482 WINBASEAPI HANDLE      WINAPI CreateEventW(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCWSTR);
1483 #define                       CreateEvent WINELIB_NAME_AW(CreateEvent)
1484 WINBASEAPI HANDLE      WINAPI CreateEventExA(SECURITY_ATTRIBUTES*,LPCSTR,DWORD,DWORD);
1485 WINBASEAPI HANDLE      WINAPI CreateEventExW(SECURITY_ATTRIBUTES*,LPCWSTR,DWORD,DWORD);
1486 #define                       CreateEventEx WINELIB_NAME_AW(CreateEventEx)
1487 WINBASEAPI LPVOID      WINAPI CreateFiber(SIZE_T,LPFIBER_START_ROUTINE,LPVOID);
1488 WINBASEAPI LPVOID      WINAPI CreateFiberEx(SIZE_T,SIZE_T,DWORD,LPFIBER_START_ROUTINE,LPVOID);
1489 WINBASEAPI HANDLE      WINAPI CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
1490 WINBASEAPI HANDLE      WINAPI CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
1491 #define                       CreateFile WINELIB_NAME_AW(CreateFile)
1492 WINBASEAPI HANDLE      WINAPI CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCSTR);
1493 WINBASEAPI HANDLE      WINAPI CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCWSTR);
1494 #define                       CreateFileMapping WINELIB_NAME_AW(CreateFileMapping)
1495 WINBASEAPI HANDLE      WINAPI CreateIoCompletionPort(HANDLE,HANDLE,ULONG_PTR,DWORD);
1496 WINBASEAPI HANDLE      WINAPI CreateJobObjectA(LPSECURITY_ATTRIBUTES,LPCSTR);
1497 WINBASEAPI HANDLE      WINAPI CreateJobObjectW(LPSECURITY_ATTRIBUTES,LPCWSTR);
1498 #define                       CreateJobObject WINELIB_NAME_AW(CreateJobObject)
1499 WINBASEAPI HANDLE      WINAPI CreateMailslotA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1500 WINBASEAPI HANDLE      WINAPI CreateMailslotW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1501 #define                       CreateMailslot WINELIB_NAME_AW(CreateMailslot)
1502 WINBASEAPI HANDLE      WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE);
1503 WINBASEAPI HANDLE      WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1504 WINBASEAPI HANDLE      WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1505 #define                       CreateMutex WINELIB_NAME_AW(CreateMutex)
1506 WINBASEAPI HANDLE      WINAPI CreateMutexExA(SECURITY_ATTRIBUTES*,LPCSTR,DWORD,DWORD);
1507 WINBASEAPI HANDLE      WINAPI CreateMutexExW(SECURITY_ATTRIBUTES*,LPCWSTR,DWORD,DWORD);
1508 #define                       CreateMutexEx WINELIB_NAME_AW(CreateMutexEx)
1509 WINBASEAPI HANDLE      WINAPI CreateNamedPipeA(LPCSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1510 WINBASEAPI HANDLE      WINAPI CreateNamedPipeW(LPCWSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1511 #define                       CreateNamedPipe WINELIB_NAME_AW(CreateNamedPipe)
1512 WINBASEAPI BOOL        WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
1513 WINADVAPI  BOOL        WINAPI CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOL,HANDLE,PGENERIC_MAPPING);
1514 WINBASEAPI BOOL        WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
1515 WINBASEAPI BOOL        WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1516 #define                       CreateProcess WINELIB_NAME_AW(CreateProcess)
1517 WINADVAPI  BOOL        WINAPI CreateProcessAsUserA(HANDLE,LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
1518 WINADVAPI  BOOL        WINAPI CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1519 #define                       CreateProcessAsUser WINELIB_NAME_AW(CreateProcessAsUser)
1520 WINADVAPI  BOOL        WINAPI CreateProcessWithLogonW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPCWSTR,LPWSTR,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1521 WINBASEAPI HANDLE      WINAPI CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
1522 WINADVAPI  BOOL        WINAPI CreateRestrictedToken(HANDLE,DWORD,DWORD,PSID_AND_ATTRIBUTES,DWORD,PLUID_AND_ATTRIBUTES,DWORD,PSID_AND_ATTRIBUTES,PHANDLE);
1523 WINBASEAPI HANDLE      WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
1524 WINBASEAPI HANDLE      WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
1525 #define                       CreateSemaphore WINELIB_NAME_AW(CreateSemaphore)
1526 WINBASEAPI HANDLE      WINAPI CreateSemaphoreExA(SECURITY_ATTRIBUTES*,LONG,LONG,LPCSTR,DWORD,DWORD);
1527 WINBASEAPI HANDLE      WINAPI CreateSemaphoreExW(SECURITY_ATTRIBUTES*,LONG,LONG,LPCWSTR,DWORD,DWORD);
1528 #define                       CreateSemaphoreEx WINELIB_NAME_AW(CreateSemaphoreEx)
1529 WINBASEAPI DWORD       WINAPI CreateTapePartition(HANDLE,DWORD,DWORD,DWORD);
1530 WINBASEAPI HANDLE      WINAPI CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
1531 WINBASEAPI HANDLE      WINAPI CreateTimerQueue(void);
1532 WINBASEAPI BOOL        WINAPI CreateTimerQueueTimer(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,DWORD,DWORD,ULONG);
1533 WINBASEAPI HANDLE      WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1534 WINBASEAPI HANDLE      WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1535 #define                       CreateWaitableTimer WINELIB_NAME_AW(CreateWaitableTimer)
1536 WINBASEAPI HANDLE      WINAPI CreateWaitableTimerExA(SECURITY_ATTRIBUTES*,LPCSTR,DWORD,DWORD);
1537 WINBASEAPI HANDLE      WINAPI CreateWaitableTimerExW(SECURITY_ATTRIBUTES*,LPCWSTR,DWORD,DWORD);
1538 #define                       CreateWaitableTimerEx WINELIB_NAME_AW(CreateWaitableTimerEx)
1539 WINADVAPI  BOOL        WINAPI CreateWellKnownSid(WELL_KNOWN_SID_TYPE,PSID,PSID,DWORD*);
1540 WINBASEAPI BOOL        WINAPI DeactivateActCtx(DWORD,ULONG_PTR);
1541 WINBASEAPI BOOL        WINAPI DebugActiveProcess(DWORD);
1542 WINBASEAPI BOOL        WINAPI DebugActiveProcessStop(DWORD);
1543 WINBASEAPI void        WINAPI DebugBreak(void);
1544 WINBASEAPI BOOL        WINAPI DebugBreakProcess(HANDLE);
1545 WINBASEAPI BOOL        WINAPI DebugSetProcessKillOnExit(BOOL);
1546 WINBASEAPI PVOID       WINAPI DecodePointer(PVOID);
1547 WINADVAPI  BOOL        WINAPI DecryptFileA(LPCSTR,DWORD);
1548 WINADVAPI  BOOL        WINAPI DecryptFileW(LPCWSTR,DWORD);
1549 #define                       DecryptFile WINELIB_NAME_AW(DecryptFile)
1550 WINBASEAPI BOOL        WINAPI DefineDosDeviceA(DWORD,LPCSTR,LPCSTR);
1551 WINBASEAPI BOOL        WINAPI DefineDosDeviceW(DWORD,LPCWSTR,LPCWSTR);
1552 #define                       DefineDosDevice WINELIB_NAME_AW(DefineDosDevice)
1553 #define                       DefineHandleTable(w) ((w),TRUE)
1554 WINADVAPI  BOOL        WINAPI DeleteAce(PACL,DWORD);
1555 WINBASEAPI ATOM        WINAPI DeleteAtom(ATOM);
1556 WINBASEAPI void        WINAPI DeleteCriticalSection(CRITICAL_SECTION *lpCrit);
1557 WINBASEAPI void        WINAPI DeleteFiber(LPVOID);
1558 WINBASEAPI BOOL        WINAPI DeleteFileA(LPCSTR);
1559 WINBASEAPI BOOL        WINAPI DeleteFileW(LPCWSTR);
1560 #define                       DeleteFile WINELIB_NAME_AW(DeleteFile)
1561 WINBASEAPI BOOL        WINAPI DeleteTimerQueue(HANDLE);
1562 WINBASEAPI BOOL        WINAPI DeleteTimerQueueEx(HANDLE,HANDLE);
1563 WINBASEAPI BOOL        WINAPI DeleteTimerQueueTimer(HANDLE,HANDLE,HANDLE);
1564 WINBASEAPI BOOL        WINAPI DeleteVolumeMountPointA(LPCSTR);
1565 WINBASEAPI BOOL        WINAPI DeleteVolumeMountPointW(LPCWSTR);
1566 #define                       DeleteVolumeMountPoint WINELIB_NAME_AW(DeleteVolumeMountPoint)
1567 WINADVAPI  BOOL        WINAPI DeregisterEventSource(HANDLE);
1568 WINADVAPI  BOOL        WINAPI DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR*);
1569 WINBASEAPI BOOL        WINAPI DeviceIoControl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
1570 WINBASEAPI BOOL        WINAPI DisableThreadLibraryCalls(HMODULE);
1571 WINBASEAPI BOOL        WINAPI DisconnectNamedPipe(HANDLE);
1572 WINBASEAPI BOOL        WINAPI DnsHostnameToComputerNameA(LPCSTR,LPSTR,LPDWORD);
1573 WINBASEAPI BOOL        WINAPI DnsHostnameToComputerNameW(LPCWSTR,LPWSTR,LPDWORD);
1574 #define                       DnsHostnameToComputerName WINELIB_NAME_AW(DnsHostnameToComputerName)
1575 WINBASEAPI BOOL        WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
1576 WINBASEAPI BOOL        WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,HANDLE*,DWORD,BOOL,DWORD);
1577 WINADVAPI  BOOL        WINAPI DuplicateToken(HANDLE,SECURITY_IMPERSONATION_LEVEL,PHANDLE);
1578 WINADVAPI  BOOL        WINAPI DuplicateTokenEx(HANDLE,DWORD,LPSECURITY_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1579 WINBASEAPI BOOL        WINAPI EscapeCommFunction(HANDLE,UINT);
1580 WINBASEAPI PVOID       WINAPI EncodePointer(PVOID);
1581 WINADVAPI  BOOL        WINAPI EncryptFileA(LPCSTR);
1582 WINADVAPI  BOOL        WINAPI EncryptFileW(LPCWSTR);
1583 #define                       EncryptFile WINELIB_NAME_AW(EncryptFile)
1584 WINBASEAPI BOOL        WINAPI EndUpdateResourceA(HANDLE,BOOL);
1585 WINBASEAPI BOOL        WINAPI EndUpdateResourceW(HANDLE,BOOL);
1586 #define                       EndUpdateResource WINELIB_NAME_AW(EndUpdateResource)
1587 WINBASEAPI void        WINAPI EnterCriticalSection(CRITICAL_SECTION *lpCrit);
1588 WINBASEAPI BOOL        WINAPI EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,ENUMRESLANGPROCA,LONG_PTR);
1589 WINBASEAPI BOOL        WINAPI EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,ENUMRESLANGPROCW,LONG_PTR);
1590 #define                       EnumResourceLanguages WINELIB_NAME_AW(EnumResourceLanguages)
1591 WINBASEAPI BOOL        WINAPI EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,LONG_PTR);
1592 WINBASEAPI BOOL        WINAPI EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,LONG_PTR);
1593 #define                       EnumResourceNames WINELIB_NAME_AW(EnumResourceNames)
1594 WINBASEAPI BOOL        WINAPI EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG_PTR);
1595 WINBASEAPI BOOL        WINAPI EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG_PTR);
1596 #define                       EnumResourceTypes WINELIB_NAME_AW(EnumResourceTypes)
1597 WINADVAPI  BOOL        WINAPI EqualSid(PSID, PSID);
1598 WINADVAPI  BOOL        WINAPI EqualPrefixSid(PSID,PSID);
1599 WINBASEAPI DWORD       WINAPI EraseTape(HANDLE,DWORD,BOOL);
1600 WINBASEAPI VOID DECLSPEC_NORETURN WINAPI ExitProcess(DWORD);
1601 WINBASEAPI VOID DECLSPEC_NORETURN WINAPI ExitThread(DWORD);
1602 WINBASEAPI DWORD       WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD);
1603 WINBASEAPI DWORD       WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD);
1604 #define                       ExpandEnvironmentStrings WINELIB_NAME_AW(ExpandEnvironmentStrings)
1605 WINBASEAPI void        WINAPI FatalAppExitA(UINT,LPCSTR);
1606 WINBASEAPI void        WINAPI FatalAppExitW(UINT,LPCWSTR);
1607 WINBASEAPI void        WINAPI FatalExit(int);
1608 #define                       FatalAppExit WINELIB_NAME_AW(FatalAppExit)
1609 WINADVAPI  BOOL        WINAPI FileEncryptionStatusA(LPCSTR,LPDWORD);
1610 WINADVAPI  BOOL        WINAPI FileEncryptionStatusW(LPCWSTR,LPDWORD);
1611 #define                       FileEncryptionStatus WINELIB_NAME_AW(FileEncryptionStatus)
1612 WINBASEAPI BOOL        WINAPI FileTimeToDosDateTime(const FILETIME*,LPWORD,LPWORD);
1613 WINBASEAPI BOOL        WINAPI FileTimeToLocalFileTime(const FILETIME*,LPFILETIME);
1614 WINBASEAPI BOOL        WINAPI FileTimeToSystemTime(const FILETIME*,LPSYSTEMTIME);
1615 WINBASEAPI BOOL        WINAPI FindActCtxSectionStringA(DWORD,const GUID *,ULONG,LPCSTR,PACTCTX_SECTION_KEYED_DATA);
1616 WINBASEAPI BOOL        WINAPI FindActCtxSectionStringW(DWORD,const GUID *,ULONG,LPCWSTR,PACTCTX_SECTION_KEYED_DATA);
1617 #define                       FindActCtxSectionString WINELIB_NAME_AW(FindActCtxSectionString)
1618 WINBASEAPI BOOL        WINAPI FindActCtxSectionGuid(DWORD,const GUID *,ULONG,const GUID *,PACTCTX_SECTION_KEYED_DATA);
1619 WINBASEAPI ATOM        WINAPI FindAtomA(LPCSTR);
1620 WINBASEAPI ATOM        WINAPI FindAtomW(LPCWSTR);
1621 #define                       FindAtom WINELIB_NAME_AW(FindAtom)
1622 WINBASEAPI BOOL        WINAPI FindClose(HANDLE);
1623 WINBASEAPI HANDLE      WINAPI FindFirstChangeNotificationA(LPCSTR,BOOL,DWORD);
1624 WINBASEAPI HANDLE      WINAPI FindFirstChangeNotificationW(LPCWSTR,BOOL,DWORD);
1625 #define                       FindFirstChangeNotification WINELIB_NAME_AW(FindFirstChangeNotification)
1626 WINBASEAPI HANDLE      WINAPI FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
1627 WINBASEAPI HANDLE      WINAPI FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW);
1628 #define                       FindFirstFile WINELIB_NAME_AW(FindFirstFile)
1629 WINBASEAPI HANDLE      WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
1630 WINBASEAPI HANDLE      WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
1631 #define                       FindFirstFileEx WINELIB_NAME_AW(FindFirstFileEx)
1632 WINADVAPI  BOOL        WINAPI FindFirstFreeAce(PACL,LPVOID*);
1633 WINBASEAPI BOOL        WINAPI FindNextChangeNotification(HANDLE);
1634 WINBASEAPI BOOL        WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
1635 WINBASEAPI BOOL        WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
1636 #define                       FindNextFile WINELIB_NAME_AW(FindNextFile)
1637 WINBASEAPI BOOL        WINAPI FindCloseChangeNotification(HANDLE);
1638 WINBASEAPI HRSRC       WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR);
1639 WINBASEAPI HRSRC       WINAPI FindResourceW(HMODULE,LPCWSTR,LPCWSTR);
1640 #define                       FindResource WINELIB_NAME_AW(FindResource)
1641 WINBASEAPI HRSRC       WINAPI FindResourceExA(HMODULE,LPCSTR,LPCSTR,WORD);
1642 WINBASEAPI HRSRC       WINAPI FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);
1643 #define                       FindResourceEx WINELIB_NAME_AW(FindResourceEx)
1644 WINBASEAPI HANDLE      WINAPI FindFirstVolumeA(LPSTR,DWORD);
1645 WINBASEAPI HANDLE      WINAPI FindFirstVolumeW(LPWSTR,DWORD);
1646 #define                       FindFirstVolume WINELIB_NAME_AW(FindFirstVolume)
1647 WINBASEAPI HANDLE      WINAPI FindFirstVolumeMountPointA(LPCSTR,LPSTR,DWORD);
1648 WINBASEAPI HANDLE      WINAPI FindFirstVolumeMountPointW(LPCWSTR,LPWSTR,DWORD);
1649 #define                       FindFirstVolumeMountPoint WINELIB_NAME_AW(FindFirstVolumeMountPoint)
1650 WINBASEAPI BOOL        WINAPI FindNextVolumeA(HANDLE,LPSTR,DWORD);
1651 WINBASEAPI BOOL        WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD);
1652 #define                       FindNextVolume WINELIB_NAME_AW(FindNextVolume)
1653 WINBASEAPI BOOL        WINAPI FindNextVolumeMountPointA(HANDLE,LPSTR,DWORD);
1654 WINBASEAPI BOOL        WINAPI FindNextVolumeMountPointW(HANDLE,LPWSTR,DWORD);
1655 #define                       FindNextVolumeMountPoint WINELIB_NAME_AW(FindNextVolumeMountPoint)
1656 WINBASEAPI BOOL        WINAPI FindVolumeClose(HANDLE);
1657 WINBASEAPI BOOL        WINAPI FindVolumeMountPointClose(HANDLE);
1658 WINBASEAPI DWORD       WINAPI FlsAlloc(PFLS_CALLBACK_FUNCTION);
1659 WINBASEAPI BOOL        WINAPI FlsFree(DWORD);
1660 WINBASEAPI PVOID       WINAPI FlsGetValue(DWORD);
1661 WINBASEAPI BOOL        WINAPI FlsSetValue(DWORD,PVOID);
1662 WINBASEAPI BOOL        WINAPI FlushFileBuffers(HANDLE);
1663 WINBASEAPI BOOL        WINAPI FlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1664 WINBASEAPI BOOL        WINAPI FlushViewOfFile(LPCVOID,SIZE_T);
1665 WINBASEAPI DWORD       WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*);
1666 WINBASEAPI DWORD       WINAPI FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,__ms_va_list*);
1667 #define                       FormatMessage WINELIB_NAME_AW(FormatMessage)
1668 WINBASEAPI BOOL        WINAPI FreeEnvironmentStringsA(LPSTR);
1669 WINBASEAPI BOOL        WINAPI FreeEnvironmentStringsW(LPWSTR);
1670 #define                       FreeEnvironmentStrings WINELIB_NAME_AW(FreeEnvironmentStrings)
1671 WINBASEAPI BOOL        WINAPI FreeLibrary(HMODULE);
1672 WINBASEAPI VOID DECLSPEC_NORETURN WINAPI FreeLibraryAndExitThread(HINSTANCE,DWORD);
1673 #define                       FreeModule(handle) FreeLibrary(handle)
1674 #define                       FreeProcInstance(proc) /*nothing*/
1675 WINBASEAPI BOOL        WINAPI FreeResource(HGLOBAL);
1676 WINADVAPI  PVOID       WINAPI FreeSid(PSID);
1677 WINADVAPI  BOOL        WINAPI GetAce(PACL,DWORD,LPVOID*);
1678 WINADVAPI  BOOL        WINAPI GetAclInformation(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
1679 WINBASEAPI UINT        WINAPI GetAtomNameA(ATOM,LPSTR,INT);
1680 WINBASEAPI UINT        WINAPI GetAtomNameW(ATOM,LPWSTR,INT);
1681 #define                       GetAtomName WINELIB_NAME_AW(GetAtomName)
1682 WINBASEAPI BOOL        WINAPI GetBinaryTypeA( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
1683 WINBASEAPI BOOL        WINAPI GetBinaryTypeW( LPCWSTR lpApplicationName, LPDWORD lpBinaryType );
1684 #define                       GetBinaryType WINELIB_NAME_AW(GetBinaryType)
1685 WINBASEAPI BOOL        WINAPI GetCurrentActCtx(HANDLE *);
1686 WINBASEAPI BOOL        WINAPI GetCommConfig(HANDLE,LPCOMMCONFIG,LPDWORD);
1687 WINBASEAPI BOOL        WINAPI GetCommMask(HANDLE,LPDWORD);
1688 WINBASEAPI BOOL        WINAPI GetCommModemStatus(HANDLE,LPDWORD);
1689 WINBASEAPI BOOL        WINAPI GetCommProperties(HANDLE,LPCOMMPROP);
1690 WINBASEAPI BOOL        WINAPI GetCommState(HANDLE,LPDCB);
1691 WINBASEAPI BOOL        WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
1692 WINBASEAPI LPSTR       WINAPI GetCommandLineA(void);
1693 WINBASEAPI LPWSTR      WINAPI GetCommandLineW(void);
1694 #define                       GetCommandLine WINELIB_NAME_AW(GetCommandLine)
1695 WINBASEAPI DWORD       WINAPI GetCompressedFileSizeA(LPCSTR,LPDWORD);
1696 WINBASEAPI DWORD       WINAPI GetCompressedFileSizeW(LPCWSTR,LPDWORD);
1697 #define                       GetCompressedFileSize WINELIB_NAME_AW(GetCompressedFileSize)
1698 WINBASEAPI BOOL        WINAPI GetComputerNameA(LPSTR,LPDWORD);
1699 WINBASEAPI BOOL        WINAPI GetComputerNameW(LPWSTR,LPDWORD);
1700 #define                       GetComputerName WINELIB_NAME_AW(GetComputerName)
1701 WINBASEAPI BOOL        WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
1702 WINBASEAPI BOOL        WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT,LPWSTR,LPDWORD);
1703 #define                       GetComputerNameEx WINELIB_NAME_AW(GetComputerNameEx)
1704 WINBASEAPI UINT        WINAPI GetCurrentDirectoryA(UINT,LPSTR);
1705 WINBASEAPI UINT        WINAPI GetCurrentDirectoryW(UINT,LPWSTR);
1706 #define                       GetCurrentDirectory WINELIB_NAME_AW(GetCurrentDirectory)
1707 WINADVAPI  BOOL        WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA);
1708 WINADVAPI  BOOL        WINAPI GetCurrentHwProfileW(LPHW_PROFILE_INFOW);
1709 #define                       GetCurrentHwProfile WINELIB_NAME_AW(GetCurrentHwProfile)
1710 WINBASEAPI HANDLE      WINAPI GetCurrentProcess(void);
1711 WINBASEAPI DWORD       WINAPI GetCurrentProcessorNumber(void);
1712 WINBASEAPI VOID        WINAPI GetCurrentProcessorNumberEx(PPROCESSOR_NUMBER);
1713 WINBASEAPI HANDLE      WINAPI GetCurrentThread(void);
1714 #define                       GetCurrentTime() GetTickCount()
1715 WINBASEAPI BOOL        WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD);
1716 WINBASEAPI BOOL        WINAPI GetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,LPDWORD);
1717 #define                       GetDefaultCommConfig WINELIB_NAME_AW(GetDefaultCommConfig)
1718 WINBASEAPI BOOL        WINAPI GetDevicePowerState(HANDLE,BOOL*);
1719 WINBASEAPI BOOL        WINAPI GetDiskFreeSpaceA(LPCSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
1720 WINBASEAPI BOOL        WINAPI GetDiskFreeSpaceW(LPCWSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
1721 #define                       GetDiskFreeSpace WINELIB_NAME_AW(GetDiskFreeSpace)
1722 WINBASEAPI BOOL        WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
1723 WINBASEAPI BOOL        WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
1724 #define                       GetDiskFreeSpaceEx WINELIB_NAME_AW(GetDiskFreeSpaceEx)
1725 WINBASEAPI DWORD       WINAPI GetDllDirectoryA(DWORD,LPSTR);
1726 WINBASEAPI DWORD       WINAPI GetDllDirectoryW(DWORD,LPWSTR);
1727 #define                       GetDllDirectory WINELIB_NAME_AW(GetDllDirectory)
1728 WINBASEAPI UINT        WINAPI GetDriveTypeA(LPCSTR);
1729 WINBASEAPI UINT        WINAPI GetDriveTypeW(LPCWSTR);
1730 #define                       GetDriveType WINELIB_NAME_AW(GetDriveType)
1731 WINBASEAPI DWORD       WINAPI GetDynamicTimeZoneInformation(PDYNAMIC_TIME_ZONE_INFORMATION);
1732 WINBASEAPI LPSTR       WINAPI GetEnvironmentStringsA(void);
1733 WINBASEAPI LPWSTR      WINAPI GetEnvironmentStringsW(void);
1734 #define                       GetEnvironmentStrings WINELIB_NAME_AW(GetEnvironmentStrings)
1735 WINBASEAPI DWORD       WINAPI GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
1736 WINBASEAPI DWORD       WINAPI GetEnvironmentVariableW(LPCWSTR,LPWSTR,DWORD);
1737 #define                       GetEnvironmentVariable WINELIB_NAME_AW(GetEnvironmentVariable)
1738 WINBASEAPI UINT        WINAPI GetErrorMode(void);
1739 WINADVAPI  BOOL        WINAPI GetEventLogInformation(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1740 WINBASEAPI BOOL        WINAPI GetExitCodeProcess(HANDLE,LPDWORD);
1741 WINBASEAPI BOOL        WINAPI GetExitCodeThread(HANDLE,LPDWORD);
1742 WINBASEAPI DWORD       WINAPI GetFileAttributesA(LPCSTR);
1743 WINBASEAPI DWORD       WINAPI GetFileAttributesW(LPCWSTR);
1744 #define                       GetFileAttributes WINELIB_NAME_AW(GetFileAttributes)
1745 WINBASEAPI BOOL        WINAPI GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
1746 WINBASEAPI BOOL        WINAPI GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
1747 #define                       GetFileAttributesEx WINELIB_NAME_AW(GetFileAttributesEx)
1748 WINBASEAPI BOOL        WINAPI GetFileInformationByHandle(HANDLE,BY_HANDLE_FILE_INFORMATION*);
1749 WINADVAPI  BOOL        WINAPI GetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
1750 WINADVAPI  BOOL        WINAPI GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
1751 #define                       GetFileSecurity WINELIB_NAME_AW(GetFileSecurity)
1752 WINBASEAPI DWORD       WINAPI GetFileSize(HANDLE,LPDWORD);
1753 WINBASEAPI BOOL        WINAPI GetFileSizeEx(HANDLE,PLARGE_INTEGER);
1754 WINBASEAPI BOOL        WINAPI GetFileTime(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME);
1755 WINBASEAPI DWORD       WINAPI GetFileType(HANDLE);
1756 #define                       GetFreeSpace(w) (__MSABI_LONG(0x100000))
1757 WINBASEAPI DWORD       WINAPI GetFullPathNameA(LPCSTR,DWORD,LPSTR,LPSTR*);
1758 WINBASEAPI DWORD       WINAPI GetFullPathNameW(LPCWSTR,DWORD,LPWSTR,LPWSTR*);
1759 #define                       GetFullPathName WINELIB_NAME_AW(GetFullPathName)
1760 WINBASEAPI BOOL        WINAPI GetHandleInformation(HANDLE,LPDWORD);
1761 WINADVAPI  BOOL        WINAPI GetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
1762 WINADVAPI  DWORD       WINAPI GetLengthSid(PSID);
1763 WINBASEAPI VOID        WINAPI GetLocalTime(LPSYSTEMTIME);
1764 WINBASEAPI DWORD       WINAPI GetLogicalDrives(void);
1765 WINBASEAPI UINT        WINAPI GetLogicalDriveStringsA(UINT,LPSTR);
1766 WINBASEAPI UINT        WINAPI GetLogicalDriveStringsW(UINT,LPWSTR);
1767 #define                       GetLogicalDriveStrings WINELIB_NAME_AW(GetLogicalDriveStrings)
1768 WINBASEAPI DWORD       WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
1769 WINBASEAPI DWORD       WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
1770 #define                       GetLongPathName WINELIB_NAME_AW(GetLongPathName)
1771 WINBASEAPI BOOL        WINAPI GetMailslotInfo(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
1772 WINBASEAPI DWORD       WINAPI GetModuleFileNameA(HMODULE,LPSTR,DWORD);
1773 WINBASEAPI DWORD       WINAPI GetModuleFileNameW(HMODULE,LPWSTR,DWORD);
1774 #define                       GetModuleFileName WINELIB_NAME_AW(GetModuleFileName)
1775 WINBASEAPI HMODULE     WINAPI GetModuleHandleA(LPCSTR);
1776 WINBASEAPI HMODULE     WINAPI GetModuleHandleW(LPCWSTR);
1777 #define                       GetModuleHandle WINELIB_NAME_AW(GetModuleHandle)
1778 WINBASEAPI BOOL        WINAPI GetModuleHandleExA(DWORD,LPCSTR,HMODULE*);
1779 WINBASEAPI BOOL        WINAPI GetModuleHandleExW(DWORD,LPCWSTR,HMODULE*);
1780 #define                       GetModuleHandleEx WINELIB_NAME_AW(GetModuleHandleEx)
1781 WINBASEAPI BOOL        WINAPI GetNamedPipeHandleStateA(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD);
1782 WINBASEAPI BOOL        WINAPI GetNamedPipeHandleStateW(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR,DWORD);
1783 #define                       GetNamedPipeHandleState WINELIB_NAME_AW(GetNamedPipeHandleState)
1784 WINBASEAPI BOOL        WINAPI GetNamedPipeInfo(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
1785 WINBASEAPI VOID        WINAPI GetNativeSystemInfo(LPSYSTEM_INFO);
1786 WINADVAPI  BOOL        WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD);
1787 WINADVAPI  BOOL        WINAPI GetOldestEventLogRecord(HANDLE,PDWORD);
1788 WINBASEAPI BOOL        WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,BOOL);
1789 WINBASEAPI DWORD       WINAPI GetPriorityClass(HANDLE);
1790 WINADVAPI  BOOL        WINAPI GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
1791 WINBASEAPI UINT        WINAPI GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR);
1792 WINBASEAPI UINT        WINAPI GetPrivateProfileIntW(LPCWSTR,LPCWSTR,INT,LPCWSTR);
1793 #define                       GetPrivateProfileInt WINELIB_NAME_AW(GetPrivateProfileInt)
1794 WINBASEAPI INT         WINAPI GetPrivateProfileSectionA(LPCSTR,LPSTR,DWORD,LPCSTR);
1795 WINBASEAPI INT         WINAPI GetPrivateProfileSectionW(LPCWSTR,LPWSTR,DWORD,LPCWSTR);
1796 #define                       GetPrivateProfileSection WINELIB_NAME_AW(GetPrivateProfileSection)
1797 WINBASEAPI DWORD       WINAPI GetPrivateProfileSectionNamesA(LPSTR,DWORD,LPCSTR);
1798 WINBASEAPI DWORD       WINAPI GetPrivateProfileSectionNamesW(LPWSTR,DWORD,LPCWSTR);
1799 #define                       GetPrivateProfileSectionNames WINELIB_NAME_AW(GetPrivateProfileSectionNames)
1800 WINBASEAPI INT         WINAPI GetPrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT,LPCSTR);
1801 WINBASEAPI INT         WINAPI GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT,LPCWSTR);
1802 #define                       GetPrivateProfileString WINELIB_NAME_AW(GetPrivateProfileString)
1803 WINBASEAPI BOOL        WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
1804 WINBASEAPI BOOL        WINAPI GetPrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);
1805 #define                       GetPrivateProfileStruct WINELIB_NAME_AW(GetPrivateProfileStruct)
1806 WINBASEAPI FARPROC     WINAPI GetProcAddress(HMODULE,LPCSTR);
1807 WINBASEAPI BOOL        WINAPI GetProcessAffinityMask(HANDLE,PDWORD_PTR,PDWORD_PTR);
1808 WINBASEAPI BOOL        WINAPI GetLogicalProcessorInformation(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION,PDWORD);
1809 WINBASEAPI BOOL        WINAPI GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP,PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX,PDWORD);
1810 WINBASEAPI DWORD       WINAPI GetProcessHeaps(DWORD,PHANDLE);
1811 WINBASEAPI DWORD       WINAPI GetProcessId(HANDLE);
1812 WINBASEAPI BOOL        WINAPI GetProcessIoCounters(HANDLE,PIO_COUNTERS);
1813 WINBASEAPI BOOL        WINAPI GetProcessPriorityBoost(HANDLE,PBOOL);
1814 WINBASEAPI BOOL        WINAPI GetProcessShutdownParameters(LPDWORD,LPDWORD);
1815 WINBASEAPI BOOL        WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
1816 WINBASEAPI DWORD       WINAPI GetProcessVersion(DWORD);
1817 WINBASEAPI BOOL        WINAPI GetProcessWorkingSetSize(HANDLE,PSIZE_T,PSIZE_T);
1818 WINBASEAPI BOOL        WINAPI GetProductInfo(DWORD,DWORD,DWORD,DWORD,PDWORD);
1819 WINBASEAPI UINT        WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT);
1820 WINBASEAPI UINT        WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT);
1821 #define                       GetProfileInt WINELIB_NAME_AW(GetProfileInt)
1822 WINBASEAPI INT         WINAPI GetProfileSectionA(LPCSTR,LPSTR,DWORD);
1823 WINBASEAPI INT         WINAPI GetProfileSectionW(LPCWSTR,LPWSTR,DWORD);
1824 #define                       GetProfileSection WINELIB_NAME_AW(GetProfileSection)
1825 WINBASEAPI INT         WINAPI GetProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT);
1826 WINBASEAPI INT         WINAPI GetProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT);
1827 #define                       GetProfileString WINELIB_NAME_AW(GetProfileString)
1828 WINBASEAPI BOOL        WINAPI GetQueuedCompletionStatus(HANDLE,LPDWORD,PULONG_PTR,LPOVERLAPPED*,DWORD);
1829 WINADVAPI  BOOL        WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1830 WINADVAPI  BOOL        WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL *,LPBOOL);
1831 WINADVAPI  BOOL        WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID *,LPBOOL);
1832 WINADVAPI  DWORD       WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
1833 WINADVAPI  BOOL        WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID *,LPBOOL);
1834 WINADVAPI  BOOL        WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL *,LPBOOL);
1835 WINADVAPI  PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
1836 WINADVAPI  DWORD       WINAPI GetSidLengthRequired(BYTE);
1837 WINADVAPI  PDWORD      WINAPI GetSidSubAuthority(PSID,DWORD);
1838 WINADVAPI  PUCHAR      WINAPI GetSidSubAuthorityCount(PSID);
1839 WINBASEAPI DWORD       WINAPI GetShortPathNameA(LPCSTR,LPSTR,DWORD);
1840 WINBASEAPI DWORD       WINAPI GetShortPathNameW(LPCWSTR,LPWSTR,DWORD);
1841 #define                       GetShortPathName WINELIB_NAME_AW(GetShortPathName)
1842 WINBASEAPI VOID        WINAPI GetStartupInfoA(LPSTARTUPINFOA);
1843 WINBASEAPI VOID        WINAPI GetStartupInfoW(LPSTARTUPINFOW);
1844 #define                       GetStartupInfo WINELIB_NAME_AW(GetStartupInfo)
1845 WINBASEAPI HANDLE      WINAPI GetStdHandle(DWORD);
1846 WINBASEAPI UINT        WINAPI GetSystemDirectoryA(LPSTR,UINT);
1847 WINBASEAPI UINT        WINAPI GetSystemDirectoryW(LPWSTR,UINT);
1848 #define                       GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
1849 WINBASEAPI VOID        WINAPI GetSystemInfo(LPSYSTEM_INFO);
1850 WINBASEAPI BOOL        WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
1851 WINBASEAPI BOOL        WINAPI GetSystemRegistryQuota(PDWORD,PDWORD);
1852 WINBASEAPI VOID        WINAPI GetSystemTime(LPSYSTEMTIME);
1853 WINBASEAPI BOOL        WINAPI GetSystemTimeAdjustment(PDWORD,PDWORD,PBOOL);
1854 WINBASEAPI VOID        WINAPI GetSystemTimeAsFileTime(LPFILETIME);
1855 WINBASEAPI UINT        WINAPI GetSystemWindowsDirectoryA(LPSTR,UINT);
1856 WINBASEAPI UINT        WINAPI GetSystemWindowsDirectoryW(LPWSTR,UINT);
1857 #define                       GetSystemWindowsDirectory WINELIB_NAME_AW(GetSystemWindowsDirectory)
1858 WINBASEAPI UINT        WINAPI GetSystemWow64DirectoryA(LPSTR,UINT);
1859 WINBASEAPI UINT        WINAPI GetSystemWow64DirectoryW(LPWSTR,UINT);
1860 #define                       GetSystemWow64Directory WINELIB_NAME_AW(GetSystemWow64Directory)
1861 WINBASEAPI DWORD       WINAPI GetTapeParameters(HANDLE,DWORD,LPDWORD,LPVOID);
1862 WINBASEAPI DWORD       WINAPI GetTapePosition(HANDLE,DWORD,LPDWORD,LPDWORD,LPDWORD);
1863 WINBASEAPI DWORD       WINAPI GetTapeStatus(HANDLE);
1864 WINBASEAPI UINT        WINAPI GetTempFileNameA(LPCSTR,LPCSTR,UINT,LPSTR);
1865 WINBASEAPI UINT        WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
1866 #define                       GetTempFileName WINELIB_NAME_AW(GetTempFileName)
1867 WINBASEAPI DWORD       WINAPI GetTempPathA(DWORD,LPSTR);
1868 WINBASEAPI DWORD       WINAPI GetTempPathW(DWORD,LPWSTR);
1869 #define                       GetTempPath WINELIB_NAME_AW(GetTempPath)
1870 WINBASEAPI DWORD       WINAPI GetThreadId(HANDLE);
1871 WINBASEAPI BOOL        WINAPI GetThreadIOPendingFlag(HANDLE,PBOOL);
1872 WINBASEAPI DWORD       WINAPI GetTickCount(void);
1873 WINBASEAPI ULONGLONG   WINAPI GetTickCount64(void);
1874 WINBASEAPI DWORD       WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1875 WINBASEAPI BOOL        WINAPI GetThreadContext(HANDLE,CONTEXT *);
1876 WINBASEAPI DWORD       WINAPI GetThreadErrorMode(void);
1877 WINBASEAPI INT         WINAPI GetThreadPriority(HANDLE);
1878 WINBASEAPI BOOL        WINAPI GetThreadPriorityBoost(HANDLE,PBOOL);
1879 WINBASEAPI BOOL        WINAPI GetThreadSelectorEntry(HANDLE,DWORD,LPLDT_ENTRY);
1880 WINBASEAPI BOOL        WINAPI GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
1881 WINADVAPI  BOOL        WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD,LPDWORD);
1882 WINADVAPI  BOOL        WINAPI GetUserNameA(LPSTR,LPDWORD);
1883 WINADVAPI  BOOL        WINAPI GetUserNameW(LPWSTR,LPDWORD);
1884 #define                       GetUserName WINELIB_NAME_AW(GetUserName)
1885 WINBASEAPI DWORD       WINAPI GetVersion(void);
1886 WINBASEAPI BOOL        WINAPI GetVersionExA(OSVERSIONINFOA*);
1887 WINBASEAPI BOOL        WINAPI GetVersionExW(OSVERSIONINFOW*);
1888 #define                       GetVersionEx WINELIB_NAME_AW(GetVersionEx)
1889 WINBASEAPI BOOL        WINAPI GetVolumeInformationA(LPCSTR,LPSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD);
1890 WINBASEAPI BOOL        WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR,DWORD);
1891 #define                       GetVolumeInformation WINELIB_NAME_AW(GetVolumeInformation)
1892 WINBASEAPI BOOL        WINAPI GetVolumeNameForVolumeMountPointA(LPCSTR,LPSTR,DWORD);
1893 WINBASEAPI BOOL        WINAPI GetVolumeNameForVolumeMountPointW(LPCWSTR,LPWSTR,DWORD);
1894 #define                       GetVolumeNameForVolumeMountPoint WINELIB_NAME_AW(GetVolumeNameForVolumeMountPoint)
1895 WINBASEAPI BOOL        WINAPI GetVolumePathNameA(LPCSTR,LPSTR,DWORD);
1896 WINBASEAPI BOOL        WINAPI GetVolumePathNameW(LPCWSTR,LPWSTR,DWORD);
1897 #define                       GetVolumePathName WINELIB_NAME_AW(GetVolumePathName)
1898 WINBASEAPI BOOL        WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR,LPSTR,DWORD,PDWORD);
1899 WINBASEAPI BOOL        WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD);
1900 #define                       GetVolumePathNamesForVolumeName WINELIB_NAME_AW(GetVolumePathNamesForVolumeName)
1901 WINBASEAPI UINT        WINAPI GetWindowsDirectoryA(LPSTR,UINT);
1902 WINBASEAPI UINT        WINAPI GetWindowsDirectoryW(LPWSTR,UINT);
1903 #define                       GetWindowsDirectory WINELIB_NAME_AW(GetWindowsDirectory)
1904 WINBASEAPI UINT        WINAPI GetWriteWatch(DWORD,LPVOID,SIZE_T,LPVOID*,ULONG_PTR*,ULONG*);
1905 WINBASEAPI ATOM        WINAPI GlobalAddAtomA(LPCSTR);
1906 WINBASEAPI ATOM        WINAPI GlobalAddAtomW(LPCWSTR);
1907 #define                       GlobalAddAtom WINELIB_NAME_AW(GlobalAddAtom)
1908 WINBASEAPI HGLOBAL     WINAPI GlobalAlloc(UINT,SIZE_T) __WINE_ALLOC_SIZE(2);
1909 WINBASEAPI SIZE_T      WINAPI GlobalCompact(DWORD);
1910 WINBASEAPI ATOM        WINAPI GlobalDeleteAtom(ATOM);
1911 WINBASEAPI ATOM        WINAPI GlobalFindAtomA(LPCSTR);
1912 WINBASEAPI ATOM        WINAPI GlobalFindAtomW(LPCWSTR);
1913 #define                       GlobalFindAtom WINELIB_NAME_AW(GlobalFindAtom)
1914 WINBASEAPI VOID        WINAPI GlobalFix(HGLOBAL);
1915 WINBASEAPI UINT        WINAPI GlobalFlags(HGLOBAL);
1916 WINBASEAPI HGLOBAL     WINAPI GlobalFree(HGLOBAL);
1917 WINBASEAPI UINT        WINAPI GlobalGetAtomNameA(ATOM,LPSTR,INT);
1918 WINBASEAPI UINT        WINAPI GlobalGetAtomNameW(ATOM,LPWSTR,INT);
1919 #define                       GlobalGetAtomName WINELIB_NAME_AW(GlobalGetAtomName)
1920 WINBASEAPI HGLOBAL     WINAPI GlobalHandle(LPCVOID);
1921 WINBASEAPI LPVOID      WINAPI GlobalLock(HGLOBAL);
1922 WINBASEAPI VOID        WINAPI GlobalMemoryStatus(LPMEMORYSTATUS);
1923 WINBASEAPI BOOL        WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX);
1924 WINBASEAPI HGLOBAL     WINAPI GlobalReAlloc(HGLOBAL,SIZE_T,UINT) __WINE_ALLOC_SIZE(3);
1925 WINBASEAPI SIZE_T      WINAPI GlobalSize(HGLOBAL);
1926 WINBASEAPI VOID        WINAPI GlobalUnfix(HGLOBAL);
1927 WINBASEAPI BOOL        WINAPI GlobalUnlock(HGLOBAL);
1928 WINBASEAPI BOOL        WINAPI GlobalUnWire(HGLOBAL);
1929 WINBASEAPI LPVOID      WINAPI GlobalWire(HGLOBAL);
1930 #define                       HasOverlappedCompleted(lpOverlapped) ((lpOverlapped)->Internal != STATUS_PENDING)
1931 WINBASEAPI LPVOID      WINAPI HeapAlloc(HANDLE,DWORD,SIZE_T) __WINE_ALLOC_SIZE(3);
1932 WINBASEAPI SIZE_T      WINAPI HeapCompact(HANDLE,DWORD);
1933 WINBASEAPI HANDLE      WINAPI HeapCreate(DWORD,SIZE_T,SIZE_T);
1934 WINBASEAPI BOOL        WINAPI HeapDestroy(HANDLE);
1935 WINBASEAPI BOOL        WINAPI HeapFree(HANDLE,DWORD,LPVOID);
1936 WINBASEAPI BOOL        WINAPI HeapLock(HANDLE);
1937 WINBASEAPI LPVOID      WINAPI HeapReAlloc(HANDLE,DWORD,LPVOID,SIZE_T) __WINE_ALLOC_SIZE(4);
1938 WINBASEAPI BOOL        WINAPI HeapQueryInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
1939 WINBASEAPI BOOL        WINAPI HeapSetInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
1940 WINBASEAPI SIZE_T      WINAPI HeapSize(HANDLE,DWORD,LPCVOID);
1941 WINBASEAPI BOOL        WINAPI HeapUnlock(HANDLE);
1942 WINBASEAPI BOOL        WINAPI HeapValidate(HANDLE,DWORD,LPCVOID);
1943 WINBASEAPI BOOL        WINAPI HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
1944 WINBASEAPI BOOL        WINAPI InitAtomTable(DWORD);
1945 WINADVAPI  BOOL        WINAPI InitializeAcl(PACL,DWORD,DWORD);
1946 WINBASEAPI VOID        WINAPI InitializeConditionVariable(PCONDITION_VARIABLE);
1947 WINBASEAPI void        WINAPI InitializeCriticalSection(CRITICAL_SECTION *lpCrit);
1948 WINBASEAPI BOOL        WINAPI InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION *,DWORD);
1949 WINBASEAPI BOOL        WINAPI InitializeCriticalSectionEx(CRITICAL_SECTION *,DWORD,DWORD);
1950 WINADVAPI  BOOL        WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1951 WINADVAPI  BOOL        WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1952 WINBASEAPI VOID        WINAPI InitializeSListHead(PSLIST_HEADER);
1953 WINBASEAPI VOID        WINAPI InitializeSRWLock(PSRWLOCK);
1954 WINBASEAPI BOOL        WINAPI InitOnceExecuteOnce(PINIT_ONCE,PINIT_ONCE_FN,PVOID,PVOID*);
1955 WINBASEAPI VOID        WINAPI InitOnceInitialize(PINIT_ONCE);
1956 WINBASEAPI PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER);
1957 WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER);
1958 WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER, PSLIST_ENTRY);
1959 WINBASEAPI BOOL        WINAPI IsBadCodePtr(FARPROC);
1960 WINBASEAPI BOOL        WINAPI IsBadHugeReadPtr(LPCVOID,UINT);
1961 WINBASEAPI BOOL        WINAPI IsBadHugeWritePtr(LPVOID,UINT);
1962 WINBASEAPI BOOL        WINAPI IsBadReadPtr(LPCVOID,UINT);
1963 WINBASEAPI BOOL        WINAPI IsBadStringPtrA(LPCSTR,UINT);
1964 WINBASEAPI BOOL        WINAPI IsBadStringPtrW(LPCWSTR,UINT);
1965 #define                       IsBadStringPtr WINELIB_NAME_AW(IsBadStringPtr)
1966 WINBASEAPI BOOL        WINAPI IsBadWritePtr(LPVOID,UINT);
1967 WINBASEAPI BOOL        WINAPI IsDebuggerPresent(void);
1968 WINBASEAPI BOOL        WINAPI IsSystemResumeAutomatic(void);
1969 WINADVAPI  BOOL        WINAPI IsTextUnicode(LPCVOID,INT,LPINT);
1970 WINADVAPI  BOOL        WINAPI IsTokenRestricted(HANDLE);
1971 WINADVAPI  BOOL        WINAPI IsValidAcl(PACL);
1972 WINADVAPI  BOOL        WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1973 WINADVAPI  BOOL        WINAPI IsValidSid(PSID);
1974 WINADVAPI  BOOL        WINAPI IsWellKnownSid(PSID,WELL_KNOWN_SID_TYPE);
1975 WINBASEAPI BOOL        WINAPI IsWow64Process(HANDLE,PBOOL);
1976 WINADVAPI  BOOL        WINAPI ImpersonateLoggedOnUser(HANDLE);
1977 WINADVAPI  BOOL        WINAPI ImpersonateNamedPipeClient(HANDLE);
1978 WINADVAPI  BOOL        WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1979 WINBASEAPI BOOL        WINAPI IsProcessInJob(HANDLE,HANDLE,PBOOL);
1980 WINBASEAPI BOOL        WINAPI IsProcessorFeaturePresent(DWORD);
1981 WINBASEAPI void        WINAPI LeaveCriticalSection(CRITICAL_SECTION *lpCrit);
1982 WINBASEAPI HMODULE     WINAPI LoadLibraryA(LPCSTR);
1983 WINBASEAPI HMODULE     WINAPI LoadLibraryW(LPCWSTR);
1984 #define                       LoadLibrary WINELIB_NAME_AW(LoadLibrary)
1985 WINBASEAPI HMODULE     WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD);
1986 WINBASEAPI HMODULE     WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);
1987 #define                       LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx)
1988 WINBASEAPI DWORD       WINAPI LoadModule(LPCSTR,LPVOID);
1989 WINBASEAPI HGLOBAL     WINAPI LoadResource(HMODULE,HRSRC);
1990 WINBASEAPI HLOCAL      WINAPI LocalAlloc(UINT,SIZE_T) __WINE_ALLOC_SIZE(2);
1991 WINBASEAPI SIZE_T      WINAPI LocalCompact(UINT);
1992 WINBASEAPI UINT        WINAPI LocalFlags(HLOCAL);
1993 WINBASEAPI HLOCAL      WINAPI LocalFree(HLOCAL);
1994 WINBASEAPI HLOCAL      WINAPI LocalHandle(LPCVOID);
1995 WINBASEAPI LPVOID      WINAPI LocalLock(HLOCAL);
1996 WINBASEAPI HLOCAL      WINAPI LocalReAlloc(HLOCAL,SIZE_T,UINT) __WINE_ALLOC_SIZE(3);
1997 WINBASEAPI SIZE_T      WINAPI LocalShrink(HGLOBAL,UINT);
1998 WINBASEAPI SIZE_T      WINAPI LocalSize(HLOCAL);
1999 WINBASEAPI BOOL        WINAPI LocalUnlock(HLOCAL);
2000 WINBASEAPI LPVOID      WINAPI LockResource(HGLOBAL);
2001 #define                       LockSegment(handle) GlobalFix((HANDLE)(handle))
2002 WINADVAPI  BOOL        WINAPI LookupAccountNameA(LPCSTR,LPCSTR,PSID,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
2003 WINADVAPI  BOOL        WINAPI LookupAccountNameW(LPCWSTR,LPCWSTR,PSID,LPDWORD,LPWSTR,LPDWORD,PSID_NAME_USE);
2004 #define                       LookupAccountName WINELIB_NAME_AW(LookupAccountName)
2005 WINADVAPI  BOOL        WINAPI LookupAccountSidA(LPCSTR,PSID,LPSTR,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
2006 WINADVAPI  BOOL        WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,LPDWORD,LPWSTR,LPDWORD,PSID_NAME_USE);
2007 #define                       LookupAccountSid WINELIB_NAME_AW(LookupAccountSid)
2008 WINBASEAPI BOOL        WINAPI LocalFileTimeToFileTime(const FILETIME*,LPFILETIME);
2009 WINBASEAPI BOOL        WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
2010 WINBASEAPI BOOL        WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED);
2011 WINADVAPI  BOOL        WINAPI LogonUserA(LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD,PHANDLE);
2012 WINADVAPI  BOOL        WINAPI LogonUserW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,DWORD,PHANDLE);
2013 #define                       LogonUser WINELIB_NAME_AW(LogonUser)
2014 WINADVAPI  BOOL        WINAPI LookupPrivilegeDisplayNameA(LPCSTR,LPCSTR,LPSTR,LPDWORD,LPDWORD);
2015 WINADVAPI  BOOL        WINAPI LookupPrivilegeDisplayNameW(LPCWSTR,LPCWSTR,LPWSTR,LPDWORD,LPDWORD);
2016 #define                       LookupPrivilegeDisplayName WINELIB_NAME_AW(LookupPrivilegeDisplayName)
2017 WINADVAPI  BOOL        WINAPI LookupPrivilegeNameA(LPCSTR,PLUID,LPSTR,LPDWORD);
2018 WINADVAPI  BOOL        WINAPI LookupPrivilegeNameW(LPCWSTR,PLUID,LPWSTR,LPDWORD);
2019 #define                       LookupPrivilegeName WINELIB_NAME_AW(LookupPrivilegeName)
2020 WINADVAPI  BOOL        WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,PLUID);
2021 WINADVAPI  BOOL        WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,PLUID);
2022 #define                       LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue)
2023 WINADVAPI  BOOL        WINAPI MakeAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD,PACL,LPDWORD,PACL,LPDWORD,PSID,LPDWORD,PSID,LPDWORD);
2024 WINBASEAPI void        WINAPI MakeCriticalSectionGlobal(CRITICAL_SECTION *lpCrit);
2025 #define                       MakeProcInstance(proc,inst) (proc)
2026 WINADVAPI  BOOL        WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
2027 WINADVAPI  VOID        WINAPI MapGenericMask(PDWORD,PGENERIC_MAPPING);
2028 WINBASEAPI HMODULE     WINAPI MapHModuleSL(WORD);
2029 WINBASEAPI WORD        WINAPI MapHModuleLS(HMODULE);
2030 WINBASEAPI LPVOID      WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,SIZE_T);
2031 WINBASEAPI LPVOID      WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,SIZE_T,LPVOID);
2032 WINBASEAPI BOOL        WINAPI MoveFileA(LPCSTR,LPCSTR);
2033 WINBASEAPI BOOL        WINAPI MoveFileW(LPCWSTR,LPCWSTR);
2034 #define                       MoveFile WINELIB_NAME_AW(MoveFile)
2035 WINBASEAPI BOOL        WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD);
2036 WINBASEAPI BOOL        WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD);
2037 #define                       MoveFileEx WINELIB_NAME_AW(MoveFileEx)
2038 WINBASEAPI BOOL        WINAPI MoveFileWithProgressA(LPCSTR,LPCSTR,LPPROGRESS_ROUTINE,LPVOID,DWORD);
2039 WINBASEAPI BOOL        WINAPI MoveFileWithProgressW(LPCWSTR,LPCWSTR,LPPROGRESS_ROUTINE,LPVOID,DWORD);
2040 #define                       MoveFileWithProgress WINELIB_NAME_AW(MoveFileWithProgress)
2041 WINBASEAPI INT         WINAPI MulDiv(INT,INT,INT);
2042 WINBASEAPI BOOL        WINAPI NeedCurrentDirectoryForExePathA(LPCSTR);
2043 WINBASEAPI BOOL        WINAPI NeedCurrentDirectoryForExePathW(LPCWSTR);
2044 #define                       NeedCurrentDirectoryForExePath WINELIB_NAME_AW(NeedCurrentDirectoryForExePath)
2045 WINADVAPI  BOOL        WINAPI NotifyChangeEventLog(HANDLE,HANDLE);
2046 WINADVAPI  BOOL        WINAPI ObjectCloseAuditAlarmA(LPCSTR,LPVOID,BOOL);
2047 WINADVAPI  BOOL        WINAPI ObjectCloseAuditAlarmW(LPCWSTR,LPVOID,BOOL);
2048 #define                       ObjectCloseAuditAlarm WINELIB_NAME_AW(ObjectCloseAuditAlarm)
2049 WINADVAPI  BOOL        WINAPI ObjectDeleteAuditAlarmA(LPCSTR,LPVOID,BOOL);
2050 WINADVAPI  BOOL        WINAPI ObjectDeleteAuditAlarmW(LPCWSTR,LPVOID,BOOL);
2051 #define                       ObjectDeleteAuditAlarm WINELIB_NAME_AW(ObjectDeleteAuditAlarm)
2052 WINADVAPI  BOOL        WINAPI ObjectOpenAuditAlarmA(LPCSTR,LPVOID,LPSTR,LPSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,LPBOOL);
2053 WINADVAPI  BOOL        WINAPI ObjectOpenAuditAlarmW(LPCWSTR,LPVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,LPBOOL);
2054 #define                       ObjectOpenAuditAlarm WINELIB_NAME_AW(ObjectOpenAuditAlarm)
2055 WINADVAPI  BOOL        WINAPI ObjectPrivilegeAuditAlarmA(LPCSTR,LPVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL);
2056 WINADVAPI  BOOL        WINAPI ObjectPrivilegeAuditAlarmW(LPCWSTR,LPVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL);
2057 #define                       ObjectPrivilegeAuditAlarm WINELIB_NAME_AW(ObjectPrivilegeAuditAlarm)
2058 WINADVAPI  HANDLE      WINAPI OpenBackupEventLogA(LPCSTR,LPCSTR);
2059 WINADVAPI  HANDLE      WINAPI OpenBackupEventLogW(LPCWSTR,LPCWSTR);
2060 #define                       OpenBackupEventLog WINELIB_NAME_AW(OpenBackupEventLog)
2061 WINBASEAPI HANDLE      WINAPI OpenEventA(DWORD,BOOL,LPCSTR);
2062 WINBASEAPI HANDLE      WINAPI OpenEventW(DWORD,BOOL,LPCWSTR);
2063 #define                       OpenEvent WINELIB_NAME_AW(OpenEvent)
2064 WINADVAPI  HANDLE      WINAPI OpenEventLogA(LPCSTR,LPCSTR);
2065 WINADVAPI  HANDLE      WINAPI OpenEventLogW(LPCWSTR,LPCWSTR);
2066 #define                       OpenEventLog WINELIB_NAME_AW(OpenEventLog)
2067 WINBASEAPI HFILE       WINAPI OpenFile(LPCSTR,OFSTRUCT*,UINT);
2068 WINBASEAPI HANDLE      WINAPI OpenFileMappingA(DWORD,BOOL,LPCSTR);
2069 WINBASEAPI HANDLE      WINAPI OpenFileMappingW(DWORD,BOOL,LPCWSTR);
2070 #define                       OpenFileMapping WINELIB_NAME_AW(OpenFileMapping)
2071 WINBASEAPI HANDLE      WINAPI OpenJobObjectA(DWORD,BOOL,LPCSTR);
2072 WINBASEAPI HANDLE      WINAPI OpenJobObjectW(DWORD,BOOL,LPCWSTR);
2073 #define                       OpenJobObject WINELIB_NAME_AW(OpenJobObject)
2074 WINBASEAPI HANDLE      WINAPI OpenMutexA(DWORD,BOOL,LPCSTR);
2075 WINBASEAPI HANDLE      WINAPI OpenMutexW(DWORD,BOOL,LPCWSTR);
2076 #define                       OpenMutex WINELIB_NAME_AW(OpenMutex)
2077 WINBASEAPI HANDLE      WINAPI OpenProcess(DWORD,BOOL,DWORD);
2078 WINADVAPI  BOOL        WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);
2079 WINBASEAPI HANDLE      WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR);
2080 WINBASEAPI HANDLE      WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR);
2081 #define                       OpenSemaphore WINELIB_NAME_AW(OpenSemaphore)
2082 WINBASEAPI HANDLE      WINAPI OpenThread(DWORD,BOOL,DWORD);
2083 WINADVAPI  BOOL        WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE);
2084 WINBASEAPI HANDLE      WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR);
2085 WINBASEAPI HANDLE      WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR);
2086 #define                       OpenWaitableTimer WINELIB_NAME_AW(OpenWaitableTimer)
2087 WINBASEAPI VOID        WINAPI OutputDebugStringA(LPCSTR);
2088 WINBASEAPI VOID        WINAPI OutputDebugStringW(LPCWSTR);
2089 #define                       OutputDebugString WINELIB_NAME_AW(OutputDebugString)
2090 WINBASEAPI BOOL        WINAPI PeekNamedPipe(HANDLE,PVOID,DWORD,PDWORD,PDWORD,PDWORD);
2091 WINBASEAPI BOOL        WINAPI PostQueuedCompletionStatus(HANDLE,DWORD,ULONG_PTR,LPOVERLAPPED);
2092 WINBASEAPI DWORD       WINAPI PrepareTape(HANDLE,DWORD,BOOL);
2093 WINBASEAPI BOOL        WINAPI ProcessIdToSessionId(DWORD,DWORD*);
2094 WINADVAPI  BOOL        WINAPI PrivilegeCheck(HANDLE,PPRIVILEGE_SET,LPBOOL);
2095 WINADVAPI  BOOL        WINAPI PrivilegedServiceAuditAlarmA(LPCSTR,LPCSTR,HANDLE,PPRIVILEGE_SET,BOOL);
2096 WINADVAPI  BOOL        WINAPI PrivilegedServiceAuditAlarmW(LPCWSTR,LPCWSTR,HANDLE,PPRIVILEGE_SET,BOOL);
2097 #define                       PrivilegedServiceAuditAlarm WINELIB_NAME_AW(PrivilegedServiceAuditAlarm)
2098 WINBASEAPI BOOL        WINAPI PulseEvent(HANDLE);
2099 WINBASEAPI BOOL        WINAPI PurgeComm(HANDLE,DWORD);
2100 WINBASEAPI BOOL        WINAPI QueryActCtxW(DWORD,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T *);
2101 WINBASEAPI USHORT      WINAPI QueryDepthSList(PSLIST_HEADER);
2102 WINBASEAPI DWORD       WINAPI QueryDosDeviceA(LPCSTR,LPSTR,DWORD);
2103 WINBASEAPI DWORD       WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);
2104 #define                       QueryDosDevice WINELIB_NAME_AW(QueryDosDevice)
2105 WINBASEAPI BOOL        WINAPI QueryFullProcessImageNameA(HANDLE,DWORD,LPSTR,PDWORD);
2106 WINBASEAPI BOOL        WINAPI QueryFullProcessImageNameW(HANDLE,DWORD,LPWSTR,PDWORD);
2107 #define                       QueryFullProcessImageName WINELIB_NAME_AW(QueryFullProcessImageName)
2108 WINBASEAPI BOOL        WINAPI QueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,LPVOID,DWORD,DWORD*);
2109 WINBASEAPI BOOL        WINAPI QueryMemoryResourceNotification(HANDLE,PBOOL);
2110 WINBASEAPI BOOL        WINAPI QueryPerformanceCounter(LARGE_INTEGER*);
2111 WINBASEAPI BOOL        WINAPI QueryPerformanceFrequency(LARGE_INTEGER*);
2112 WINBASEAPI DWORD       WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
2113 WINBASEAPI BOOL        WINAPI QueueUserWorkItem(LPTHREAD_START_ROUTINE,PVOID,ULONG);
2114 WINBASEAPI void        WINAPI RaiseException(DWORD,DWORD,DWORD,const ULONG_PTR *);
2115 WINADVAPI  BOOL        WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
2116 WINADVAPI  BOOL        WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
2117 #define                       ReadEventLog WINELIB_NAME_AW(ReadEventLog)
2118 WINBASEAPI BOOL        WINAPI ReadDirectoryChangesW(HANDLE,LPVOID,DWORD,BOOL,DWORD,LPDWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
2119 WINBASEAPI BOOL        WINAPI ReadFile(HANDLE,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
2120 WINBASEAPI BOOL        WINAPI ReadFileEx(HANDLE,LPVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
2121 WINBASEAPI BOOL        WINAPI ReadFileScatter(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED);
2122 WINBASEAPI BOOL        WINAPI ReadProcessMemory(HANDLE,LPCVOID,LPVOID,SIZE_T,SIZE_T*);
2123 WINADVAPI  HANDLE      WINAPI RegisterEventSourceA(LPCSTR,LPCSTR);
2124 WINADVAPI  HANDLE      WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR);
2125 #define                       RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
2126 WINBASEAPI BOOL        WINAPI RegisterWaitForSingleObject(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG);
2127 WINBASEAPI HANDLE      WINAPI RegisterWaitForSingleObjectEx(HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG);
2128 WINBASEAPI VOID        WINAPI ReleaseActCtx(HANDLE);
2129 WINBASEAPI BOOL        WINAPI ReleaseMutex(HANDLE);
2130 WINBASEAPI BOOL        WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG);
2131 WINBASEAPI VOID        WINAPI ReleaseSRWLockExclusive(PSRWLOCK);
2132 WINBASEAPI VOID        WINAPI ReleaseSRWLockShared(PSRWLOCK);
2133 WINBASEAPI ULONG       WINAPI RemoveVectoredExceptionHandler(PVOID);
2134 WINBASEAPI BOOL        WINAPI ReplaceFileA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPVOID,LPVOID);
2135 WINBASEAPI BOOL        WINAPI ReplaceFileW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPVOID,LPVOID);
2136 #define                       ReplaceFile WINELIB_NAME_AW(ReplaceFile)
2137 WINBASEAPI BOOL        WINAPI RemoveDirectoryA(LPCSTR);
2138 WINBASEAPI BOOL        WINAPI RemoveDirectoryW(LPCWSTR);
2139 #define                       RemoveDirectory WINELIB_NAME_AW(RemoveDirectory)
2140 WINADVAPI  BOOL        WINAPI ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR *,LPVOID);
2141 WINADVAPI  BOOL        WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR *,LPVOID);
2142 WINBASEAPI BOOL        WINAPI RequestWakeupLatency(LATENCY_TIME latency);
2143 #define                       ReportEvent WINELIB_NAME_AW(ReportEvent)
2144 WINBASEAPI BOOL        WINAPI ResetEvent(HANDLE);
2145 WINBASEAPI UINT        WINAPI ResetWriteWatch(LPVOID,SIZE_T);
2146 WINBASEAPI DWORD       WINAPI ResumeThread(HANDLE);
2147 WINADVAPI  BOOL        WINAPI RevertToSelf(void);
2148 WINBASEAPI DWORD       WINAPI SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
2149 WINBASEAPI DWORD       WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
2150 #define                       SearchPath WINELIB_NAME_AW(SearchPath)
2151 WINADVAPI  BOOL        WINAPI SetAclInformation(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
2152 WINBASEAPI BOOL        WINAPI SetCommConfig(HANDLE,LPCOMMCONFIG,DWORD);
2153 WINBASEAPI BOOL        WINAPI SetCommBreak(HANDLE);
2154 WINBASEAPI BOOL        WINAPI SetCommMask(HANDLE,DWORD);
2155 WINBASEAPI BOOL        WINAPI SetCommState(HANDLE,LPDCB);
2156 WINBASEAPI BOOL        WINAPI SetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
2157 WINBASEAPI BOOL        WINAPI SetComputerNameA(LPCSTR);
2158 WINBASEAPI BOOL        WINAPI SetComputerNameW(LPCWSTR);
2159 #define                       SetComputerName WINELIB_NAME_AW(SetComputerName)
2160 WINBASEAPI BOOL        WINAPI SetComputerNameExA(COMPUTER_NAME_FORMAT,LPCSTR);
2161 WINBASEAPI BOOL        WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT,LPCWSTR);
2162 #define                       SetComputerNameEx WINELIB_NAME_AW(SetComputerNameEx)
2163 WINBASEAPI DWORD       WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION,DWORD);
2164 WINBASEAPI BOOL        WINAPI SetCurrentDirectoryA(LPCSTR);
2165 WINBASEAPI BOOL        WINAPI SetCurrentDirectoryW(LPCWSTR);
2166 #define                       SetCurrentDirectory WINELIB_NAME_AW(SetCurrentDirectory)
2167 WINBASEAPI BOOL        WINAPI SetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,DWORD);
2168 WINBASEAPI BOOL        WINAPI SetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,DWORD);
2169 #define                       SetDefaultCommConfig WINELIB_NAME_AW(SetDefaultCommConfig)
2170 WINBASEAPI BOOL        WINAPI SetDllDirectoryA(LPCSTR);
2171 WINBASEAPI BOOL        WINAPI SetDllDirectoryW(LPCWSTR);
2172 #define                       SetDllDirectory WINELIB_NAME_AW(SetDllDirectory)
2173 WINBASEAPI BOOL        WINAPI SetDynamicTimeZoneInformation(CONST DYNAMIC_TIME_ZONE_INFORMATION*);
2174 WINBASEAPI BOOL        WINAPI SetEndOfFile(HANDLE);
2175 WINBASEAPI BOOL        WINAPI SetEnvironmentVariableA(LPCSTR,LPCSTR);
2176 WINBASEAPI BOOL        WINAPI SetEnvironmentVariableW(LPCWSTR,LPCWSTR);
2177 #define                       SetEnvironmentVariable WINELIB_NAME_AW(SetEnvironmentVariable)
2178 WINBASEAPI UINT        WINAPI SetErrorMode(UINT);
2179 WINBASEAPI BOOL        WINAPI SetEvent(HANDLE);
2180 WINBASEAPI VOID        WINAPI SetFileApisToANSI(void);
2181 WINBASEAPI VOID        WINAPI SetFileApisToOEM(void);
2182 WINBASEAPI BOOL        WINAPI SetFileAttributesA(LPCSTR,DWORD);
2183 WINBASEAPI BOOL        WINAPI SetFileAttributesW(LPCWSTR,DWORD);
2184 #define                       SetFileAttributes WINELIB_NAME_AW(SetFileAttributes)
2185 WINBASEAPI DWORD       WINAPI SetFilePointer(HANDLE,LONG,LPLONG,DWORD);
2186 WINBASEAPI BOOL        WINAPI SetFilePointerEx(HANDLE,LARGE_INTEGER,LARGE_INTEGER*,DWORD);
2187 WINADVAPI  BOOL        WINAPI SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2188 WINADVAPI  BOOL        WINAPI SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2189 #define                       SetFileSecurity WINELIB_NAME_AW(SetFileSecurity)
2190 WINBASEAPI BOOL        WINAPI SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*);
2191 WINBASEAPI BOOL        WINAPI SetFileValidData(HANDLE,LONGLONG);
2192 WINBASEAPI UINT        WINAPI SetHandleCount(UINT);
2193 WINBASEAPI BOOL        WINAPI SetHandleInformation(HANDLE,DWORD,DWORD);
2194 WINBASEAPI BOOL        WINAPI SetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,LPVOID,DWORD);
2195 WINADVAPI  BOOL        WINAPI SetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2196 WINBASEAPI BOOL        WINAPI SetLocalTime(const SYSTEMTIME*);
2197 WINBASEAPI BOOL        WINAPI SetMailslotInfo(HANDLE,DWORD);
2198 WINBASEAPI BOOL        WINAPI SetNamedPipeHandleState(HANDLE,LPDWORD,LPDWORD,LPDWORD);
2199 WINBASEAPI BOOL        WINAPI SetPriorityClass(HANDLE,DWORD);
2200 WINADVAPI  BOOL        WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,PGENERIC_MAPPING,HANDLE);
2201 WINBASEAPI BOOL        WINAPI SetProcessAffinityMask(HANDLE,DWORD_PTR);
2202 WINBASEAPI BOOL        WINAPI SetProcessPriorityBoost(HANDLE,BOOL);
2203 WINBASEAPI BOOL        WINAPI SetProcessShutdownParameters(DWORD,DWORD);
2204 WINBASEAPI BOOL        WINAPI SetProcessWorkingSetSize(HANDLE,SIZE_T,SIZE_T);
2205 WINADVAPI  BOOL        WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
2206 WINADVAPI  BOOL        WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
2207 WINADVAPI  BOOL        WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID,BOOL);
2208 WINADVAPI  BOOL        WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID,BOOL);
2209 WINADVAPI  BOOL        WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
2210 WINBASEAPI BOOL        WINAPI SetStdHandle(DWORD,HANDLE);
2211 #define                       SetSwapAreaSize(w) (w)
2212 WINBASEAPI BOOL        WINAPI SetSystemPowerState(BOOL,BOOL);
2213 WINBASEAPI BOOL        WINAPI SetSystemTime(const SYSTEMTIME*);
2214 WINBASEAPI BOOL        WINAPI SetSystemTimeAdjustment(DWORD,BOOL);
2215 WINBASEAPI DWORD       WINAPI SetTapeParameters(HANDLE,DWORD,LPVOID);
2216 WINBASEAPI DWORD       WINAPI SetTapePosition(HANDLE,DWORD,DWORD,DWORD,DWORD,BOOL);
2217 WINBASEAPI DWORD_PTR   WINAPI SetThreadAffinityMask(HANDLE,DWORD_PTR);
2218 WINBASEAPI BOOL        WINAPI SetThreadContext(HANDLE,const CONTEXT *);
2219 WINBASEAPI BOOL        WINAPI SetThreadErrorMode(DWORD,LPDWORD);
2220 WINBASEAPI DWORD       WINAPI SetThreadExecutionState(EXECUTION_STATE);
2221 WINBASEAPI DWORD       WINAPI SetThreadIdealProcessor(HANDLE,DWORD);
2222 WINBASEAPI BOOL        WINAPI SetThreadPriority(HANDLE,INT);
2223 WINBASEAPI BOOL        WINAPI SetThreadPriorityBoost(HANDLE,BOOL);
2224 WINADVAPI  BOOL        WINAPI SetThreadToken(PHANDLE,HANDLE);
2225 WINBASEAPI HANDLE      WINAPI SetTimerQueueTimer(HANDLE,WAITORTIMERCALLBACK,PVOID,DWORD,DWORD,BOOL);
2226 WINBASEAPI BOOL        WINAPI SetTimeZoneInformation(const TIME_ZONE_INFORMATION *);
2227 WINADVAPI  BOOL        WINAPI SetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD);
2228 WINBASEAPI LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER);
2229 WINBASEAPI BOOL        WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);
2230 WINBASEAPI BOOL        WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
2231 #define                       SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
2232 WINBASEAPI BOOL        WINAPI SetVolumeMountPointA(LPCSTR,LPCSTR);
2233 WINBASEAPI BOOL        WINAPI SetVolumeMountPointW(LPCSTR,LPCSTR);
2234 #define                       SetVolumeMountPoint WINELIB_NAME_AW(SetVolumeMountPoint)
2235 WINBASEAPI BOOL        WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,BOOL);
2236 WINBASEAPI BOOL        WINAPI SetupComm(HANDLE,DWORD,DWORD);
2237 WINBASEAPI DWORD       WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL);
2238 WINBASEAPI DWORD       WINAPI SizeofResource(HMODULE,HRSRC);
2239 WINBASEAPI VOID        WINAPI Sleep(DWORD);
2240 WINBASEAPI BOOL        WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE,PCRITICAL_SECTION,DWORD);
2241 WINBASEAPI DWORD       WINAPI SleepEx(DWORD,BOOL);
2242 WINBASEAPI DWORD       WINAPI SuspendThread(HANDLE);
2243 WINBASEAPI void        WINAPI SwitchToFiber(LPVOID);
2244 WINBASEAPI BOOL        WINAPI SwitchToThread(void);
2245 WINBASEAPI BOOL        WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
2246 WINBASEAPI BOOL        WINAPI SystemTimeToTzSpecificLocalTime(const TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME);
2247 WINBASEAPI BOOL        WINAPI TerminateJobObject(HANDLE,UINT);
2248 WINBASEAPI BOOL        WINAPI TerminateProcess(HANDLE,DWORD);
2249 WINBASEAPI BOOL        WINAPI TerminateThread(HANDLE,DWORD);
2250 WINBASEAPI DWORD       WINAPI TlsAlloc(void);
2251 WINBASEAPI BOOL        WINAPI TlsFree(DWORD);
2252 WINBASEAPI LPVOID      WINAPI TlsGetValue(DWORD);
2253 WINBASEAPI BOOL        WINAPI TlsSetValue(DWORD,LPVOID);
2254 WINBASEAPI BOOL        WINAPI TransactNamedPipe(HANDLE,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
2255 WINBASEAPI BOOL        WINAPI TransmitCommChar(HANDLE,CHAR);
2256 WINBASEAPI BOOL        WINAPI TryAcquireSRWLockExclusive(PSRWLOCK);
2257 WINBASEAPI BOOL        WINAPI TryAcquireSRWLockShared(PSRWLOCK);
2258 WINBASEAPI BOOL        WINAPI TryEnterCriticalSection(CRITICAL_SECTION *lpCrit);
2259 WINBASEAPI BOOL        WINAPI TzSpecificLocalTimeToSystemTime(const TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME);
2260 WINBASEAPI LONG        WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS);
2261 WINBASEAPI BOOL        WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
2262 WINBASEAPI BOOL        WINAPI UnlockFileEx(HANDLE,DWORD,DWORD,DWORD,LPOVERLAPPED);
2263 #define                       UnlockSegment(handle) GlobalUnfix((HANDLE)(handle))
2264 WINBASEAPI BOOL        WINAPI UnmapViewOfFile(LPCVOID);
2265 WINBASEAPI BOOL        WINAPI UnregisterWait(HANDLE);
2266 WINBASEAPI BOOL        WINAPI UnregisterWaitEx(HANDLE,HANDLE);
2267 WINBASEAPI BOOL        WINAPI UpdateResourceA(HANDLE,LPCSTR,LPCSTR,WORD,LPVOID,DWORD);
2268 WINBASEAPI BOOL        WINAPI UpdateResourceW(HANDLE,LPCWSTR,LPCWSTR,WORD,LPVOID,DWORD);
2269 #define                       UpdateResource WINELIB_NAME_AW(UpdateResource)
2270 WINBASEAPI BOOL        WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA,DWORD,DWORDLONG);
2271 WINBASEAPI BOOL        WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDLONG);
2272 #define                       VerifyVersionInfo WINELIB_NAME_AW(VerifyVersionInfo)
2273 WINBASEAPI LPVOID      WINAPI VirtualAlloc(LPVOID,SIZE_T,DWORD,DWORD);
2274 WINBASEAPI LPVOID      WINAPI VirtualAllocEx(HANDLE,LPVOID,SIZE_T,DWORD,DWORD);
2275 WINBASEAPI BOOL        WINAPI VirtualFree(LPVOID,SIZE_T,DWORD);
2276 WINBASEAPI BOOL        WINAPI VirtualFreeEx(HANDLE,LPVOID,SIZE_T,DWORD);
2277 WINBASEAPI BOOL        WINAPI VirtualLock(LPVOID,SIZE_T);
2278 WINBASEAPI BOOL        WINAPI VirtualProtect(LPVOID,SIZE_T,DWORD,LPDWORD);
2279 WINBASEAPI BOOL        WINAPI VirtualProtectEx(HANDLE,LPVOID,SIZE_T,DWORD,LPDWORD);
2280 WINBASEAPI SIZE_T      WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T);
2281 WINBASEAPI SIZE_T      WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T);
2282 WINBASEAPI BOOL        WINAPI VirtualUnlock(LPVOID,SIZE_T);
2283 WINBASEAPI DWORD       WINAPI WTSGetActiveConsoleSessionId(void);
2284 WINBASEAPI BOOL        WINAPI WaitCommEvent(HANDLE,LPDWORD,LPOVERLAPPED);
2285 WINBASEAPI BOOL        WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
2286 WINBASEAPI DWORD       WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD);
2287 WINBASEAPI DWORD       WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,BOOL,DWORD,BOOL);
2288 WINBASEAPI DWORD       WINAPI WaitForSingleObject(HANDLE,DWORD);
2289 WINBASEAPI DWORD       WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL);
2290 WINBASEAPI BOOL        WINAPI WaitNamedPipeA(LPCSTR,DWORD);
2291 WINBASEAPI BOOL        WINAPI WaitNamedPipeW(LPCWSTR,DWORD);
2292 #define                       WaitNamedPipe WINELIB_NAME_AW(WaitNamedPipe)
2293 WINBASEAPI VOID        WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE);
2294 WINBASEAPI VOID        WINAPI WakeConditionVariable(PCONDITION_VARIABLE);
2295 WINBASEAPI UINT        WINAPI WinExec(LPCSTR,UINT);
2296 WINBASEAPI BOOL        WINAPI Wow64DisableWow64FsRedirection(PVOID*);
2297 WINBASEAPI BOOLEAN     WINAPI Wow64EnableWow64FsRedirection(BOOLEAN);
2298 WINBASEAPI BOOL        WINAPI Wow64RevertWow64FsRedirection(PVOID);
2299 WINBASEAPI BOOL        WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
2300 WINBASEAPI BOOL        WINAPI WriteFileEx(HANDLE,LPCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
2301 WINBASEAPI BOOL        WINAPI WriteFileGather(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED);
2302 WINBASEAPI BOOL        WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
2303 WINBASEAPI BOOL        WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);
2304 #define                       WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
2305 WINBASEAPI BOOL        WINAPI WritePrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
2306 WINBASEAPI BOOL        WINAPI WritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
2307 #define                       WritePrivateProfileString WINELIB_NAME_AW(WritePrivateProfileString)
2308 WINBASEAPI BOOL        WINAPI WritePrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
2309 WINBASEAPI BOOL        WINAPI WritePrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);
2310 #define                       WritePrivateProfileStruct WINELIB_NAME_AW(WritePrivateProfileStruct)
2311 WINBASEAPI BOOL        WINAPI WriteProcessMemory(HANDLE,LPVOID,LPCVOID,SIZE_T,SIZE_T*);
2312 WINBASEAPI BOOL        WINAPI WriteProfileSectionA(LPCSTR,LPCSTR);
2313 WINBASEAPI BOOL        WINAPI WriteProfileSectionW(LPCWSTR,LPCWSTR);
2314 #define                       WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
2315 WINBASEAPI BOOL        WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);
2316 WINBASEAPI BOOL        WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);
2317 #define                       WriteProfileString WINELIB_NAME_AW(WriteProfileString)
2318 WINBASEAPI DWORD       WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL);
2319 #define                       Yield()
2320 WINBASEAPI BOOL        WINAPI ZombifyActCtx(HANDLE);
2321
2322 WINBASEAPI INT         WINAPI lstrcmpA(LPCSTR,LPCSTR);
2323 WINBASEAPI INT         WINAPI lstrcmpW(LPCWSTR,LPCWSTR);
2324 WINBASEAPI INT         WINAPI lstrcmpiA(LPCSTR,LPCSTR);
2325 WINBASEAPI INT         WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
2326
2327 #if !defined(__WINESRC__) || defined(WINE_NO_INLINE_STRING)
2328
2329 WINBASEAPI LPSTR       WINAPI lstrcatA(LPSTR,LPCSTR);
2330 WINBASEAPI LPWSTR      WINAPI lstrcatW(LPWSTR,LPCWSTR);
2331 WINBASEAPI LPSTR       WINAPI lstrcpyA(LPSTR,LPCSTR);
2332 WINBASEAPI LPWSTR      WINAPI lstrcpyW(LPWSTR,LPCWSTR);
2333 WINBASEAPI LPSTR       WINAPI lstrcpynA(LPSTR,LPCSTR,INT);
2334 WINBASEAPI LPWSTR      WINAPI lstrcpynW(LPWSTR,LPCWSTR,INT);
2335 WINBASEAPI INT         WINAPI lstrlenA(LPCSTR);
2336 WINBASEAPI INT         WINAPI lstrlenW(LPCWSTR);
2337
2338 #else
2339
2340 /* string functions without the exception handler */
2341
2342 static inline LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
2343 {
2344     LPWSTR d = dst;
2345     LPCWSTR s = src;
2346     UINT count = n;
2347
2348     while ((count > 1) && *s)
2349     {
2350         count--;
2351         *d++ = *s++;
2352     }
2353     if (count) *d = 0;
2354     return dst;
2355 }
2356
2357 static inline LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
2358 {
2359     LPSTR d = dst;
2360     LPCSTR s = src;
2361     UINT count = n;
2362
2363     while ((count > 1) && *s)
2364     {
2365         count--;
2366         *d++ = *s++;
2367     }
2368     if (count) *d = 0;
2369     return dst;
2370 }
2371
2372 static inline INT WINAPI lstrlenW( LPCWSTR str )
2373 {
2374     const WCHAR *s = str;
2375     while (*s) s++;
2376     return s - str;
2377 }
2378
2379 static inline INT WINAPI lstrlenA( LPCSTR str )
2380 {
2381     return strlen( str );
2382 }
2383
2384 static inline LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
2385 {
2386     WCHAR *p = dst;
2387     while ((*p++ = *src++));
2388     return dst;
2389 }
2390
2391 static inline LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
2392 {
2393     return strcpy( dst, src );
2394 }
2395
2396 static inline LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
2397 {
2398     WCHAR *p = dst;
2399     while (*p) p++;
2400     while ((*p++ = *src++));
2401     return dst;
2402 }
2403
2404 static inline LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
2405 {
2406     return strcat( dst, src );
2407 }
2408
2409 /* strncpy doesn't do what you think, don't use it */
2410 #undef strncpy
2411 #define strncpy(d,s,n) error do_not_use_strncpy_use_lstrcpynA_or_memcpy_instead
2412
2413 #endif /* !defined(__WINESRC__) || defined(WINE_NO_INLINE_STRING) */
2414
2415 #define     lstrcat WINELIB_NAME_AW(lstrcat)
2416 #define     lstrcmp WINELIB_NAME_AW(lstrcmp)
2417 #define     lstrcmpi WINELIB_NAME_AW(lstrcmpi)
2418 #define     lstrcpy WINELIB_NAME_AW(lstrcpy)
2419 #define     lstrcpyn WINELIB_NAME_AW(lstrcpyn)
2420 #define     lstrlen WINELIB_NAME_AW(lstrlen)
2421
2422 WINBASEAPI LONG        WINAPI _hread(HFILE,LPVOID,LONG);
2423 WINBASEAPI LONG        WINAPI _hwrite(HFILE,LPCSTR,LONG);
2424 WINBASEAPI HFILE       WINAPI _lcreat(LPCSTR,INT);
2425 WINBASEAPI HFILE       WINAPI _lclose(HFILE);
2426 WINBASEAPI LONG        WINAPI _llseek(HFILE,LONG,INT);
2427 WINBASEAPI HFILE       WINAPI _lopen(LPCSTR,INT);
2428 WINBASEAPI UINT        WINAPI _lread(HFILE,LPVOID,UINT);
2429 WINBASEAPI UINT        WINAPI _lwrite(HFILE,LPCSTR,UINT);
2430
2431 /* compatibility macros */
2432 #define     FillMemory RtlFillMemory
2433 #define     MoveMemory RtlMoveMemory
2434 #define     ZeroMemory RtlZeroMemory
2435 #define     CopyMemory RtlCopyMemory
2436
2437 /* Wine internal functions */
2438
2439 extern char * CDECL wine_get_unix_file_name( LPCWSTR dos );
2440 extern WCHAR * CDECL wine_get_dos_file_name( LPCSTR str );
2441
2442
2443 /* Interlocked functions */
2444
2445 #ifdef __i386__
2446 # if defined(__GNUC__) && !defined(_NTSYSTEM_) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
2447
2448 static FORCEINLINE LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare )
2449 {
2450     LONG ret;
2451     __asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
2452                           : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
2453     return ret;
2454 }
2455
2456 static FORCEINLINE LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
2457 {
2458     LONG ret;
2459     __asm__ __volatile__( "lock; xchgl %0,(%1)"
2460                           : "=r" (ret) :"r" (dest), "0" (val) : "memory" );
2461     return ret;
2462 }
2463
2464 static FORCEINLINE LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr )
2465 {
2466     LONG ret;
2467     __asm__ __volatile__( "lock; xaddl %0,(%1)"
2468                           : "=r" (ret) : "r" (dest), "0" (incr) : "memory" );
2469     return ret;
2470 }
2471
2472 static FORCEINLINE LONG WINAPI InterlockedIncrement( LONG volatile *dest )
2473 {
2474     return InterlockedExchangeAdd( dest, 1 ) + 1;
2475 }
2476
2477 static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest )
2478 {
2479     return InterlockedExchangeAdd( dest, -1 ) - 1;
2480 }
2481
2482 # else  /* __GNUC__ */
2483
2484 WINBASEAPI LONG WINAPI InterlockedCompareExchange(LONG volatile*,LONG,LONG);
2485 WINBASEAPI LONG WINAPI InterlockedDecrement(LONG volatile*);
2486 WINBASEAPI LONG WINAPI InterlockedExchange(LONG volatile*,LONG);
2487 WINBASEAPI LONG WINAPI InterlockedExchangeAdd(LONG volatile*,LONG);
2488 WINBASEAPI LONG WINAPI InterlockedIncrement(LONG volatile*);
2489
2490 # endif  /* __GNUC__ */
2491
2492 static FORCEINLINE PVOID WINAPI InterlockedCompareExchangePointer( PVOID volatile *dest, PVOID xchg, PVOID compare )
2493 {
2494     return (PVOID)InterlockedCompareExchange( (LONG volatile*)dest, (LONG)xchg, (LONG)compare );
2495 }
2496
2497 static FORCEINLINE PVOID WINAPI InterlockedExchangePointer( PVOID volatile *dest, PVOID val )
2498 {
2499     return (PVOID)InterlockedExchange( (LONG volatile*)dest, (LONG)val );
2500 }
2501
2502 WINBASEAPI LONGLONG WINAPI InterlockedCompareExchange64(LONGLONG volatile*,LONGLONG,LONGLONG);
2503
2504 #else  /* __i386__ */
2505
2506 #if defined(__x86_64__) && defined(_MSC_VER)
2507 #pragma intrinsic(_InterlockedCompareExchange)
2508 #endif
2509
2510 static FORCEINLINE LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare )
2511 {
2512 #if defined(__x86_64__) && defined(__GNUC__)
2513     LONG ret;
2514     __asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
2515                           : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
2516     return ret;
2517 #elif defined(__x86_64__) && defined(_MSC_VER)
2518     return _InterlockedCompareExchange( dest, xchg, compare );
2519 #else
2520     extern int interlocked_cmpxchg( int *dest, int xchg, int compare );
2521     return interlocked_cmpxchg( (int *)dest, xchg, compare );
2522 #endif
2523 }
2524
2525 #if defined(__x86_64__) && defined(_MSC_VER)
2526 #pragma intrinsic(_InterlockedCompareExchangePointer)
2527 #endif
2528
2529 static FORCEINLINE PVOID WINAPI InterlockedCompareExchangePointer( PVOID volatile *dest, PVOID xchg, PVOID compare )
2530 {
2531 #if defined(__x86_64__) && defined(__GNUC__)
2532     PVOID ret;
2533     __asm__ __volatile__( "lock; cmpxchgq %2,(%1)"
2534                           : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
2535     return ret;
2536 #elif defined(__x86_64__) && defined(_MSC_VER)
2537     return _InterlockedCompareExchangePointer( dest, xchg, compare );
2538 #else
2539     extern void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare );
2540     return interlocked_cmpxchg_ptr( (void **)dest, xchg, compare );
2541 #endif
2542 }
2543
2544 #if defined(__x86_64__) && defined(_MSC_VER)
2545 #pragma intrinsic(_InterlockedCompareExchange64)
2546 #endif
2547
2548 static FORCEINLINE LONGLONG WINAPI InterlockedCompareExchange64( LONGLONG volatile *dest, LONGLONG xchg, LONGLONG compare )
2549 {
2550 #if defined(__x86_64__) && defined(__GNUC__)
2551     LONGLONG ret;
2552     __asm__ __volatile__( "lock; cmpxchgq %2,(%1)"
2553                           : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
2554     return ret;
2555 #elif defined(__x86_64__) && defined(_MSC_VER)
2556     return _InterlockedCompareExchange64( dest, xchg, compare );
2557 #else
2558     extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compare );
2559     return interlocked_cmpxchg64( (__int64 *)dest, xchg, compare );
2560 #endif
2561 }
2562
2563 #if defined(__x86_64__) && defined(_MSC_VER)
2564 #pragma intrinsic(_InterlockedExchange)
2565 #endif
2566
2567 static FORCEINLINE LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
2568 {
2569 #if defined(__x86_64__) && defined(__GNUC__)
2570     LONG ret;
2571     __asm__ __volatile__( "lock; xchgl %0,(%1)"
2572                           : "=r" (ret) :"r" (dest), "0" (val) : "memory" );
2573     return ret;
2574 #elif defined(__x86_64__) && defined(_MSC_VER)
2575     return _InterlockedExchange( dest, val );
2576 #else
2577     extern int interlocked_xchg( int *dest, int val );
2578     return interlocked_xchg( (int *)dest, val );
2579 #endif
2580 }
2581
2582 #if defined(__x86_64__) && defined(_MSC_VER)
2583 #pragma intrinsic(_InterlockedExchangePointer)
2584 #endif
2585
2586 static FORCEINLINE PVOID WINAPI InterlockedExchangePointer( PVOID volatile *dest, PVOID val )
2587 {
2588 #if defined(__x86_64__) && defined(__GNUC__)
2589     PVOID ret;
2590     __asm__ __volatile__( "lock; xchgq %0,(%1)"
2591                           : "=r" (ret) :"r" (dest), "0" (val) : "memory" );
2592     return ret;
2593 #elif defined(__x86_64__) && defined(_MSC_VER)
2594     return _InterlockedExchangePointer( dest, val );
2595 #else
2596     extern void *interlocked_xchg_ptr( void **dest, void *val );
2597     return interlocked_xchg_ptr( (void **)dest, val );
2598 #endif
2599 }
2600
2601 #if defined(__x86_64__) && defined(_MSC_VER)
2602 #pragma intrinsic(_InterlockedExchangeAdd)
2603 #endif
2604
2605 static FORCEINLINE LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr )
2606 {
2607 #if defined(__x86_64__) && defined(__GNUC__)
2608     LONG ret;
2609     __asm__ __volatile__( "lock; xaddl %0,(%1)"
2610                           : "=r" (ret) : "r" (dest), "0" (incr) : "memory" );
2611     return ret;
2612 #elif defined(__x86_64__) && defined(_MSC_VER)
2613     return _InterlockedExchangeAdd( dest, incr );
2614 #else
2615     extern int interlocked_xchg_add( int *dest, int incr );
2616     return interlocked_xchg_add( (int *)dest, incr );
2617 #endif
2618 }
2619
2620 #if defined(__x86_64__) && defined(_MSC_VER)
2621 #pragma intrinsic(_InterlockedIncrement)
2622 #endif
2623
2624 static FORCEINLINE LONG WINAPI InterlockedIncrement( LONG volatile *dest )
2625 {
2626 #if defined(__x86_64__) && defined(_MSC_VER)
2627     return _InterlockedIncrement( dest );
2628 #else
2629     return InterlockedExchangeAdd( dest, 1 ) + 1;
2630 #endif
2631 }
2632
2633 #if defined(__x86_64__) && defined(_MSC_VER)
2634 #pragma intrinsic(_InterlockedDecrement)
2635 #endif
2636
2637 static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest )
2638 {
2639 #if defined(__x86_64__) && defined(_MSC_VER)
2640     return _InterlockedDecrement( dest );
2641 #else
2642     return InterlockedExchangeAdd( dest, -1 ) - 1;
2643 #endif
2644 }
2645
2646 #endif  /* __i386__ */
2647
2648 /* A few optimizations for gcc */
2649
2650 #if defined(__GNUC__) && !defined(__MINGW32__) && (defined(__i386__) || defined(__x86_64__)) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
2651
2652 static FORCEINLINE DWORD WINAPI GetLastError(void)
2653 {
2654     DWORD ret;
2655 #ifdef __x86_64__
2656     __asm__ __volatile__( ".byte 0x65\n\tmovl 0x68,%0" : "=r" (ret) );
2657 #else
2658     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x34,%0" : "=r" (ret) );
2659 #endif
2660     return ret;
2661 }
2662
2663 static FORCEINLINE DWORD WINAPI GetCurrentProcessId(void)
2664 {
2665     DWORD ret;
2666 #ifdef __x86_64__
2667     __asm__ __volatile__( ".byte 0x65\n\tmovl 0x40,%0" : "=r" (ret) );
2668 #else
2669     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x20,%0" : "=r" (ret) );
2670 #endif
2671     return ret;
2672 }
2673
2674 static FORCEINLINE DWORD WINAPI GetCurrentThreadId(void)
2675 {
2676     DWORD ret;
2677 #ifdef __x86_64__
2678     __asm__ __volatile__( ".byte 0x65\n\tmovl 0x48,%0" : "=r" (ret) );
2679 #else
2680     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x24,%0" : "=r" (ret) );
2681 #endif
2682     return ret;
2683 }
2684
2685 static FORCEINLINE void WINAPI SetLastError( DWORD err )
2686 {
2687 #ifdef __x86_64__
2688     __asm__ __volatile__( ".byte 0x65\n\tmovl %0,0x68" : : "r" (err) : "memory" );
2689 #else
2690     __asm__ __volatile__( ".byte 0x64\n\tmovl %0,0x34" : : "r" (err) : "memory" );
2691 #endif
2692 }
2693
2694 static FORCEINLINE HANDLE WINAPI GetProcessHeap(void)
2695 {
2696     HANDLE *pdb;
2697 #ifdef __x86_64__
2698     __asm__ __volatile__( ".byte 0x65\n\tmovq 0x60,%0" : "=r" (pdb) );
2699     return pdb[0x30 / sizeof(HANDLE)];  /* get dword at offset 0x30 in pdb */
2700 #else
2701     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x30,%0" : "=r" (pdb) );
2702     return pdb[0x18 / sizeof(HANDLE)];  /* get dword at offset 0x18 in pdb */
2703 #endif
2704 }
2705
2706 #else  /* __GNUC__ */
2707
2708 WINBASEAPI DWORD       WINAPI GetCurrentProcessId(void);
2709 WINBASEAPI DWORD       WINAPI GetCurrentThreadId(void);
2710 WINBASEAPI DWORD       WINAPI GetLastError(void);
2711 WINBASEAPI HANDLE      WINAPI GetProcessHeap(void);
2712 WINBASEAPI VOID        WINAPI SetLastError(DWORD);
2713
2714 #endif  /* __GNUC__ */
2715
2716 #ifdef __WINESRC__
2717 #define GetCurrentProcess() ((HANDLE)~(ULONG_PTR)0)
2718 #define GetCurrentThread()  ((HANDLE)~(ULONG_PTR)1)
2719 #endif
2720
2721 /* WinMain(entry point) must be declared in winbase.h. */
2722 /* If this is not declared, we cannot compile many sources written with C++. */
2723 int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int);
2724
2725 #ifdef __WINESRC__
2726 /* shouldn't be here, but is nice for type checking */
2727 BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) DECLSPEC_HIDDEN;
2728 #endif
2729
2730 #ifdef __cplusplus
2731 }
2732 #endif
2733
2734 #endif  /* __WINE_WINBASE_H */