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