Removed some unnecessary includes.
[wine] / include / winbase.h
1 #ifndef __WINE_WINBASE_H
2 #define __WINE_WINBASE_H
3
4 #ifndef RC_INVOKED
5 #include <stdarg.h>
6 #endif
7
8 #include "basetsd.h"
9 #include "winnt.h"
10 #include "pshpack1.h"
11
12 #ifndef RC_INVOKED
13 #include <stdarg.h>
14 #endif
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20   /* Windows Exit Procedure flag values */
21 #define WEP_FREE_DLL        0
22 #define WEP_SYSTEM_EXIT     1
23
24 typedef DWORD CALLBACK (*LPTHREAD_START_ROUTINE)(LPVOID);
25
26 typedef VOID (WINAPI *PFIBER_START_ROUTINE)( LPVOID lpFiberParameter );
27 typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
28
29 typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
30 typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
31 typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
32
33 typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
34 typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
35 typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
36
37
38 #define EXCEPTION_DEBUG_EVENT       1
39 #define CREATE_THREAD_DEBUG_EVENT   2
40 #define CREATE_PROCESS_DEBUG_EVENT  3
41 #define EXIT_THREAD_DEBUG_EVENT     4
42 #define EXIT_PROCESS_DEBUG_EVENT    5
43 #define LOAD_DLL_DEBUG_EVENT        6
44 #define UNLOAD_DLL_DEBUG_EVENT      7
45 #define OUTPUT_DEBUG_STRING_EVENT   8
46 #define RIP_EVENT                   9
47
48 typedef struct _EXCEPTION_DEBUG_INFO {
49     EXCEPTION_RECORD ExceptionRecord;
50     DWORD dwFirstChance;
51 } EXCEPTION_DEBUG_INFO;
52
53 typedef struct _CREATE_THREAD_DEBUG_INFO {
54     HANDLE hThread;
55     LPVOID lpThreadLocalBase;
56     LPTHREAD_START_ROUTINE lpStartAddress;
57 } CREATE_THREAD_DEBUG_INFO;
58
59 typedef struct _CREATE_PROCESS_DEBUG_INFO {
60     HANDLE hFile;
61     HANDLE hProcess;
62     HANDLE hThread;
63     LPVOID lpBaseOfImage;
64     DWORD dwDebugInfoFileOffset;
65     DWORD nDebugInfoSize;
66     LPVOID lpThreadLocalBase;
67     LPTHREAD_START_ROUTINE lpStartAddress;
68     LPVOID lpImageName;
69     WORD fUnicode;
70 } CREATE_PROCESS_DEBUG_INFO;
71
72 typedef struct _EXIT_THREAD_DEBUG_INFO {
73     DWORD dwExitCode;
74 } EXIT_THREAD_DEBUG_INFO;
75
76 typedef struct _EXIT_PROCESS_DEBUG_INFO {
77     DWORD dwExitCode;
78 } EXIT_PROCESS_DEBUG_INFO;
79
80 typedef struct _LOAD_DLL_DEBUG_INFO {
81     HANDLE hFile;
82     LPVOID   lpBaseOfDll;
83     DWORD    dwDebugInfoFileOffset;
84     DWORD    nDebugInfoSize;
85     LPVOID   lpImageName;
86     WORD     fUnicode;
87 } LOAD_DLL_DEBUG_INFO;
88
89 typedef struct _UNLOAD_DLL_DEBUG_INFO {
90     LPVOID lpBaseOfDll;
91 } UNLOAD_DLL_DEBUG_INFO;
92
93 typedef struct _OUTPUT_DEBUG_STRING_INFO {
94     LPSTR lpDebugStringData;
95     WORD  fUnicode;
96     WORD  nDebugStringLength;
97 } OUTPUT_DEBUG_STRING_INFO;
98
99 typedef struct _RIP_INFO {
100     DWORD dwError;
101     DWORD dwType;
102 } RIP_INFO;
103
104 typedef struct _DEBUG_EVENT {
105     DWORD dwDebugEventCode;
106     DWORD dwProcessId;
107     DWORD dwThreadId;
108     union {
109         EXCEPTION_DEBUG_INFO      Exception;
110         CREATE_THREAD_DEBUG_INFO  CreateThread;
111         CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
112         EXIT_THREAD_DEBUG_INFO    ExitThread;
113         EXIT_PROCESS_DEBUG_INFO   ExitProcess;
114         LOAD_DLL_DEBUG_INFO       LoadDll;
115         UNLOAD_DLL_DEBUG_INFO     UnloadDll;
116         OUTPUT_DEBUG_STRING_INFO  DebugString;
117         RIP_INFO                  RipInfo;
118     } u;
119 } DEBUG_EVENT, *LPDEBUG_EVENT;
120
121 typedef PCONTEXT LPCONTEXT;
122 typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
123 typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
124
125 #define OFS_MAXPATHNAME 128
126 typedef struct
127 {
128     BYTE cBytes;
129     BYTE fFixedDisk;
130     WORD nErrCode;
131     BYTE reserved[4];
132     BYTE szPathName[OFS_MAXPATHNAME];
133 } OFSTRUCT, *LPOFSTRUCT;
134
135 #define OF_READ               0x0000
136 #define OF_WRITE              0x0001
137 #define OF_READWRITE          0x0002
138 #define OF_SHARE_COMPAT       0x0000
139 #define OF_SHARE_EXCLUSIVE    0x0010
140 #define OF_SHARE_DENY_WRITE   0x0020
141 #define OF_SHARE_DENY_READ    0x0030
142 #define OF_SHARE_DENY_NONE    0x0040
143 #define OF_PARSE              0x0100
144 #define OF_DELETE             0x0200
145 #define OF_VERIFY             0x0400   /* Used with OF_REOPEN */
146 #define OF_SEARCH             0x0400   /* Used without OF_REOPEN */
147 #define OF_CANCEL             0x0800
148 #define OF_CREATE             0x1000
149 #define OF_PROMPT             0x2000
150 #define OF_EXIST              0x4000
151 #define OF_REOPEN             0x8000
152
153 /* SetErrorMode values */
154 #define SEM_FAILCRITICALERRORS      0x0001
155 #define SEM_NOGPFAULTERRORBOX       0x0002
156 #define SEM_NOALIGNMENTFAULTEXCEPT  0x0004
157 #define SEM_NOOPENFILEERRORBOX      0x8000
158
159 /* CopyFileEx flags */
160 #define COPY_FILE_FAIL_IF_EXISTS        0x00000001
161 #define COPY_FILE_RESTARTABLE           0x00000002
162 #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
163
164 /* GetTempFileName() Flags */
165 #define TF_FORCEDRIVE           0x80
166
167 #define DRIVE_UNKNOWN              0
168 #define DRIVE_NO_ROOT_DIR          1
169 #define DRIVE_REMOVABLE            2
170 #define DRIVE_FIXED                3
171 #define DRIVE_REMOTE               4
172 /* Win32 additions */
173 #define DRIVE_CDROM                5
174 #define DRIVE_RAMDISK              6
175
176 /* The security attributes structure */
177 typedef struct _SECURITY_ATTRIBUTES
178 {
179     DWORD   nLength;
180     LPVOID  lpSecurityDescriptor;
181     BOOL  bInheritHandle;
182 } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
183
184 #ifndef _FILETIME_
185 #define _FILETIME_
186 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
187 typedef struct
188 {
189   DWORD  dwLowDateTime;
190   DWORD  dwHighDateTime;
191 } FILETIME, *LPFILETIME;
192 #endif /* _FILETIME_ */
193
194 /* Find* structures */
195 typedef struct
196 {
197     DWORD     dwFileAttributes;
198     FILETIME  ftCreationTime;
199     FILETIME  ftLastAccessTime;
200     FILETIME  ftLastWriteTime;
201     DWORD     nFileSizeHigh;
202     DWORD     nFileSizeLow;
203     DWORD     dwReserved0;
204     DWORD     dwReserved1;
205     CHAR      cFileName[260];
206     CHAR      cAlternateFileName[14];
207 } WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
208
209 typedef struct
210 {
211     DWORD     dwFileAttributes;
212     FILETIME  ftCreationTime;
213     FILETIME  ftLastAccessTime;
214     FILETIME  ftLastWriteTime;
215     DWORD     nFileSizeHigh;
216     DWORD     nFileSizeLow;
217     DWORD     dwReserved0;
218     DWORD     dwReserved1;
219     WCHAR     cFileName[260];
220     WCHAR     cAlternateFileName[14];
221 } WIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
222
223 DECL_WINELIB_TYPE_AW(WIN32_FIND_DATA)
224 DECL_WINELIB_TYPE_AW(LPWIN32_FIND_DATA)
225
226 typedef enum _FINDEX_INFO_LEVELS
227 {
228         FindExInfoStandard,
229         FindExInfoMaxInfoLevel
230 } FINDEX_INFO_LEVELS;
231
232 typedef enum _FINDEX_SEARCH_OPS
233 {
234         FindExSearchNameMatch,
235         FindExSearchLimitToDirectories,
236         FindExSearchLimitToDevices,
237         FindExSearchMaxSearchOp
238 } FINDEX_SEARCH_OPS;
239
240 typedef struct
241 {
242     LPVOID lpData;
243     DWORD cbData;
244     BYTE cbOverhead;
245     BYTE iRegionIndex;
246     WORD wFlags;
247     union {
248         struct {
249             HANDLE hMem;
250             DWORD dwReserved[3];
251         } Block;
252         struct {
253             DWORD dwCommittedSize;
254             DWORD dwUnCommittedSize;
255             LPVOID lpFirstBlock;
256             LPVOID lpLastBlock;
257         } Region;
258     } DUMMYUNIONNAME;
259 } PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
260
261 #define PROCESS_HEAP_REGION                   0x0001
262 #define PROCESS_HEAP_UNCOMMITTED_RANGE        0x0002
263 #define PROCESS_HEAP_ENTRY_BUSY               0x0004
264 #define PROCESS_HEAP_ENTRY_MOVEABLE           0x0010
265 #define PROCESS_HEAP_ENTRY_DDESHARE           0x0020
266
267 #define INVALID_HANDLE_VALUE  ((HANDLE) -1)
268
269 #define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
270
271 #define SHUTDOWN_NORETRY 1
272
273 /* comm */
274
275 #define CBR_110 0xFF10
276 #define CBR_300 0xFF11
277 #define CBR_600 0xFF12
278 #define CBR_1200        0xFF13
279 #define CBR_2400        0xFF14
280 #define CBR_4800        0xFF15
281 #define CBR_9600        0xFF16
282 #define CBR_14400       0xFF17
283 #define CBR_19200       0xFF18
284 #define CBR_38400       0xFF1B
285 #define CBR_56000       0xFF1F
286 #define CBR_57600       0xFF20
287 #define CBR_115200      0xFF21
288 #define CBR_128000      0xFF23
289 #define CBR_256000      0xFF27
290
291 #define NOPARITY        0
292 #define ODDPARITY       1
293 #define EVENPARITY      2
294 #define MARKPARITY      3
295 #define SPACEPARITY     4
296 #define ONESTOPBIT      0
297 #define ONE5STOPBITS    1
298 #define TWOSTOPBITS     2
299
300 #define IGNORE          0
301 #define INFINITE      0xFFFFFFFF
302
303 #define CE_RXOVER       0x0001
304 #define CE_OVERRUN      0x0002
305 #define CE_RXPARITY     0x0004
306 #define CE_FRAME        0x0008
307 #define CE_BREAK        0x0010
308 #define CE_CTSTO        0x0020
309 #define CE_DSRTO        0x0040
310 #define CE_RLSDTO       0x0080
311 #define CE_TXFULL       0x0100
312 #define CE_PTO          0x0200
313 #define CE_IOE          0x0400
314 #define CE_DNS          0x0800
315 #define CE_OOP          0x1000
316 #define CE_MODE 0x8000
317
318 #define IE_BADID        -1
319 #define IE_OPEN -2
320 #define IE_NOPEN        -3
321 #define IE_MEMORY       -4
322 #define IE_DEFAULT      -5
323 #define IE_HARDWARE     -10
324 #define IE_BYTESIZE     -11
325 #define IE_BAUDRATE     -12
326
327 #define EV_RXCHAR       0x0001
328 #define EV_RXFLAG       0x0002
329 #define EV_TXEMPTY      0x0004
330 #define EV_CTS          0x0008
331 #define EV_DSR          0x0010
332 #define EV_RLSD 0x0020
333 #define EV_BREAK        0x0040
334 #define EV_ERR          0x0080
335 #define EV_RING 0x0100
336 #define EV_PERR 0x0200
337 #define EV_CTSS 0x0400
338 #define EV_DSRS 0x0800
339 #define EV_RLSDS        0x1000
340 #define EV_RINGTE       0x2000
341 #define EV_RingTe       EV_RINGTE
342
343 #define SETXOFF 1
344 #define SETXON          2
345 #define SETRTS          3
346 #define CLRRTS          4
347 #define SETDTR          5
348 #define CLRDTR          6
349 #define RESETDEV        7
350 #define SETBREAK        8
351 #define CLRBREAK        9
352
353 #define GETBASEIRQ      10
354
355 /* Purge functions for Comm Port */
356 #define PURGE_TXABORT       0x0001  /* Kill the pending/current writes to the 
357                                        comm port */
358 #define PURGE_RXABORT       0x0002  /*Kill the pending/current reads to 
359                                      the comm port */
360 #define PURGE_TXCLEAR       0x0004  /* Kill the transmit queue if there*/
361 #define PURGE_RXCLEAR       0x0008  /* Kill the typeahead buffer if there*/
362
363
364 /* Modem Status Flags */
365 #define MS_CTS_ON           ((DWORD)0x0010)
366 #define MS_DSR_ON           ((DWORD)0x0020)
367 #define MS_RING_ON          ((DWORD)0x0040)
368 #define MS_RLSD_ON          ((DWORD)0x0080)
369
370 #define RTS_CONTROL_DISABLE     0
371 #define RTS_CONTROL_ENABLE      1
372 #define RTS_CONTROL_HANDSHAKE   2
373 #define RTS_CONTROL_TOGGLE      3
374
375 #define DTR_CONTROL_DISABLE     0
376 #define DTR_CONTROL_ENABLE      1
377 #define DTR_CONTROL_HANDSHAKE   2
378
379 #define CSTF_CTSHOLD    0x01
380 #define CSTF_DSRHOLD    0x02
381 #define CSTF_RLSDHOLD   0x04
382 #define CSTF_XOFFHOLD   0x08
383 #define CSTF_XOFFSENT   0x10
384 #define CSTF_EOF        0x20
385 #define CSTF_TXIM       0x40
386
387 #define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i)))
388 #define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
389 #define MAKEINTRESOURCE WINELIB_NAME_AW(MAKEINTRESOURCE)
390
391 /* Predefined resource types */
392 #define RT_CURSORA         MAKEINTRESOURCEA(1)
393 #define RT_CURSORW         MAKEINTRESOURCEW(1)
394 #define RT_CURSOR            WINELIB_NAME_AW(RT_CURSOR)
395 #define RT_BITMAPA         MAKEINTRESOURCEA(2)
396 #define RT_BITMAPW         MAKEINTRESOURCEW(2)
397 #define RT_BITMAP            WINELIB_NAME_AW(RT_BITMAP)
398 #define RT_ICONA           MAKEINTRESOURCEA(3)
399 #define RT_ICONW           MAKEINTRESOURCEW(3)
400 #define RT_ICON              WINELIB_NAME_AW(RT_ICON)
401 #define RT_MENUA           MAKEINTRESOURCEA(4)
402 #define RT_MENUW           MAKEINTRESOURCEW(4)
403 #define RT_MENU              WINELIB_NAME_AW(RT_MENU)
404 #define RT_DIALOGA         MAKEINTRESOURCEA(5)
405 #define RT_DIALOGW         MAKEINTRESOURCEW(5)
406 #define RT_DIALOG            WINELIB_NAME_AW(RT_DIALOG)
407 #define RT_STRINGA         MAKEINTRESOURCEA(6)
408 #define RT_STRINGW         MAKEINTRESOURCEW(6)
409 #define RT_STRING            WINELIB_NAME_AW(RT_STRING)
410 #define RT_FONTDIRA        MAKEINTRESOURCEA(7)
411 #define RT_FONTDIRW        MAKEINTRESOURCEW(7)
412 #define RT_FONTDIR           WINELIB_NAME_AW(RT_FONTDIR)
413 #define RT_FONTA           MAKEINTRESOURCEA(8)
414 #define RT_FONTW           MAKEINTRESOURCEW(8)
415 #define RT_FONT              WINELIB_NAME_AW(RT_FONT)
416 #define RT_ACCELERATORA    MAKEINTRESOURCEA(9)
417 #define RT_ACCELERATORW    MAKEINTRESOURCEW(9)
418 #define RT_ACCELERATOR       WINELIB_NAME_AW(RT_ACCELERATOR)
419 #define RT_RCDATAA         MAKEINTRESOURCEA(10)
420 #define RT_RCDATAW         MAKEINTRESOURCEW(10)
421 #define RT_RCDATA            WINELIB_NAME_AW(RT_RCDATA)
422 #define RT_MESSAGELISTA    MAKEINTRESOURCEA(11)
423 #define RT_MESSAGELISTW    MAKEINTRESOURCEW(11)
424 #define RT_MESSAGELIST       WINELIB_NAME_AW(RT_MESSAGELIST)
425 #define RT_GROUP_CURSORA   MAKEINTRESOURCEA(12)
426 #define RT_GROUP_CURSORW   MAKEINTRESOURCEW(12)
427 #define RT_GROUP_CURSOR      WINELIB_NAME_AW(RT_GROUP_CURSOR)
428 #define RT_GROUP_ICONA     MAKEINTRESOURCEA(14)
429 #define RT_GROUP_ICONW     MAKEINTRESOURCEW(14)
430 #define RT_GROUP_ICON        WINELIB_NAME_AW(RT_GROUP_ICON)
431
432
433 #define LMEM_FIXED          0   
434 #define LMEM_MOVEABLE       0x0002
435 #define LMEM_NOCOMPACT      0x0010
436 #define LMEM_NODISCARD      0x0020
437 #define LMEM_ZEROINIT       0x0040
438 #define LMEM_MODIFY         0x0080
439 #define LMEM_DISCARDABLE    0x0F00
440 #define LMEM_DISCARDED      0x4000
441 #define LMEM_LOCKCOUNT      0x00FF
442
443 #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
444 #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
445
446 #define NONZEROLHND         (LMEM_MOVEABLE)
447 #define NONZEROLPTR         (LMEM_FIXED)
448
449 #define GMEM_FIXED          0x0000
450 #define GMEM_MOVEABLE       0x0002
451 #define GMEM_NOCOMPACT      0x0010
452 #define GMEM_NODISCARD      0x0020
453 #define GMEM_ZEROINIT       0x0040
454 #define GMEM_MODIFY         0x0080
455 #define GMEM_DISCARDABLE    0x0100
456 #define GMEM_NOT_BANKED     0x1000
457 #define GMEM_SHARE          0x2000
458 #define GMEM_DDESHARE       0x2000
459 #define GMEM_NOTIFY         0x4000
460 #define GMEM_LOWER          GMEM_NOT_BANKED
461 #define GMEM_DISCARDED      0x4000
462 #define GMEM_LOCKCOUNT      0x00ff
463 #define GMEM_INVALID_HANDLE 0x8000
464
465 #define GHND                (GMEM_MOVEABLE | GMEM_ZEROINIT)
466 #define GPTR                (GMEM_FIXED | GMEM_ZEROINIT)
467
468
469 typedef struct tagMEMORYSTATUS
470 {
471     DWORD    dwLength;
472     DWORD    dwMemoryLoad;
473     DWORD    dwTotalPhys;
474     DWORD    dwAvailPhys;
475     DWORD    dwTotalPageFile;
476     DWORD    dwAvailPageFile;
477     DWORD    dwTotalVirtual;
478     DWORD    dwAvailVirtual;
479 } MEMORYSTATUS, *LPMEMORYSTATUS;
480
481
482 #ifndef NOLOGERROR
483
484 /* LogParamError and LogError values */
485
486 /* Error modifier bits */
487 #define ERR_WARNING             0x8000
488 #define ERR_PARAM               0x4000
489
490 #define ERR_SIZE_MASK           0x3000
491 #define ERR_BYTE                0x1000
492 #define ERR_WORD                0x2000
493 #define ERR_DWORD               0x3000
494
495 /* LogParamError() values */
496
497 /* Generic parameter values */
498 #define ERR_BAD_VALUE           0x6001
499 #define ERR_BAD_FLAGS           0x6002
500 #define ERR_BAD_INDEX           0x6003
501 #define ERR_BAD_DVALUE          0x7004
502 #define ERR_BAD_DFLAGS          0x7005
503 #define ERR_BAD_DINDEX          0x7006
504 #define ERR_BAD_PTR             0x7007
505 #define ERR_BAD_FUNC_PTR        0x7008
506 #define ERR_BAD_SELECTOR        0x6009
507 #define ERR_BAD_STRING_PTR      0x700a
508 #define ERR_BAD_HANDLE          0x600b
509
510 /* KERNEL parameter errors */
511 #define ERR_BAD_HINSTANCE       0x6020
512 #define ERR_BAD_HMODULE         0x6021
513 #define ERR_BAD_GLOBAL_HANDLE   0x6022
514 #define ERR_BAD_LOCAL_HANDLE    0x6023
515 #define ERR_BAD_ATOM            0x6024
516 #define ERR_BAD_HFILE           0x6025
517
518 /* USER parameter errors */
519 #define ERR_BAD_HWND            0x6040
520 #define ERR_BAD_HMENU           0x6041
521 #define ERR_BAD_HCURSOR         0x6042
522 #define ERR_BAD_HICON           0x6043
523 #define ERR_BAD_HDWP            0x6044
524 #define ERR_BAD_CID             0x6045
525 #define ERR_BAD_HDRVR           0x6046
526
527 /* GDI parameter errors */
528 #define ERR_BAD_COORDS          0x7060
529 #define ERR_BAD_GDI_OBJECT      0x6061
530 #define ERR_BAD_HDC             0x6062
531 #define ERR_BAD_HPEN            0x6063
532 #define ERR_BAD_HFONT           0x6064
533 #define ERR_BAD_HBRUSH          0x6065
534 #define ERR_BAD_HBITMAP         0x6066
535 #define ERR_BAD_HRGN            0x6067
536 #define ERR_BAD_HPALETTE        0x6068
537 #define ERR_BAD_HMETAFILE       0x6069
538
539
540 /* LogError() values */
541
542 /* KERNEL errors */
543 #define ERR_GALLOC              0x0001
544 #define ERR_GREALLOC            0x0002
545 #define ERR_GLOCK               0x0003
546 #define ERR_LALLOC              0x0004
547 #define ERR_LREALLOC            0x0005
548 #define ERR_LLOCK               0x0006
549 #define ERR_ALLOCRES            0x0007
550 #define ERR_LOCKRES             0x0008
551 #define ERR_LOADMODULE          0x0009
552
553 /* USER errors */
554 #define ERR_CREATEDLG           0x0040
555 #define ERR_CREATEDLG2          0x0041
556 #define ERR_REGISTERCLASS       0x0042
557 #define ERR_DCBUSY              0x0043
558 #define ERR_CREATEWND           0x0044
559 #define ERR_STRUCEXTRA          0x0045
560 #define ERR_LOADSTR             0x0046
561 #define ERR_LOADMENU            0x0047
562 #define ERR_NESTEDBEGINPAINT    0x0048
563 #define ERR_BADINDEX            0x0049
564 #define ERR_CREATEMENU          0x004a
565
566 /* GDI errors */
567 #define ERR_CREATEDC            0x0080
568 #define ERR_CREATEMETA          0x0081
569 #define ERR_DELOBJSELECTED      0x0082
570 #define ERR_SELBITMAP           0x0083
571
572
573
574 /* Debugging support (DEBUG SYSTEM ONLY) */
575 typedef struct
576 {
577     WORD    flags;
578     DWORD   dwOptions WINE_PACKED;
579     DWORD   dwFilter WINE_PACKED;
580     CHAR    achAllocModule[8] WINE_PACKED;
581     DWORD   dwAllocBreak WINE_PACKED;
582     DWORD   dwAllocCount WINE_PACKED;
583 } WINDEBUGINFO, *LPWINDEBUGINFO;
584
585 /* WINDEBUGINFO flags values */
586 #define WDI_OPTIONS         0x0001
587 #define WDI_FILTER          0x0002
588 #define WDI_ALLOCBREAK      0x0004
589
590 /* dwOptions values */
591 #define DBO_CHECKHEAP       0x0001
592 #define DBO_BUFFERFILL      0x0004
593 #define DBO_DISABLEGPTRAPPING 0x0010
594 #define DBO_CHECKFREE       0x0020
595
596 #define DBO_SILENT          0x8000
597
598 #define DBO_TRACEBREAK      0x2000
599 #define DBO_WARNINGBREAK    0x1000
600 #define DBO_NOERRORBREAK    0x0800
601 #define DBO_NOFATALBREAK    0x0400
602 #define DBO_INT3BREAK       0x0100
603
604 /* DebugOutput flags values */
605 #define DBF_TRACE           0x0000
606 #define DBF_WARNING         0x4000
607 #define DBF_ERROR           0x8000
608 #define DBF_FATAL           0xc000
609
610 /* dwFilter values */
611 #define DBF_KERNEL          0x1000
612 #define DBF_KRN_MEMMAN      0x0001
613 #define DBF_KRN_LOADMODULE  0x0002
614 #define DBF_KRN_SEGMENTLOAD 0x0004
615 #define DBF_USER            0x0800
616 #define DBF_GDI             0x0400
617 #define DBF_MMSYSTEM        0x0040
618 #define DBF_PENWIN          0x0020
619 #define DBF_APPLICATION     0x0008
620 #define DBF_DRIVER          0x0010
621
622 #endif /* NOLOGERROR */
623
624 typedef struct {
625         WORD wYear;
626         WORD wMonth;
627         WORD wDayOfWeek;
628         WORD wDay;
629         WORD wHour;
630         WORD wMinute;
631         WORD wSecond;
632         WORD wMilliseconds;
633 } SYSTEMTIME, *LPSYSTEMTIME;
634
635 /* The 'overlapped' data structure used by async I/O functions.
636  */
637 typedef struct {
638         DWORD Internal;
639         DWORD InternalHigh;
640         DWORD Offset;
641         DWORD OffsetHigh;
642         HANDLE hEvent;
643 } OVERLAPPED, *LPOVERLAPPED;
644
645 typedef VOID CALLBACK (*LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped);
646
647 /* Process startup information.
648  */
649
650 /* STARTUPINFO.dwFlags */
651 #define STARTF_USESHOWWINDOW    0x00000001
652 #define STARTF_USESIZE          0x00000002
653 #define STARTF_USEPOSITION      0x00000004
654 #define STARTF_USECOUNTCHARS    0x00000008
655 #define STARTF_USEFILLATTRIBUTE 0x00000010
656 #define STARTF_RUNFULLSCREEN    0x00000020
657 #define STARTF_FORCEONFEEDBACK  0x00000040
658 #define STARTF_FORCEOFFFEEDBACK 0x00000080
659 #define STARTF_USESTDHANDLES    0x00000100
660 #define STARTF_USEHOTKEY        0x00000200
661
662 typedef struct {
663         DWORD cb;               /* 00: size of struct */
664         LPSTR lpReserved;       /* 04: */
665         LPSTR lpDesktop;        /* 08: */
666         LPSTR lpTitle;          /* 0c: */
667         DWORD dwX;              /* 10: */
668         DWORD dwY;              /* 14: */
669         DWORD dwXSize;          /* 18: */
670         DWORD dwYSize;          /* 1c: */
671         DWORD dwXCountChars;    /* 20: */
672         DWORD dwYCountChars;    /* 24: */
673         DWORD dwFillAttribute;  /* 28: */
674         DWORD dwFlags;          /* 2c: */
675         WORD wShowWindow;       /* 30: */
676         WORD cbReserved2;       /* 32: */
677         BYTE *lpReserved2;      /* 34: */
678         HANDLE hStdInput;       /* 38: */
679         HANDLE hStdOutput;      /* 3c: */
680         HANDLE hStdError;       /* 40: */
681 } STARTUPINFOA, *LPSTARTUPINFOA;
682
683 typedef struct {
684         DWORD cb;
685         LPWSTR lpReserved;
686         LPWSTR lpDesktop;
687         LPWSTR lpTitle;
688         DWORD dwX;
689         DWORD dwY;
690         DWORD dwXSize;
691         DWORD dwYSize;
692         DWORD dwXCountChars;
693         DWORD dwYCountChars;
694         DWORD dwFillAttribute;
695         DWORD dwFlags;
696         WORD wShowWindow;
697         WORD cbReserved2;
698         BYTE *lpReserved2;
699         HANDLE hStdInput;
700         HANDLE hStdOutput;
701         HANDLE hStdError;
702 } STARTUPINFOW, *LPSTARTUPINFOW;
703
704 DECL_WINELIB_TYPE_AW(STARTUPINFO)
705 DECL_WINELIB_TYPE_AW(LPSTARTUPINFO)
706
707 typedef struct {
708         HANDLE  hProcess;
709         HANDLE  hThread;
710         DWORD           dwProcessId;
711         DWORD           dwThreadId;
712 } PROCESS_INFORMATION,*LPPROCESS_INFORMATION;
713
714 typedef struct {
715         LONG Bias;
716         WCHAR StandardName[32];
717         SYSTEMTIME StandardDate;
718         LONG StandardBias;
719         WCHAR DaylightName[32];
720         SYSTEMTIME DaylightDate;
721         LONG DaylightBias;
722 } TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
723
724 #define TIME_ZONE_ID_INVALID    ((DWORD)0xFFFFFFFF)
725 #define TIME_ZONE_ID_UNKNOWN    0
726 #define TIME_ZONE_ID_STANDARD   1
727 #define TIME_ZONE_ID_DAYLIGHT   2
728
729 /* CreateProcess: dwCreationFlag values
730  */
731 #define DEBUG_PROCESS               0x00000001
732 #define DEBUG_ONLY_THIS_PROCESS     0x00000002
733 #define CREATE_SUSPENDED            0x00000004
734 #define DETACHED_PROCESS            0x00000008
735 #define CREATE_NEW_CONSOLE          0x00000010
736 #define NORMAL_PRIORITY_CLASS       0x00000020
737 #define IDLE_PRIORITY_CLASS         0x00000040
738 #define HIGH_PRIORITY_CLASS         0x00000080
739 #define REALTIME_PRIORITY_CLASS     0x00000100
740 #define CREATE_NEW_PROCESS_GROUP    0x00000200
741 #define CREATE_UNICODE_ENVIRONMENT  0x00000400
742 #define CREATE_SEPARATE_WOW_VDM     0x00000800
743 #define CREATE_SHARED_WOW_VDM       0x00001000
744 #define CREATE_DEFAULT_ERROR_MODE   0x04000000
745 #define CREATE_NO_WINDOW            0x08000000
746 #define PROFILE_USER                0x10000000
747 #define PROFILE_KERNEL              0x20000000
748 #define PROFILE_SERVER              0x40000000
749
750
751 /* File object type definitions
752  */
753 #define FILE_TYPE_UNKNOWN       0
754 #define FILE_TYPE_DISK          1
755 #define FILE_TYPE_CHAR          2
756 #define FILE_TYPE_PIPE          3
757 #define FILE_TYPE_REMOTE        32768
758
759 /* File creation flags
760  */
761 #define FILE_FLAG_WRITE_THROUGH    0x80000000UL
762 #define FILE_FLAG_OVERLAPPED       0x40000000L
763 #define FILE_FLAG_NO_BUFFERING     0x20000000L
764 #define FILE_FLAG_RANDOM_ACCESS    0x10000000L
765 #define FILE_FLAG_SEQUENTIAL_SCAN  0x08000000L
766 #define FILE_FLAG_DELETE_ON_CLOSE  0x04000000L
767 #define FILE_FLAG_BACKUP_SEMANTICS 0x02000000L
768 #define FILE_FLAG_POSIX_SEMANTICS  0x01000000L
769 #define CREATE_NEW              1
770 #define CREATE_ALWAYS           2
771 #define OPEN_EXISTING           3
772 #define OPEN_ALWAYS             4
773 #define TRUNCATE_EXISTING       5
774
775 /* Standard handle identifiers
776  */
777 #define STD_INPUT_HANDLE        ((DWORD) -10)
778 #define STD_OUTPUT_HANDLE       ((DWORD) -11)
779 #define STD_ERROR_HANDLE        ((DWORD) -12)
780
781 typedef struct
782 {
783   int dwFileAttributes;
784   FILETIME ftCreationTime;
785   FILETIME ftLastAccessTime;
786   FILETIME ftLastWriteTime;
787   int dwVolumeSerialNumber;
788   int nFileSizeHigh;
789   int nFileSizeLow;
790   int nNumberOfLinks;
791   int nFileIndexHigh;
792   int nFileIndexLow;
793 } BY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION ;
794
795
796 typedef struct _SYSTEM_POWER_STATUS
797 {
798   BYTE    ACLineStatus;
799   BYTE    BatteryFlag;
800   BYTE    BatteryLifePercent;
801   BYTE    reserved;
802   DWORD   BatteryLifeTime;
803   DWORD   BatteryFullLifeTime;
804 } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
805
806
807 typedef BOOL CALLBACK (*CODEPAGE_ENUMPROCA)(LPSTR);
808 typedef BOOL CALLBACK (*CODEPAGE_ENUMPROCW)(LPWSTR);
809 DECL_WINELIB_TYPE_AW(CODEPAGE_ENUMPROC)
810 typedef BOOL CALLBACK (*LOCALE_ENUMPROCA)(LPSTR);
811 typedef BOOL CALLBACK (*LOCALE_ENUMPROCW)(LPWSTR);
812 DECL_WINELIB_TYPE_AW(LOCALE_ENUMPROC)
813
814 typedef struct tagSYSTEM_INFO
815 {
816     union {
817         DWORD   dwOemId; /* Obsolete field - do not use */
818         struct {
819                 WORD wProcessorArchitecture;
820                 WORD wReserved;
821         } DUMMYSTRUCTNAME;
822     } DUMMYUNIONNAME;
823     DWORD       dwPageSize;
824     LPVOID      lpMinimumApplicationAddress;
825     LPVOID      lpMaximumApplicationAddress;
826     DWORD       dwActiveProcessorMask;
827     DWORD       dwNumberOfProcessors;
828     DWORD       dwProcessorType;
829     DWORD       dwAllocationGranularity;
830     WORD        wProcessorLevel;
831     WORD        wProcessorRevision;
832 } SYSTEM_INFO, *LPSYSTEM_INFO;
833
834 typedef BOOL CALLBACK (*ENUMRESTYPEPROCA)(HMODULE,LPSTR,LONG);
835 typedef BOOL CALLBACK (*ENUMRESTYPEPROCW)(HMODULE,LPWSTR,LONG);
836 typedef BOOL CALLBACK (*ENUMRESNAMEPROCA)(HMODULE,LPCSTR,LPSTR,LONG);
837 typedef BOOL CALLBACK (*ENUMRESNAMEPROCW)(HMODULE,LPCWSTR,LPWSTR,LONG);
838 typedef BOOL CALLBACK (*ENUMRESLANGPROCA)(HMODULE,LPCSTR,LPCSTR,WORD,LONG);
839 typedef BOOL CALLBACK (*ENUMRESLANGPROCW)(HMODULE,LPCWSTR,LPCWSTR,WORD,LONG);
840
841 DECL_WINELIB_TYPE_AW(ENUMRESTYPEPROC)
842 DECL_WINELIB_TYPE_AW(ENUMRESNAMEPROC)
843 DECL_WINELIB_TYPE_AW(ENUMRESLANGPROC)
844
845 /* flags that can be passed to LoadLibraryEx */
846 #define DONT_RESOLVE_DLL_REFERENCES     0x00000001
847 #define LOAD_LIBRARY_AS_DATAFILE        0x00000002
848 #define LOAD_WITH_ALTERED_SEARCH_PATH   0x00000008
849
850 /* ifdef _x86_ ... */
851 typedef struct _LDT_ENTRY {
852     WORD        LimitLow;
853     WORD        BaseLow;
854     union {
855         struct {
856             BYTE        BaseMid;
857             BYTE        Flags1;/*Declare as bytes to avoid alignment problems */
858             BYTE        Flags2; 
859             BYTE        BaseHi;
860         } Bytes;
861         struct {            
862             unsigned    BaseMid         : 8;
863             unsigned    Type            : 5;
864             unsigned    Dpl             : 2;
865             unsigned    Pres            : 1;
866             unsigned    LimitHi         : 4;
867             unsigned    Sys             : 1;
868             unsigned    Reserved_0      : 1;
869             unsigned    Default_Big     : 1;
870             unsigned    Granularity     : 1;
871             unsigned    BaseHi          : 8;
872         } Bits;
873     } HighWord;
874 } LDT_ENTRY, *LPLDT_ENTRY;
875
876
877 typedef enum _GET_FILEEX_INFO_LEVELS {
878     GetFileExInfoStandard
879 } GET_FILEEX_INFO_LEVELS;
880
881 typedef struct _WIN32_FILE_ATTRIBUTES_DATA {
882     DWORD    dwFileAttributes;
883     FILETIME ftCreationTime;
884     FILETIME ftLastAccessTime;
885     FILETIME ftLastWriteTime;
886     DWORD    nFileSizeHigh;
887     DWORD    nFileSizeLow;
888 } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
889
890 /*
891  * This one seems to be a Win32 only definition. It also is defined with
892  * WINAPI instead of CALLBACK in the windows headers.
893  */
894 typedef DWORD CALLBACK (*LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, 
895                                            LARGE_INTEGER, DWORD, DWORD, HANDLE,
896                                            HANDLE, LPVOID);
897
898
899 #define WAIT_FAILED             0xffffffff
900 #define WAIT_OBJECT_0           0
901 #define WAIT_ABANDONED          STATUS_ABANDONED_WAIT_0
902 #define WAIT_ABANDONED_0        STATUS_ABANDONED_WAIT_0
903 #define WAIT_IO_COMPLETION      STATUS_USER_APC
904 #define WAIT_TIMEOUT            STATUS_TIMEOUT
905 #define STILL_ACTIVE            STATUS_PENDING
906
907 #define FILE_BEGIN              0
908 #define FILE_CURRENT            1
909 #define FILE_END                2
910
911 #define FILE_MAP_COPY                   0x00000001
912 #define FILE_MAP_WRITE                  0x00000002
913 #define FILE_MAP_READ                   0x00000004
914 #define FILE_MAP_ALL_ACCESS             0x000f001f
915
916 #define MOVEFILE_REPLACE_EXISTING       0x00000001
917 #define MOVEFILE_COPY_ALLOWED           0x00000002
918 #define MOVEFILE_DELAY_UNTIL_REBOOT     0x00000004
919
920 #define FS_CASE_SENSITIVE               FILE_CASE_SENSITIVE_SEARCH
921 #define FS_CASE_IS_PRESERVED            FILE_CASE_PRESERVED_NAMES
922 #define FS_UNICODE_STORED_ON_DISK       FILE_UNICODE_ON_DISK
923
924 #define EXCEPTION_ACCESS_VIOLATION          STATUS_ACCESS_VIOLATION
925 #define EXCEPTION_DATATYPE_MISALIGNMENT     STATUS_DATATYPE_MISALIGNMENT
926 #define EXCEPTION_BREAKPOINT                STATUS_BREAKPOINT
927 #define EXCEPTION_SINGLE_STEP               STATUS_SINGLE_STEP
928 #define EXCEPTION_ARRAY_BOUNDS_EXCEEDED     STATUS_ARRAY_BOUNDS_EXCEEDED
929 #define EXCEPTION_FLT_DENORMAL_OPERAND      STATUS_FLOAT_DENORMAL_OPERAND
930 #define EXCEPTION_FLT_DIVIDE_BY_ZERO        STATUS_FLOAT_DIVIDE_BY_ZERO
931 #define EXCEPTION_FLT_INEXACT_RESULT        STATUS_FLOAT_INEXACT_RESULT
932 #define EXCEPTION_FLT_INVALID_OPERATION     STATUS_FLOAT_INVALID_OPERATION
933 #define EXCEPTION_FLT_OVERFLOW              STATUS_FLOAT_OVERFLOW
934 #define EXCEPTION_FLT_STACK_CHECK           STATUS_FLOAT_STACK_CHECK
935 #define EXCEPTION_FLT_UNDERFLOW             STATUS_FLOAT_UNDERFLOW
936 #define EXCEPTION_INT_DIVIDE_BY_ZERO        STATUS_INTEGER_DIVIDE_BY_ZERO
937 #define EXCEPTION_INT_OVERFLOW              STATUS_INTEGER_OVERFLOW
938 #define EXCEPTION_PRIV_INSTRUCTION          STATUS_PRIVILEGED_INSTRUCTION
939 #define EXCEPTION_IN_PAGE_ERROR             STATUS_IN_PAGE_ERROR
940 #define EXCEPTION_ILLEGAL_INSTRUCTION       STATUS_ILLEGAL_INSTRUCTION
941 #define EXCEPTION_NONCONTINUABLE_EXCEPTION  STATUS_NONCONTINUABLE_EXCEPTION
942 #define EXCEPTION_STACK_OVERFLOW            STATUS_STACK_OVERFLOW
943 #define EXCEPTION_INVALID_DISPOSITION       STATUS_INVALID_DISPOSITION
944 #define EXCEPTION_GUARD_PAGE                STATUS_GUARD_PAGE_VIOLATION
945 #define EXCEPTION_INVALID_HANDLE            STATUS_INVALID_HANDLE
946 #define CONTROL_C_EXIT                      STATUS_CONTROL_C_EXIT
947
948 /* Wine extension; Windows doesn't have a name for this code */
949 #define EXCEPTION_CRITICAL_SECTION_WAIT     0xc0000194
950
951 #define DUPLICATE_CLOSE_SOURCE          0x00000001
952 #define DUPLICATE_SAME_ACCESS           0x00000002
953
954 #define HANDLE_FLAG_INHERIT             0x00000001
955 #define HANDLE_FLAG_PROTECT_FROM_CLOSE  0x00000002
956
957 #define HINSTANCE_ERROR 32
958
959 #define THREAD_PRIORITY_LOWEST          THREAD_BASE_PRIORITY_MIN
960 #define THREAD_PRIORITY_BELOW_NORMAL    (THREAD_PRIORITY_LOWEST+1)
961 #define THREAD_PRIORITY_NORMAL          0
962 #define THREAD_PRIORITY_HIGHEST         THREAD_BASE_PRIORITY_MAX
963 #define THREAD_PRIORITY_ABOVE_NORMAL    (THREAD_PRIORITY_HIGHEST-1)
964 #define THREAD_PRIORITY_ERROR_RETURN    (0x7fffffff)
965 #define THREAD_PRIORITY_TIME_CRITICAL   THREAD_BASE_PRIORITY_LOWRT
966 #define THREAD_PRIORITY_IDLE            THREAD_BASE_PRIORITY_IDLE
967
968 /* flags to FormatMessage */
969 #define FORMAT_MESSAGE_ALLOCATE_BUFFER  0x00000100
970 #define FORMAT_MESSAGE_IGNORE_INSERTS   0x00000200
971 #define FORMAT_MESSAGE_FROM_STRING      0x00000400
972 #define FORMAT_MESSAGE_FROM_HMODULE     0x00000800
973 #define FORMAT_MESSAGE_FROM_SYSTEM      0x00001000
974 #define FORMAT_MESSAGE_ARGUMENT_ARRAY   0x00002000
975 #define FORMAT_MESSAGE_MAX_WIDTH_MASK   0x000000FF
976
977 #ifdef __WINE__
978 #define CRITICAL_SECTION_INIT { 0, -1, 0, 0, 0, 0 }
979 #endif
980
981 typedef struct {
982         DWORD dwOSVersionInfoSize;
983         DWORD dwMajorVersion;
984         DWORD dwMinorVersion;
985         DWORD dwBuildNumber;
986         DWORD dwPlatformId;
987         CHAR szCSDVersion[128];
988 } OSVERSIONINFOA;
989
990 typedef struct {
991         DWORD dwOSVersionInfoSize;
992         DWORD dwMajorVersion;
993         DWORD dwMinorVersion;
994         DWORD dwBuildNumber;
995         DWORD dwPlatformId;
996         WCHAR szCSDVersion[128];
997 } OSVERSIONINFOW;
998
999 DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
1000
1001 #define VER_PLATFORM_WIN32s             0
1002 #define VER_PLATFORM_WIN32_WINDOWS      1
1003 #define VER_PLATFORM_WIN32_NT           2
1004
1005 typedef struct tagCOMSTAT
1006 {
1007     DWORD status;
1008     DWORD cbInQue;
1009     DWORD cbOutQue;
1010 } COMSTAT,*LPCOMSTAT;
1011
1012 typedef struct tagDCB
1013 {
1014     DWORD DCBlength;
1015     DWORD BaudRate;
1016     unsigned fBinary               :1;
1017     unsigned fParity               :1;
1018     unsigned fOutxCtsFlow          :1;
1019     unsigned fOutxDsrFlow          :1;
1020     unsigned fDtrControl           :2;
1021     unsigned fDsrSensitivity       :1;
1022     unsigned fTXContinueOnXoff     :1;
1023     unsigned fOutX                 :1;
1024     unsigned fInX                  :1;
1025     unsigned fErrorChar            :1;
1026     unsigned fNull                 :1;
1027     unsigned fRtsControl           :2;
1028     unsigned fAbortOnError         :1;
1029     unsigned fDummy2               :17;
1030     WORD wReserved;
1031     WORD XonLim;
1032     WORD XoffLim;
1033     BYTE ByteSize;
1034     BYTE Parity;
1035     BYTE StopBits;
1036     char XonChar;
1037     char XoffChar;
1038     char ErrorChar;
1039     char EofChar;
1040     char EvtChar;
1041 } DCB, *LPDCB;
1042
1043 typedef struct tagCOMMCONFIG {
1044         DWORD dwSize;
1045         WORD  wVersion;
1046         WORD  wReserved;
1047         DCB   dcb;
1048         DWORD dwProviderSubType;
1049         DWORD dwProviderOffset;
1050         DWORD dwProviderSize;
1051         DWORD wcProviderData[1];
1052 } COMMCONFIG, *LPCOMMCONFIG;
1053
1054 typedef struct tagCOMMPROP {
1055         WORD  wPacketLength;
1056         WORD  wPacketVersion;
1057         DWORD dwServiceMask;
1058         DWORD dwReserved1;
1059         DWORD dwMaxTxQueue;
1060         DWORD dwMaxRxQueue;
1061         DWORD dwMaxBaud;
1062         DWORD dwProvSubType;
1063         DWORD dwProvCapabilities;
1064         DWORD dwSettableParams;
1065         DWORD dwSettableBaud;
1066         WORD  wSettableData;
1067         WORD  wSettableStopParity;
1068         DWORD dwCurrentTxQueue;
1069         DWORD dwCurrentRxQueue;
1070         DWORD dwProvSpec1;
1071         DWORD dwProvSpec2;
1072         WCHAR wcProvChar[1];
1073 } COMMPROP, *LPCOMMPROP;
1074
1075 #define SP_SERIALCOMM ((DWORD)1)
1076
1077 #define BAUD_075     ((DWORD)0x01)
1078 #define BAUD_110     ((DWORD)0x02)
1079 #define BAUD_134_5   ((DWORD)0x04)
1080 #define BAUD_150     ((DWORD)0x08)
1081 #define BAUD_300     ((DWORD)0x10)
1082 #define BAUD_600     ((DWORD)0x20)
1083 #define BAUD_1200    ((DWORD)0x40)
1084 #define BAUD_1800    ((DWORD)0x80)
1085 #define BAUD_2400    ((DWORD)0x100)
1086 #define BAUD_4800    ((DWORD)0x200)
1087 #define BAUD_7200    ((DWORD)0x400)
1088 #define BAUD_9600    ((DWORD)0x800)
1089 #define BAUD_14400   ((DWORD)0x1000)
1090 #define BAUD_19200   ((DWORD)0x2000)
1091 #define BAUD_38400   ((DWORD)0x4000)
1092 #define BAUD_56K     ((DWORD)0x8000)
1093 #define BAUD_57600   ((DWORD)0x40000)
1094 #define BAUD_115200  ((DWORD)0x20000)
1095 #define BAUD_128K    ((DWORD)0x10000)
1096 #define BAUD_USER    ((DWORD)0x10000000)
1097
1098 #define PST_FAX            ((DWORD)0x21)
1099 #define PST_LAT            ((DWORD)0x101)
1100 #define PST_MODEM          ((DWORD)0x06)
1101 #define PST_NETWORK_BRIDGE ((DWORD)0x100)
1102 #define PST_PARALLEL_PORT  ((DWORD)0x02)
1103 #define PST_RS232          ((DWORD)0x01)
1104 #define PST_RS442          ((DWORD)0x03)
1105 #define PST_RS423          ((DWORD)0x04)
1106 #define PST_RS449          ((DWORD)0x06)
1107 #define PST_SCANNER        ((DWORD)0x22)
1108 #define PST_TCPIP_TELNET   ((DWORD)0x102)
1109 #define PST_UNSPECIFIED    ((DWORD)0x00)
1110 #define PST_X25            ((DWORD)0x103)
1111
1112 #define PCF_16BITMODE     ((DWORD)0x200)
1113 #define PCF_DTRDSR        ((DWORD)0x01)
1114 #define PCF_INTTIMEOUTS   ((DWORD)0x80)
1115 #define PCF_PARITY_CHECK  ((DWORD)0x08)
1116 #define PCF_RLSD          ((DWORD)0x04)
1117 #define PCF_RTSCTS        ((DWORD)0x02)
1118 #define PCF_SETXCHAR      ((DWORD)0x20)
1119 #define PCF_SPECIALCHARS  ((DWORD)0x100)
1120 #define PCF_TOTALTIMEOUTS ((DWORD)0x40)
1121 #define PCF_XONXOFF       ((DWORD)0x10)
1122
1123 #define SP_BAUD         ((DWORD)0x02)
1124 #define SP_DATABITS     ((DWORD)0x04)
1125 #define SP_HANDSHAKING  ((DWORD)0x10)
1126 #define SP_PARITY       ((DWORD)0x01)
1127 #define SP_PARITY_CHECK ((DWORD)0x20)
1128 #define SP_RLSD         ((DWORD)0x40)
1129 #define SP_STOPBITS     ((DWORD)0x08)
1130
1131 #define DATABITS_5   ((DWORD)0x01)
1132 #define DATABITS_6   ((DWORD)0x02)
1133 #define DATABITS_7   ((DWORD)0x04)
1134 #define DATABITS_8   ((DWORD)0x08)
1135 #define DATABITS_16  ((DWORD)0x10)
1136 #define DATABITS_16X ((DWORD)0x20)
1137
1138 #define STOPBITS_10 ((DWORD)1)
1139 #define STOPBITS_15 ((DWORD)2)
1140 #define STOPBITS_20 ((DWORD)4)
1141
1142 #define PARITY_NONE  ((DWORD)0x100)
1143 #define PARITY_ODD   ((DWORD)0x200)
1144 #define PARITY_EVEN  ((DWORD)0x400)
1145 #define PARITY_MARK  ((DWORD)0x800)
1146 #define PARITY_SPACE ((DWORD)0x1000)
1147
1148 typedef struct tagCOMMTIMEOUTS {
1149         DWORD   ReadIntervalTimeout;
1150         DWORD   ReadTotalTimeoutMultiplier;
1151         DWORD   ReadTotalTimeoutConstant;
1152         DWORD   WriteTotalTimeoutMultiplier;
1153         DWORD   WriteTotalTimeoutConstant;
1154 } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
1155
1156
1157 #include "poppack.h"
1158
1159 typedef void CALLBACK (*PAPCFUNC)(ULONG_PTR);
1160 typedef void CALLBACK (*PTIMERAPCROUTINE)(LPVOID,DWORD,DWORD);
1161   
1162 /*DWORD WINAPI GetVersion( void );*/
1163 BOOL WINAPI GetVersionExA(OSVERSIONINFOA*);
1164 BOOL WINAPI GetVersionExW(OSVERSIONINFOW*);
1165 #define GetVersionEx WINELIB_NAME_AW(GetVersionEx)
1166
1167 /*int WinMain(HINSTANCE, HINSTANCE prev, char *cmd, int show);*/
1168
1169 LONG WINAPI RtlEnterCriticalSection( CRITICAL_SECTION *crit );
1170 LONG WINAPI RtlLeaveCriticalSection( CRITICAL_SECTION *crit );
1171 LONG WINAPI RtlDeleteCriticalSection( CRITICAL_SECTION *crit );
1172 BOOL WINAPI RtlTryEnterCriticalSection( CRITICAL_SECTION *crit );
1173 /* FIXME: need to use defines because we don't have proper imports yet */
1174 #define     EnterCriticalSection(crit) RtlEnterCriticalSection(crit)
1175 #define     LeaveCriticalSection(crit) RtlLeaveCriticalSection(crit)
1176 #define     DeleteCriticalSection(crit) RtlDeleteCriticalSection(crit)
1177 #define     TryEnterCriticalSection(crit) RtlTryEnterCriticalSection(crit)
1178 #if 0
1179 void      WINAPI DeleteCriticalSection(CRITICAL_SECTION *lpCrit);
1180 void      WINAPI EnterCriticalSection(CRITICAL_SECTION *lpCrit);
1181 BOOL      WINAPI TryEnterCriticalSection(CRITICAL_SECTION *lpCrit);
1182 void      WINAPI LeaveCriticalSection(CRITICAL_SECTION *lpCrit);
1183 #endif
1184
1185 void      WINAPI InitializeCriticalSection(CRITICAL_SECTION *lpCrit);
1186 void      WINAPI MakeCriticalSectionGlobal(CRITICAL_SECTION *lpCrit);
1187 BOOL      WINAPI GetProcessWorkingSetSize(HANDLE,LPDWORD,LPDWORD);
1188 DWORD     WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
1189 void      WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD);
1190 BOOL    WINAPI SetProcessWorkingSetSize(HANDLE,DWORD,DWORD);
1191 BOOL    WINAPI TerminateProcess(HANDLE,DWORD);
1192 BOOL    WINAPI TerminateThread(HANDLE,DWORD);
1193 BOOL    WINAPI GetExitCodeThread(HANDLE,LPDWORD); 
1194
1195 /* GetBinaryType return values.
1196  */
1197
1198 #define SCS_32BIT_BINARY    0
1199 #define SCS_DOS_BINARY      1
1200 #define SCS_WOW_BINARY      2
1201 #define SCS_PIF_BINARY      3
1202 #define SCS_POSIX_BINARY    4
1203 #define SCS_OS216_BINARY    5
1204
1205 BOOL WINAPI GetBinaryTypeA( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
1206 BOOL WINAPI GetBinaryTypeW( LPCWSTR lpApplicationName, LPDWORD lpBinaryType );
1207 #define GetBinaryType WINELIB_NAME_AW(GetBinaryType)
1208
1209 /* Declarations for functions that exist only in Win32 */
1210
1211 BOOL        WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1212 BOOL        WINAPI AttachThreadInput(DWORD,DWORD,BOOL);
1213 BOOL        WINAPI AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL);
1214 BOOL        WINAPI AdjustTokenPrivileges(HANDLE,BOOL,LPVOID,DWORD,LPVOID,LPDWORD);
1215 BOOL        WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1216 BOOL        WINAPI AllocateLocallyUniqueId(PLUID);
1217 BOOL      WINAPI AllocConsole(void);
1218 BOOL      WINAPI AreFileApisANSI(void);
1219 BOOL        WINAPI BackupEventLogA(HANDLE,LPCSTR);
1220 BOOL        WINAPI BackupEventLogW(HANDLE,LPCWSTR);
1221 #define     BackupEventLog WINELIB_NAME_AW(BackupEventLog)
1222 BOOL        WINAPI BackupRead(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
1223 BOOL        WINAPI BackupSeek(HANDLE,DWORD,DWORD,LPDWORD,LPDWORD,LPVOID*);
1224 BOOL        WINAPI BackupWrite(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
1225 BOOL        WINAPI Beep(DWORD,DWORD);
1226 BOOL        WINAPI BuildCommDCBA(LPCSTR,LPDCB);
1227 BOOL        WINAPI BuildCommDCBW(LPCWSTR,LPDCB);
1228 #define     BuildCommDCB WINELIB_NAME_AW(BuildCommDCB)
1229 BOOL        WINAPI BuildCommDCBAndTimeoutsA(LPCSTR,LPDCB,LPCOMMTIMEOUTS);
1230 BOOL        WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);
1231 #define     BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
1232 BOOL        WINAPI CancelWaitableTimer(HANDLE);
1233 BOOL        WINAPI ClearCommError(HANDLE,LPDWORD,LPCOMSTAT);
1234 BOOL        WINAPI ClearEventLogA(HANDLE,LPCSTR);
1235 BOOL        WINAPI ClearEventLogW(HANDLE,LPCWSTR);
1236 #define     ClearEventLog WINELIB_NAME_AW(ClearEventLog)
1237 BOOL        WINAPI CloseEventLog(HANDLE);
1238 BOOL        WINAPI CloseHandle(HANDLE);
1239 BOOL        WINAPI CommConfigDialogA(LPCSTR,HANDLE,LPCOMMCONFIG);
1240 BOOL        WINAPI CommConfigDialogW(LPCWSTR,HANDLE,LPCOMMCONFIG);
1241 #define     CommConfigDialog WINELIB_NAME_AW(CommConfigDialog)
1242 BOOL      WINAPI ContinueDebugEvent(DWORD,DWORD,DWORD);
1243 HANDLE    WINAPI ConvertToGlobalHandle(HANDLE hSrc);
1244 BOOL      WINAPI CopyFileA(LPCSTR,LPCSTR,BOOL);
1245 BOOL      WINAPI CopyFileW(LPCWSTR,LPCWSTR,BOOL);
1246 #define     CopyFile WINELIB_NAME_AW(CopyFile)
1247 BOOL      WINAPI CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
1248 BOOL      WINAPI CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
1249 #define     CopyFileEx WINELIB_NAME_AW(CopyFileEx)
1250 BOOL        WINAPI CopySid(DWORD,PSID,PSID);
1251 INT       WINAPI CompareFileTime(LPFILETIME,LPFILETIME);
1252 HANDLE    WINAPI CreateEventA(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCSTR);
1253 HANDLE    WINAPI CreateEventW(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCWSTR);
1254 #define     CreateEvent WINELIB_NAME_AW(CreateEvent)
1255 HANDLE     WINAPI CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,
1256                                  DWORD,DWORD,HANDLE);
1257 HANDLE     WINAPI CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,
1258                                  DWORD,DWORD,HANDLE);
1259 #define     CreateFile WINELIB_NAME_AW(CreateFile)
1260 HANDLE    WINAPI CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,
1261                                         DWORD,DWORD,LPCSTR);
1262 HANDLE    WINAPI CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,
1263                                         DWORD,DWORD,LPCWSTR);
1264 #define     CreateFileMapping WINELIB_NAME_AW(CreateFileMapping)
1265 HANDLE    WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1266 HANDLE    WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1267 #define     CreateMutex WINELIB_NAME_AW(CreateMutex)
1268 BOOL      WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
1269 BOOL      WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,
1270                                     LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCSTR,
1271                                     LPSTARTUPINFOA,LPPROCESS_INFORMATION);
1272 BOOL      WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,
1273                                     LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,
1274                                     LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1275 #define     CreateProcess WINELIB_NAME_AW(CreateProcess)
1276 HANDLE    WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
1277 HANDLE    WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
1278 #define     CreateSemaphore WINELIB_NAME_AW(CreateSemaphore)
1279 DWORD       WINAPI CreateTapePartition(HANDLE,DWORD,DWORD,DWORD);
1280 HANDLE      WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
1281 HANDLE      WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1282 HANDLE      WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1283 #define     CreateWaitableTimer WINELIB_NAME_AW(CreateWaitableTimer)
1284 BOOL        WINAPI DebugActiveProcess(DWORD);
1285 void        WINAPI DebugBreak(void);
1286 BOOL        WINAPI DeregisterEventSource(HANDLE);
1287 BOOL        WINAPI DisableThreadLibraryCalls(HMODULE);
1288 BOOL        WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
1289 BOOL        WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,HANDLE*,DWORD,BOOL,DWORD);
1290 BOOL        WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);
1291 BOOL        WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);
1292 #define     EnumDateFormats WINELIB_NAME_AW(EnumDateFormats)
1293 BOOL      WINAPI EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,
1294                                             ENUMRESLANGPROCA,LONG);
1295 BOOL      WINAPI EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,
1296                                             ENUMRESLANGPROCW,LONG);
1297 #define     EnumResourceLanguages WINELIB_NAME_AW(EnumResourceLanguages)
1298 BOOL      WINAPI EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,
1299                                         LONG);
1300 BOOL      WINAPI EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,
1301                                         LONG);
1302 #define     EnumResourceNames WINELIB_NAME_AW(EnumResourceNames)
1303 BOOL      WINAPI EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG);
1304 BOOL      WINAPI EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG);
1305 #define     EnumResourceTypes WINELIB_NAME_AW(EnumResourceTypes)
1306 BOOL      WINAPI EnumSystemCodePagesA(CODEPAGE_ENUMPROCA,DWORD);
1307 BOOL      WINAPI EnumSystemCodePagesW(CODEPAGE_ENUMPROCW,DWORD);
1308 #define     EnumSystemCodePages WINELIB_NAME_AW(EnumSystemCodePages)
1309 BOOL      WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD);
1310 BOOL      WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD);
1311 #define     EnumSystemLocales WINELIB_NAME_AW(EnumSystemLocales)
1312 BOOL      WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags);
1313 BOOL      WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags);
1314 #define     EnumTimeFormats WINELIB_NAME_AW(EnumTimeFormats)
1315 BOOL        WINAPI EqualSid(PSID, PSID);
1316 BOOL        WINAPI EqualPrefixSid(PSID,PSID);
1317 DWORD       WINAPI EraseTape(HANDLE,DWORD,BOOL);
1318 VOID        WINAPI ExitProcess(DWORD) WINE_NORETURN;
1319 VOID        WINAPI ExitThread(DWORD) WINE_NORETURN;
1320 DWORD       WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD);
1321 DWORD       WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD);
1322 #define     ExpandEnvironmentStrings WINELIB_NAME_AW(ExpandEnvironmentStrings)
1323 BOOL      WINAPI FileTimeToDosDateTime(const FILETIME*,LPWORD,LPWORD);
1324 BOOL      WINAPI FileTimeToLocalFileTime(const FILETIME*,LPFILETIME);
1325 BOOL      WINAPI FileTimeToSystemTime(const FILETIME*,LPSYSTEMTIME);
1326 HANDLE    WINAPI FindFirstChangeNotificationA(LPCSTR,BOOL,DWORD);
1327 HANDLE    WINAPI FindFirstChangeNotificationW(LPCWSTR,BOOL,DWORD);
1328 #define     FindFirstChangeNotification WINELIB_NAME_AW(FindFirstChangeNotification)
1329 BOOL      WINAPI FindNextChangeNotification(HANDLE);
1330 BOOL      WINAPI FindCloseChangeNotification(HANDLE);
1331 HRSRC     WINAPI FindResourceExA(HMODULE,LPCSTR,LPCSTR,WORD);
1332 HRSRC     WINAPI FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);
1333 #define     FindResourceEx WINELIB_NAME_AW(FindResourceEx)
1334 BOOL      WINAPI FlushConsoleInputBuffer(HANDLE);
1335 BOOL      WINAPI FlushFileBuffers(HANDLE);
1336 BOOL      WINAPI FlushViewOfFile(LPCVOID, DWORD);
1337 DWORD       WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,va_list*);
1338 DWORD       WINAPI FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,va_list*);
1339 #define     FormatMessage WINELIB_NAME_AW(FormatMessage)
1340 BOOL      WINAPI FreeConsole(void);
1341 BOOL      WINAPI FreeEnvironmentStringsA(LPSTR);
1342 BOOL      WINAPI FreeEnvironmentStringsW(LPWSTR);
1343 #define     FreeEnvironmentStrings WINELIB_NAME_AW(FreeEnvironmentStrings)
1344 VOID        WINAPI FreeLibraryAndExitThread(HINSTANCE,DWORD);
1345 PVOID       WINAPI FreeSid(PSID);
1346 UINT        WINAPI GetACP(void);
1347 BOOL        WINAPI GetCommConfig(HANDLE,LPCOMMCONFIG);
1348 BOOL        WINAPI GetCommMask(HANDLE,LPDWORD);
1349 BOOL        WINAPI GetCommModemStatus(HANDLE,LPDWORD);
1350 BOOL        WINAPI GetCommProperties(HANDLE,LPCOMMPROP);
1351 BOOL        WINAPI GetCommState(HANDLE,LPDCB);
1352 BOOL        WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
1353 LPSTR       WINAPI GetCommandLineA(void);
1354 LPWSTR      WINAPI GetCommandLineW(void);
1355 #define     GetCommandLine WINELIB_NAME_AW(GetCommandLine)
1356 BOOL      WINAPI GetComputerNameA(LPSTR,LPDWORD);
1357 BOOL      WINAPI GetComputerNameW(LPWSTR,LPDWORD);
1358 #define     GetComputerName WINELIB_NAME_AW(GetComputerName)
1359 UINT      WINAPI GetConsoleCP(void);
1360 BOOL      WINAPI GetConsoleMode(HANDLE,LPDWORD);
1361 UINT      WINAPI GetConsoleOutputCP(void);
1362 DWORD       WINAPI GetConsoleTitleA(LPSTR,DWORD);
1363 DWORD       WINAPI GetConsoleTitleW(LPWSTR,DWORD);
1364 #define     GetConsoleTitle WINELIB_NAME_AW(GetConsoleTitle)
1365 HANDLE      WINAPI GetCurrentProcess(void);
1366 HANDLE      WINAPI GetCurrentThread(void);
1367 INT         WINAPI GetDateFormatA(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT);
1368 INT         WINAPI GetDateFormatW(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT);
1369 #define     GetDateFormat WINELIB_NAME_AW(GetDateFormat)
1370 BOOL        WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD);
1371 BOOL        WINAPI GetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,LPDWORD);
1372 #define     GetDefaultCommConfig WINELIB_NAME_AW(GetDefaultCommConfig)
1373 LPSTR       WINAPI GetEnvironmentStringsA(void);
1374 LPWSTR      WINAPI GetEnvironmentStringsW(void);
1375 #define     GetEnvironmentStrings WINELIB_NAME_AW(GetEnvironmentStrings)
1376 DWORD       WINAPI GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
1377 DWORD       WINAPI GetEnvironmentVariableW(LPCWSTR,LPWSTR,DWORD);
1378 #define     GetEnvironmentVariable WINELIB_NAME_AW(GetEnvironmentVariable)
1379 BOOL      WINAPI GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
1380 BOOL      WINAPI GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
1381 #define     GetFileattributesEx WINELIB_NAME_AW(GetFileAttributesEx)
1382 DWORD       WINAPI GetFileInformationByHandle(HANDLE,BY_HANDLE_FILE_INFORMATION*);
1383 BOOL        WINAPI GetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
1384 BOOL        WINAPI GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
1385 #define     GetFileSecurity WINELIB_NAME_AW(GetFileSecurity)
1386 DWORD       WINAPI GetFileSize(HANDLE,LPDWORD);
1387 BOOL        WINAPI GetFileTime(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME);
1388 DWORD       WINAPI GetFileType(HANDLE);
1389 DWORD       WINAPI GetFullPathNameA(LPCSTR,DWORD,LPSTR,LPSTR*);
1390 DWORD       WINAPI GetFullPathNameW(LPCWSTR,DWORD,LPWSTR,LPWSTR*);
1391 #define     GetFullPathName WINELIB_NAME_AW(GetFullPathName)
1392 BOOL      WINAPI GetHandleInformation(HANDLE,LPDWORD);
1393 DWORD       WINAPI GetLengthSid(PSID);
1394 VOID        WINAPI GetLocalTime(LPSYSTEMTIME);
1395 DWORD       WINAPI GetLogicalDrives(void);
1396 DWORD       WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
1397 DWORD       WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
1398 #define     GetLongPathName WINELIB_NAME_AW(GetLongPathName)
1399 BOOL      WINAPI GetNumberOfConsoleInputEvents(HANDLE,LPDWORD);
1400 BOOL      WINAPI GetNumberOfConsoleMouseButtons(LPDWORD);
1401 BOOL        WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD);
1402 UINT      WINAPI GetOEMCP(void);
1403 BOOL        WINAPI GetOldestEventLogRecord(HANDLE,PDWORD);
1404 DWORD       WINAPI GetPriorityClass(HANDLE);
1405 BOOL        WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
1406 DWORD       WINAPI GetProcessVersion(DWORD);
1407 BOOL        WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1408 BOOL        WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL *,LPBOOL);
1409 BOOL        WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID *,LPBOOL);
1410 DWORD       WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
1411 BOOL        WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID *,LPBOOL);
1412 BOOL        WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL *,LPBOOL);
1413 PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
1414 DWORD       WINAPI GetSidLengthRequired(BYTE);
1415 PDWORD      WINAPI GetSidSubAuthority(PSID,DWORD);
1416 PUCHAR      WINAPI GetSidSubAuthorityCount(PSID);
1417 DWORD       WINAPI GetShortPathNameA(LPCSTR,LPSTR,DWORD);
1418 DWORD       WINAPI GetShortPathNameW(LPCWSTR,LPWSTR,DWORD);
1419 #define     GetShortPathName WINELIB_NAME_AW(GetShortPathName)
1420 HANDLE      WINAPI GetStdHandle(DWORD);
1421 BOOL      WINAPI GetStringTypeExA(LCID,DWORD,LPCSTR,INT,LPWORD);
1422 BOOL      WINAPI GetStringTypeExW(LCID,DWORD,LPCWSTR,INT,LPWORD);
1423 #define     GetStringTypeEx WINELIB_NAME_AW(GetStringTypeEx)
1424 VOID        WINAPI GetSystemInfo(LPSYSTEM_INFO);
1425 BOOL        WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
1426 VOID        WINAPI GetSystemTime(LPSYSTEMTIME);
1427 VOID        WINAPI GetSystemTimeAsFileTime(LPFILETIME);
1428 DWORD       WINAPI GetTapeParameters(HANDLE,DWORD,LPDWORD,LPVOID);
1429 DWORD       WINAPI GetTapePosition(HANDLE,DWORD,LPDWORD,LPDWORD,LPDWORD);
1430 DWORD       WINAPI GetTapeStatus(HANDLE);
1431 INT         WINAPI GetTimeFormatA(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT);
1432 INT         WINAPI GetTimeFormatW(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT);
1433 #define     GetTimeFormat WINELIB_NAME_AW(GetTimeFormat)
1434 DWORD       WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1435 BOOL        WINAPI GetThreadContext(HANDLE,CONTEXT *);
1436 LCID        WINAPI GetThreadLocale(void);
1437 INT       WINAPI GetThreadPriority(HANDLE);
1438 BOOL        WINAPI GetThreadPriorityBoost(HANDLE,PBOOL);
1439 BOOL      WINAPI GetThreadSelectorEntry(HANDLE,DWORD,LPLDT_ENTRY);
1440 BOOL        WINAPI GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
1441 BOOL        WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD,LPDWORD);
1442 BOOL        WINAPI GetUserNameA(LPSTR,LPDWORD);
1443 BOOL        WINAPI GetUserNameW(LPWSTR,LPDWORD);
1444 #define     GetUserName WINELIB_NAME_AW(GetUserName)
1445 VOID        WINAPI GlobalMemoryStatus(LPMEMORYSTATUS);
1446 LPVOID      WINAPI HeapAlloc(HANDLE,DWORD,DWORD);
1447 DWORD       WINAPI HeapCompact(HANDLE,DWORD);
1448 HANDLE    WINAPI HeapCreate(DWORD,DWORD,DWORD);
1449 BOOL      WINAPI HeapDestroy(HANDLE);
1450 BOOL      WINAPI HeapFree(HANDLE,DWORD,LPVOID);
1451 BOOL      WINAPI HeapLock(HANDLE);
1452 LPVOID      WINAPI HeapReAlloc(HANDLE,DWORD,LPVOID,DWORD);
1453 DWORD       WINAPI HeapSize(HANDLE,DWORD,LPVOID);
1454 BOOL      WINAPI HeapUnlock(HANDLE);
1455 BOOL      WINAPI HeapValidate(HANDLE,DWORD,LPCVOID);
1456 BOOL        WINAPI HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
1457 DWORD       WINAPI InitializeAcl(PACL,DWORD,DWORD);
1458 BOOL        WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1459 BOOL        WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1460 BOOL        WINAPI IsTextUnicode(CONST LPVOID lpBuffer, int cb, LPINT lpi);
1461 BOOL        WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1462 BOOL        WINAPI IsValidSid(PSID);
1463 BOOL        WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1464 BOOL        WINAPI IsDBCSLeadByteEx(UINT,BYTE);
1465 BOOL        WINAPI IsProcessorFeaturePresent(DWORD);
1466 BOOL        WINAPI IsValidLocale(DWORD,DWORD);
1467 BOOL        WINAPI LookupAccountSidA(LPCSTR,PSID,LPSTR,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
1468 BOOL        WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,LPDWORD,LPWSTR,LPDWORD,PSID_NAME_USE);
1469 #define     LookupAccountSid WINELIB_NAME_AW(LookupAccountSid)
1470 BOOL        WINAPI LocalFileTimeToFileTime(const FILETIME*,LPFILETIME);
1471 BOOL        WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
1472 BOOL        WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED);    
1473 BOOL        WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,LPVOID);
1474 BOOL        WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,LPVOID);
1475 #define     LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue)
1476 BOOL        WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1477 HMODULE     WINAPI MapHModuleSL(WORD);
1478 WORD        WINAPI MapHModuleLS(HMODULE);
1479 LPVOID      WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
1480 LPVOID      WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPVOID);
1481 BOOL      WINAPI MoveFileA(LPCSTR,LPCSTR);
1482 BOOL      WINAPI MoveFileW(LPCWSTR,LPCWSTR);
1483 #define     MoveFile WINELIB_NAME_AW(MoveFile)
1484 BOOL      WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD);
1485 BOOL      WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD);
1486 #define     MoveFileEx WINELIB_NAME_AW(MoveFileEx)
1487 INT       WINAPI MultiByteToWideChar(UINT,DWORD,LPCSTR,INT,LPWSTR,INT);
1488 BOOL        WINAPI NotifyChangeEventLog(HANDLE,HANDLE);
1489 INT       WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,BOOL*);
1490 HANDLE      WINAPI OpenBackupEventLogA(LPCSTR,LPCSTR);
1491 HANDLE      WINAPI OpenBackupEventLogW(LPCWSTR,LPCWSTR);
1492 #define     OpenBackupEventLog WINELIB_NAME_AW(OpenBackupEventLog)
1493 HANDLE    WINAPI OpenEventA(DWORD,BOOL,LPCSTR);
1494 HANDLE    WINAPI OpenEventW(DWORD,BOOL,LPCWSTR);
1495 #define     OpenEvent WINELIB_NAME_AW(OpenEvent)
1496 HANDLE      WINAPI OpenEventLogA(LPCSTR,LPCSTR);
1497 HANDLE      WINAPI OpenEventLogW(LPCWSTR,LPCWSTR);
1498 #define     OpenEventLog WINELIB_NAME_AW(OpenEventLog)
1499 HANDLE    WINAPI OpenFileMappingA(DWORD,BOOL,LPCSTR);
1500 HANDLE    WINAPI OpenFileMappingW(DWORD,BOOL,LPCWSTR);
1501 #define     OpenFileMapping WINELIB_NAME_AW(OpenFileMapping)
1502 HANDLE    WINAPI OpenMutexA(DWORD,BOOL,LPCSTR);
1503 HANDLE    WINAPI OpenMutexW(DWORD,BOOL,LPCWSTR);
1504 #define     OpenMutex WINELIB_NAME_AW(OpenMutex)
1505 HANDLE    WINAPI OpenProcess(DWORD,BOOL,DWORD);
1506 BOOL        WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);
1507 HANDLE    WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR);
1508 HANDLE    WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR);
1509 #define     OpenSemaphore WINELIB_NAME_AW(OpenSemaphore)
1510 BOOL        WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE);
1511 HANDLE      WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR);
1512 HANDLE      WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR);
1513 #define     OpenWaitableTimer WINELIB_NAME_AW(OpenWaitableTimer)
1514 DWORD       WINAPI PrepareTape(HANDLE,DWORD,BOOL);
1515 BOOL        WINAPI PulseEvent(HANDLE);
1516 BOOL        WINAPI PurgeComm(HANDLE,DWORD);
1517 DWORD       WINAPI QueryDosDeviceA(LPCSTR,LPSTR,DWORD);
1518 DWORD       WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);
1519 #define     QueryDosDevice WINELIB_NAME_AW(QueryDosDevice)
1520 BOOL        WINAPI QueryPerformanceCounter(LARGE_INTEGER*);
1521 BOOL        WINAPI QueryPerformanceFrequency(LARGE_INTEGER*);
1522 BOOL      WINAPI ReadConsoleA(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
1523 BOOL      WINAPI ReadConsoleW(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
1524 #define     ReadConsole WINELIB_NAME_AW(ReadConsole)
1525 BOOL        WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
1526 BOOL        WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
1527 #define     ReadEventLog WINELIB_NAME_AW(ReadEventLog)
1528 BOOL      WINAPI ReadFile(HANDLE,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
1529 HANDLE      WINAPI RegisterEventSourceA(LPCSTR,LPCSTR);
1530 HANDLE      WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR);
1531 #define     RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
1532 BOOL      WINAPI ReleaseMutex(HANDLE);
1533 BOOL      WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG);
1534 BOOL        WINAPI ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR *,LPVOID);
1535 BOOL        WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR *,LPVOID);
1536 #define     ReportEvent WINELIB_NAME_AW(ReportEvent)
1537 BOOL      WINAPI ResetEvent(HANDLE);
1538 DWORD       WINAPI ResumeThread(HANDLE);
1539 BOOL        WINAPI RevertToSelf(void);
1540 DWORD       WINAPI SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
1541 DWORD       WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
1542 #define     SearchPath WINELIB_NAME_AW(SearchPath)
1543 BOOL        WINAPI SetCommConfig(HANDLE,LPCOMMCONFIG);
1544 BOOL        WINAPI SetCommMask(HANDLE,DWORD);
1545 BOOL        WINAPI SetCommState(HANDLE,LPDCB);
1546 BOOL        WINAPI SetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
1547 BOOL      WINAPI SetComputerNameA(LPCSTR);
1548 BOOL      WINAPI SetComputerNameW(LPCWSTR);
1549 #define     SetComputerName WINELIB_NAME_AW(SetComputerName)
1550 BOOL      WINAPI SetConsoleMode(HANDLE,DWORD);
1551 BOOL      WINAPI SetConsoleTitleA(LPCSTR);
1552 BOOL      WINAPI SetConsoleTitleW(LPCWSTR);
1553 #define     SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle)
1554 BOOL        WINAPI SetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,DWORD);
1555 BOOL        WINAPI SetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,DWORD);
1556 #define     SetDefaultCommConfig WINELIB_NAME_AW(SetDefaultCommConfig)
1557 BOOL      WINAPI SetEndOfFile(HANDLE);
1558 BOOL      WINAPI SetEnvironmentVariableA(LPCSTR,LPCSTR);
1559 BOOL      WINAPI SetEnvironmentVariableW(LPCWSTR,LPCWSTR);
1560 #define     SetEnvironmentVariable WINELIB_NAME_AW(SetEnvironmentVariable)
1561 BOOL      WINAPI SetEvent(HANDLE);
1562 VOID        WINAPI SetFileApisToANSI(void);
1563 VOID        WINAPI SetFileApisToOEM(void);
1564 DWORD       WINAPI SetFilePointer(HANDLE,LONG,LPLONG,DWORD);
1565 BOOL        WINAPI SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1566 BOOL        WINAPI SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1567 #define     SetFileSecurity WINELIB_NAME_AW(SetFileSecurity)
1568 BOOL        WINAPI SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*);
1569 BOOL        WINAPI SetHandleInformation(HANDLE,DWORD,DWORD);
1570 BOOL        WINAPI SetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1571 BOOL        WINAPI SetPriorityClass(HANDLE,DWORD);
1572 BOOL        WINAPI SetLocalTime(const SYSTEMTIME*);
1573 BOOL        WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
1574 BOOL        WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID,BOOL);
1575 BOOL        WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID,BOOL);
1576 BOOL        WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
1577 BOOL      WINAPI SetStdHandle(DWORD,HANDLE);
1578 BOOL      WINAPI SetSystemPowerState(BOOL,BOOL);
1579 BOOL      WINAPI SetSystemTime(const SYSTEMTIME*);
1580 DWORD       WINAPI SetTapeParameters(HANDLE,DWORD,LPVOID);
1581 DWORD       WINAPI SetTapePosition(HANDLE,DWORD,DWORD,DWORD,DWORD,BOOL);
1582 DWORD       WINAPI SetThreadAffinityMask(HANDLE,DWORD);
1583 BOOL        WINAPI SetThreadContext(HANDLE,const CONTEXT *);
1584 BOOL        WINAPI SetThreadLocale(LCID);
1585 BOOL        WINAPI SetThreadPriority(HANDLE,INT);
1586 BOOL        WINAPI SetThreadPriorityBoost(HANDLE,BOOL);
1587 BOOL        WINAPI SetThreadToken(PHANDLE,HANDLE);
1588 BOOL        WINAPI SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION);
1589 BOOL        WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,BOOL);
1590 BOOL        WINAPI SetupComm(HANDLE,DWORD,DWORD);
1591 VOID        WINAPI Sleep(DWORD);
1592 DWORD       WINAPI SleepEx(DWORD,BOOL);
1593 DWORD       WINAPI SuspendThread(HANDLE);
1594 BOOL        WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
1595 DWORD       WINAPI TlsAlloc(void);
1596 BOOL        WINAPI TlsFree(DWORD);
1597 LPVOID      WINAPI TlsGetValue(DWORD);
1598 BOOL        WINAPI TlsSetValue(DWORD,LPVOID);
1599 BOOL        WINAPI TransmitCommChar(HANDLE,CHAR);
1600 BOOL        WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
1601 BOOL        WINAPI UnmapViewOfFile(LPVOID);
1602 LPVOID      WINAPI VirtualAlloc(LPVOID,DWORD,DWORD,DWORD);
1603 LPVOID      WINAPI VirtualAllocEx(HANDLE,LPVOID,DWORD,DWORD,DWORD);
1604 BOOL      WINAPI VirtualFree(LPVOID,DWORD,DWORD);
1605 BOOL      WINAPI VirtualLock(LPVOID,DWORD);
1606 BOOL      WINAPI VirtualProtect(LPVOID,DWORD,DWORD,LPDWORD);
1607 BOOL      WINAPI VirtualProtectEx(HANDLE,LPVOID,DWORD,DWORD,LPDWORD);
1608 DWORD       WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
1609 DWORD       WINAPI VirtualQueryEx(HANDLE,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
1610 BOOL      WINAPI VirtualUnlock(LPVOID,DWORD);
1611 BOOL      WINAPI WaitCommEvent(HANDLE,LPDWORD,LPOVERLAPPED);
1612 BOOL      WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
1613 DWORD       WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD);
1614 DWORD       WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,BOOL,DWORD,BOOL);
1615 DWORD       WINAPI WaitForSingleObject(HANDLE,DWORD);
1616 DWORD       WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL);
1617 BOOL      WINAPI WriteConsoleA(HANDLE,LPCVOID,DWORD,LPDWORD,LPVOID);
1618 BOOL      WINAPI WriteConsoleW(HANDLE,LPCVOID,DWORD,LPDWORD,LPVOID);
1619 #define     WriteConsole WINELIB_NAME_AW(WriteConsole)
1620 BOOL      WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
1621 BOOL        WINAPI WriteFileEx(HANDLE,LPCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
1622 DWORD       WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL);
1623 LANGID      WINAPI GetSystemDefaultLangID(void);
1624 LCID        WINAPI GetSystemDefaultLCID(void);
1625 LANGID      WINAPI GetUserDefaultLangID(void);
1626 LCID        WINAPI GetUserDefaultLCID(void);
1627 ATOM        WINAPI AddAtomA(LPCSTR);
1628 ATOM        WINAPI AddAtomW(LPCWSTR);
1629 #define     AddAtom WINELIB_NAME_AW(AddAtom)
1630 UINT      WINAPI CompareStringA(DWORD,DWORD,LPCSTR,DWORD,LPCSTR,DWORD);
1631 UINT      WINAPI CompareStringW(DWORD,DWORD,LPCWSTR,DWORD,LPCWSTR,DWORD);
1632 #define     CompareString WINELIB_NAME_AW(CompareString)
1633 BOOL      WINAPI CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES);
1634 BOOL      WINAPI CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES);
1635 #define     CreateDirectory WINELIB_NAME_AW(CreateDirectory)
1636 BOOL      WINAPI CreateDirectoryExA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES);
1637 BOOL      WINAPI CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
1638 #define     CreateDirectoryEx WINELIB_NAME_AW(CreateDirectoryEx)
1639 BOOL        WINAPI DefineDosDeviceA(DWORD,LPCSTR,LPCSTR);
1640 #define     DefineHandleTable(w) ((w),TRUE)
1641 ATOM        WINAPI DeleteAtom(ATOM);
1642 BOOL      WINAPI DeleteFileA(LPCSTR);
1643 BOOL      WINAPI DeleteFileW(LPCWSTR);
1644 #define     DeleteFile WINELIB_NAME_AW(DeleteFile)
1645 void        WINAPI FatalAppExitA(UINT,LPCSTR);
1646 void        WINAPI FatalAppExitW(UINT,LPCWSTR);
1647 #define     FatalAppExit WINELIB_NAME_AW(FatalAppExit)
1648 ATOM        WINAPI FindAtomA(LPCSTR);
1649 ATOM        WINAPI FindAtomW(LPCWSTR);
1650 #define     FindAtom WINELIB_NAME_AW(FindAtom)
1651 BOOL        WINAPI FindClose(HANDLE);
1652 HANDLE      WINAPI FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
1653 HANDLE      WINAPI FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW);
1654 #define     FindFirstFile WINELIB_NAME_AW(FindFirstFile)
1655 HANDLE      WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
1656 HANDLE      WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
1657 #define     FindFirstFileEx WINELIB_NAME_AW(FindFirstFileEx)
1658 BOOL        WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
1659 BOOL        WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
1660 #define     FindNextFile WINELIB_NAME_AW(FindNextFile)
1661 HRSRC     WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR);
1662 HRSRC     WINAPI FindResourceW(HMODULE,LPCWSTR,LPCWSTR);
1663 #define     FindResource WINELIB_NAME_AW(FindResource)
1664 BOOL        WINAPI FreeLibrary(HMODULE);
1665 #define     FreeModule(handle) FreeLibrary(handle)
1666 #define     FreeProcInstance(proc) /*nothing*/
1667 BOOL      WINAPI FreeResource(HGLOBAL);
1668 UINT      WINAPI GetAtomNameA(ATOM,LPSTR,INT);
1669 UINT      WINAPI GetAtomNameW(ATOM,LPWSTR,INT);
1670 #define     GetAtomName WINELIB_NAME_AW(GetAtomName)
1671 UINT      WINAPI GetCurrentDirectoryA(UINT,LPSTR);
1672 UINT      WINAPI GetCurrentDirectoryW(UINT,LPWSTR);
1673 #define     GetCurrentDirectory WINELIB_NAME_AW(GetCurrentDirectory)
1674 #define     GetCurrentTime() GetTickCount()
1675 BOOL      WINAPI GetDiskFreeSpaceA(LPCSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
1676 BOOL      WINAPI GetDiskFreeSpaceW(LPCWSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
1677 #define     GetDiskFreeSpace WINELIB_NAME_AW(GetDiskFreeSpace)
1678 BOOL      WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
1679 BOOL      WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
1680 #define     GetDiskFreeSpaceEx WINELIB_NAME_AW(GetDiskFreeSpaceEx)
1681 UINT      WINAPI GetDriveTypeA(LPCSTR);
1682 UINT      WINAPI GetDriveTypeW(LPCWSTR);
1683 #define     GetDriveType WINELIB_NAME_AW(GetDriveType)
1684 BOOL        WINAPI GetExitCodeProcess(HANDLE,LPDWORD);
1685 DWORD       WINAPI GetFileAttributesA(LPCSTR);
1686 DWORD       WINAPI GetFileAttributesW(LPCWSTR);
1687 #define     GetFileAttributes WINELIB_NAME_AW(GetFileAttributes)
1688 #define     GetFreeSpace(w) (0x100000L)
1689 UINT      WINAPI GetLogicalDriveStringsA(UINT,LPSTR);
1690 UINT      WINAPI GetLogicalDriveStringsW(UINT,LPWSTR);
1691 #define     GetLogicalDriveStrings WINELIB_NAME_AW(GetLogicalDriveStrings)
1692 DWORD       WINAPI GetModuleFileNameA(HMODULE,LPSTR,DWORD);
1693 DWORD       WINAPI GetModuleFileNameW(HMODULE,LPWSTR,DWORD);
1694 #define     GetModuleFileName WINELIB_NAME_AW(GetModuleFileName)
1695 HMODULE     WINAPI GetModuleHandleA(LPCSTR);
1696 HMODULE     WINAPI GetModuleHandleW(LPCWSTR);
1697 #define     GetModuleHandle WINELIB_NAME_AW(GetModuleHandle)
1698 BOOL        WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,BOOL);
1699 UINT        WINAPI GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR);
1700 UINT        WINAPI GetPrivateProfileIntW(LPCWSTR,LPCWSTR,INT,LPCWSTR);
1701 #define     GetPrivateProfileInt WINELIB_NAME_AW(GetPrivateProfileInt)
1702 INT         WINAPI GetPrivateProfileSectionA(LPCSTR,LPSTR,DWORD,LPCSTR);
1703 INT         WINAPI GetPrivateProfileSectionW(LPCWSTR,LPWSTR,DWORD,LPCWSTR);
1704 #define     GetPrivateProfileSection WINELIB_NAME_AW(GetPrivateProfileSection)
1705 DWORD       WINAPI GetPrivateProfileSectionNamesA(LPSTR,DWORD,LPCSTR);
1706 DWORD       WINAPI GetPrivateProfileSectionNamesW(LPWSTR,DWORD,LPCWSTR);
1707 #define     GetPrivateProfileSectionNames WINELIB_NAME_AW(GetPrivateProfileSectionNames)
1708 INT       WINAPI GetPrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT,LPCSTR);
1709 INT       WINAPI GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT,LPCWSTR);
1710 #define     GetPrivateProfileString WINELIB_NAME_AW(GetPrivateProfileString)
1711 BOOL      WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
1712 BOOL      WINAPI GetPrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);
1713 #define     GetPrivateProfileStruct WINELIB_NAME_AW(GetPrivateProfileStruct)
1714 FARPROC   WINAPI GetProcAddress(HMODULE,LPCSTR);
1715 UINT      WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT);
1716 UINT      WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT);
1717 #define     GetProfileInt WINELIB_NAME_AW(GetProfileInt)
1718 INT       WINAPI GetProfileSectionA(LPCSTR,LPSTR,DWORD);
1719 INT       WINAPI GetProfileSectionW(LPCWSTR,LPWSTR,DWORD);
1720 #define     GetProfileSection WINELIB_NAME_AW(GetProfileSection)
1721 INT       WINAPI GetProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT);
1722 INT       WINAPI GetProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT);
1723 #define     GetProfileString WINELIB_NAME_AW(GetProfileString)
1724 VOID        WINAPI GetStartupInfoA(LPSTARTUPINFOA);
1725 VOID        WINAPI GetStartupInfoW(LPSTARTUPINFOW);
1726 #define     GetStartupInfo WINELIB_NAME_AW(GetStartupInfo)
1727 BOOL        WINAPI GetStringTypeA(LCID,DWORD,LPCSTR,INT,LPWORD);
1728 BOOL        WINAPI GetStringTypeW(DWORD,LPCWSTR,INT,LPWORD);
1729 UINT        WINAPI GetSystemDirectoryA(LPSTR,UINT);
1730 UINT        WINAPI GetSystemDirectoryW(LPWSTR,UINT);
1731 #define     GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
1732 DWORD       WINAPI GetTickCount(void);
1733 UINT        WINAPI GetTempFileNameA(LPCSTR,LPCSTR,UINT,LPSTR);
1734 UINT        WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
1735 #define     GetTempFileName WINELIB_NAME_AW(GetTempFileName)
1736 UINT      WINAPI GetTempPathA(UINT,LPSTR);
1737 UINT      WINAPI GetTempPathW(UINT,LPWSTR);
1738 #define     GetTempPath WINELIB_NAME_AW(GetTempPath)
1739 LONG        WINAPI GetVersion(void);
1740 BOOL      WINAPI GetVolumeInformationA(LPCSTR,LPSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD);
1741 BOOL      WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR,DWORD);
1742 #define     GetVolumeInformation WINELIB_NAME_AW(GetVolumeInformation)
1743 UINT      WINAPI GetWindowsDirectoryA(LPSTR,UINT);
1744 UINT      WINAPI GetWindowsDirectoryW(LPWSTR,UINT);
1745 #define     GetWindowsDirectory WINELIB_NAME_AW(GetWindowsDirectory)
1746 ATOM        WINAPI GlobalAddAtomA(LPCSTR);
1747 ATOM        WINAPI GlobalAddAtomW(LPCWSTR);
1748 #define     GlobalAddAtom WINELIB_NAME_AW(GlobalAddAtom)
1749 HGLOBAL     WINAPI GlobalAlloc(UINT,DWORD);
1750 DWORD       WINAPI GlobalCompact(DWORD);
1751 ATOM        WINAPI GlobalDeleteAtom(ATOM);
1752 ATOM        WINAPI GlobalFindAtomA(LPCSTR);
1753 ATOM        WINAPI GlobalFindAtomW(LPCWSTR);
1754 #define     GlobalFindAtom WINELIB_NAME_AW(GlobalFindAtom)
1755 UINT        WINAPI GlobalFlags(HGLOBAL);
1756 HGLOBAL     WINAPI GlobalFree(HGLOBAL);
1757 UINT        WINAPI GlobalGetAtomNameA(ATOM,LPSTR,INT);
1758 UINT        WINAPI GlobalGetAtomNameW(ATOM,LPWSTR,INT);
1759 #define     GlobalGetAtomName WINELIB_NAME_AW(GlobalGetAtomName)
1760 HGLOBAL     WINAPI GlobalHandle(LPCVOID);
1761 VOID        WINAPI GlobalFix(HGLOBAL);
1762 LPVOID      WINAPI GlobalLock(HGLOBAL);
1763 HGLOBAL     WINAPI GlobalReAlloc(HGLOBAL,DWORD,UINT);
1764 DWORD       WINAPI GlobalSize(HGLOBAL);
1765 VOID        WINAPI GlobalUnfix(HGLOBAL);
1766 BOOL        WINAPI GlobalUnlock(HGLOBAL);
1767 BOOL        WINAPI GlobalUnWire(HGLOBAL);
1768 LPVOID      WINAPI GlobalWire(HGLOBAL);
1769 BOOL      WINAPI InitAtomTable(DWORD);
1770 BOOL      WINAPI IsBadCodePtr(FARPROC);
1771 BOOL      WINAPI IsBadHugeReadPtr(LPCVOID,UINT);
1772 BOOL      WINAPI IsBadHugeWritePtr(LPVOID,UINT);
1773 BOOL      WINAPI IsBadReadPtr(LPCVOID,UINT);
1774 BOOL      WINAPI IsBadStringPtrA(LPCSTR,UINT);
1775 BOOL      WINAPI IsBadStringPtrW(LPCWSTR,UINT);
1776 #define     IsBadStringPtr WINELIB_NAME_AW(IsBadStringPtr)
1777 BOOL        WINAPI IsBadWritePtr(LPVOID,UINT);
1778 BOOL        WINAPI IsDBCSLeadByte(BYTE);
1779 BOOL        WINAPI IsDebuggerPresent(void);
1780 HMODULE     WINAPI LoadLibraryA(LPCSTR);
1781 HMODULE     WINAPI LoadLibraryW(LPCWSTR);
1782 #define     LoadLibrary WINELIB_NAME_AW(LoadLibrary)
1783 HMODULE     WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD);
1784 HMODULE     WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);
1785 #define     LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx)
1786 HINSTANCE WINAPI LoadModule(LPCSTR,LPVOID);
1787 HGLOBAL   WINAPI LoadResource(HMODULE,HRSRC);
1788 HLOCAL    WINAPI LocalAlloc(UINT,DWORD);
1789 UINT      WINAPI LocalCompact(UINT);
1790 UINT      WINAPI LocalFlags(HLOCAL);
1791 HLOCAL    WINAPI LocalFree(HLOCAL);
1792 HLOCAL    WINAPI LocalHandle(LPCVOID);
1793 LPVOID      WINAPI LocalLock(HLOCAL);
1794 HLOCAL    WINAPI LocalReAlloc(HLOCAL,DWORD,UINT);
1795 UINT      WINAPI LocalShrink(HGLOBAL,UINT);
1796 UINT      WINAPI LocalSize(HLOCAL);
1797 BOOL      WINAPI LocalUnlock(HLOCAL);
1798 LPVOID      WINAPI LockResource(HGLOBAL);
1799 #define     LockSegment(handle) GlobalFix((HANDLE)(handle))
1800 #define     MakeProcInstance(proc,inst) (proc)
1801 HFILE       WINAPI OpenFile(LPCSTR,OFSTRUCT*,UINT);
1802 VOID        WINAPI OutputDebugStringA(LPCSTR);
1803 VOID        WINAPI OutputDebugStringW(LPCWSTR);
1804 #define     OutputDebugString WINELIB_NAME_AW(OutputDebugString)
1805 BOOL        WINAPI ReadProcessMemory(HANDLE, LPCVOID, LPVOID, DWORD, LPDWORD);
1806 BOOL        WINAPI RemoveDirectoryA(LPCSTR);
1807 BOOL        WINAPI RemoveDirectoryW(LPCWSTR);
1808 #define     RemoveDirectory WINELIB_NAME_AW(RemoveDirectory)
1809 BOOL      WINAPI SetCurrentDirectoryA(LPCSTR);
1810 BOOL      WINAPI SetCurrentDirectoryW(LPCWSTR);
1811 #define     SetCurrentDirectory WINELIB_NAME_AW(SetCurrentDirectory)
1812 UINT      WINAPI SetErrorMode(UINT);
1813 BOOL      WINAPI SetFileAttributesA(LPCSTR,DWORD);
1814 BOOL      WINAPI SetFileAttributesW(LPCWSTR,DWORD);
1815 #define     SetFileAttributes WINELIB_NAME_AW(SetFileAttributes)
1816 UINT      WINAPI SetHandleCount(UINT);
1817 #define     SetSwapAreaSize(w) (w)
1818 BOOL        WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);
1819 BOOL        WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
1820 #define     SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
1821 DWORD       WINAPI SizeofResource(HMODULE,HRSRC);
1822 BOOL        WINAPI UnlockFileEx(HFILE,DWORD,DWORD,DWORD,LPOVERLAPPED);
1823 #define     UnlockSegment(handle) GlobalUnfix((HANDLE)(handle))
1824 BOOL      WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
1825 BOOL      WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);
1826 #define     WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
1827 BOOL      WINAPI WritePrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
1828 BOOL      WINAPI WritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
1829 #define     WritePrivateProfileString WINELIB_NAME_AW(WritePrivateProfileString)
1830 BOOL         WINAPI WriteProfileSectionA(LPCSTR,LPCSTR);
1831 BOOL         WINAPI WriteProfileSectionW(LPCWSTR,LPCWSTR);
1832 #define     WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
1833 BOOL      WINAPI WritePrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
1834 BOOL      WINAPI WritePrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);
1835 #define     WritePrivateProfileStruct WINELIB_NAME_AW(WritePrivateProfileStruct)
1836 BOOL        WINAPI WriteProcessMemory(HANDLE, LPVOID, LPVOID, DWORD, LPDWORD);
1837 BOOL        WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);
1838 BOOL        WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);
1839 #define     WriteProfileString WINELIB_NAME_AW(WriteProfileString)
1840 #define     Yield32()
1841 LPSTR       WINAPI lstrcatA(LPSTR,LPCSTR);
1842 LPWSTR      WINAPI lstrcatW(LPWSTR,LPCWSTR);
1843 #define     lstrcat WINELIB_NAME_AW(lstrcat)
1844 LPSTR       WINAPI lstrcpyA(LPSTR,LPCSTR);
1845 LPWSTR      WINAPI lstrcpyW(LPWSTR,LPCWSTR);
1846 #define     lstrcpy WINELIB_NAME_AW(lstrcpy)
1847 LPSTR       WINAPI lstrcpynA(LPSTR,LPCSTR,INT);
1848 LPWSTR      WINAPI lstrcpynW(LPWSTR,LPCWSTR,INT);
1849 #define     lstrcpyn WINELIB_NAME_AW(lstrcpyn)
1850 INT       WINAPI lstrlenA(LPCSTR);
1851 INT       WINAPI lstrlenW(LPCWSTR);
1852 #define     lstrlen WINELIB_NAME_AW(lstrlen)
1853 HINSTANCE WINAPI WinExec(LPCSTR,UINT);
1854 LONG        WINAPI _hread(HFILE,LPVOID,LONG);
1855 LONG        WINAPI _hwrite(HFILE,LPCSTR,LONG);
1856 HFILE     WINAPI _lcreat(LPCSTR,INT);
1857 HFILE     WINAPI _lclose(HFILE);
1858 LONG        WINAPI _llseek(HFILE,LONG,INT);
1859 HFILE     WINAPI _lopen(LPCSTR,INT);
1860 UINT      WINAPI _lread(HFILE,LPVOID,UINT);
1861 UINT      WINAPI _lwrite(HFILE,LPCSTR,UINT);
1862 INT       WINAPI lstrcmpA(LPCSTR,LPCSTR);
1863 INT       WINAPI lstrcmpW(LPCWSTR,LPCWSTR);
1864 #define     lstrcmp WINELIB_NAME_AW(lstrcmp)
1865 INT       WINAPI lstrcmpiA(LPCSTR,LPCSTR);
1866 INT       WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
1867 #define     lstrcmpi WINELIB_NAME_AW(lstrcmpi)
1868
1869 /* compatibility macros */
1870 #define     FillMemory RtlFillMemory
1871 #define     MoveMemory RtlMoveMemory
1872 #define     ZeroMemory RtlZeroMemory
1873 #define     CopyMemory RtlCopyMemory
1874
1875 /* undocumented functions */
1876
1877 typedef struct tagSYSLEVEL
1878 {
1879     CRITICAL_SECTION crst;
1880     INT              level;
1881 } SYSLEVEL;
1882
1883 /* [GS]etProcessDword offsets */
1884 #define  GPD_APP_COMPAT_FLAGS    (-56)
1885 #define  GPD_LOAD_DONE_EVENT     (-52)
1886 #define  GPD_HINSTANCE16         (-48)
1887 #define  GPD_WINDOWS_VERSION     (-44)
1888 #define  GPD_THDB                (-40)
1889 #define  GPD_PDB                 (-36)
1890 #define  GPD_STARTF_SHELLDATA    (-32)
1891 #define  GPD_STARTF_HOTKEY       (-28)
1892 #define  GPD_STARTF_SHOWWINDOW   (-24)
1893 #define  GPD_STARTF_SIZE         (-20)
1894 #define  GPD_STARTF_POSITION     (-16)
1895 #define  GPD_STARTF_FLAGS        (-12)
1896 #define  GPD_PARENT              (- 8)
1897 #define  GPD_FLAGS               (- 4)
1898 #define  GPD_USERDATA            (  0)
1899
1900 void        WINAPI DisposeLZ32Handle(HANDLE);
1901 HANDLE      WINAPI DosFileHandleToWin32Handle(HFILE);
1902 DWORD       WINAPI GetProcessDword(DWORD,INT);
1903 VOID        WINAPI GetpWin16Lock(SYSLEVEL**);
1904 DWORD       WINAPI MapLS(LPCVOID);
1905 DWORD       WINAPI MapProcessHandle(HANDLE);
1906 LPVOID      WINAPI MapSL(DWORD);
1907 VOID        WINAPI ReleaseThunkLock(DWORD*);
1908 VOID        WINAPI RestoreThunkLock(DWORD);
1909 void        WINAPI SetProcessDword(DWORD,INT,DWORD);
1910 VOID        WINAPI UnMapLS(DWORD);
1911 HFILE       WINAPI Win32HandleToDosFileHandle(HANDLE);
1912 DWORD       WINAPI _ConfirmWin16Lock(void);
1913 DWORD       WINAPI _ConfirmSysLevel(SYSLEVEL*);
1914 VOID        WINAPI _EnterSysLevel(SYSLEVEL*);
1915 VOID        WINAPI _LeaveSysLevel(SYSLEVEL*);
1916
1917
1918 /* Wine internal functions */
1919
1920 BOOL        WINAPI wine_get_unix_file_name( LPCSTR dos, LPSTR buffer, DWORD len );
1921
1922
1923 /* a few optimizations for i386/gcc */
1924
1925 #if defined(__i386__) && defined(__GNUC__)
1926
1927 extern inline PVOID WINAPI InterlockedCompareExchange( PVOID *dest, PVOID xchg, PVOID compare );
1928 extern inline PVOID WINAPI InterlockedCompareExchange( PVOID *dest, PVOID xchg, PVOID compare )
1929 {
1930     PVOID ret;
1931     __asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
1932                           : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
1933     return ret;
1934 }
1935
1936 extern inline LONG WINAPI InterlockedExchange( PLONG dest, LONG val );
1937 extern inline LONG WINAPI InterlockedExchange( PLONG dest, LONG val )
1938 {
1939     LONG ret;
1940     __asm__ __volatile__( "lock; xchgl %0,(%1)"
1941                           : "=r" (ret) :"r" (dest), "0" (val) : "memory" );
1942     return ret;
1943 }
1944
1945 extern inline LONG WINAPI InterlockedExchangeAdd( PLONG dest, LONG incr );
1946 extern inline LONG WINAPI InterlockedExchangeAdd( PLONG dest, LONG incr )
1947 {
1948     LONG ret;
1949     __asm__ __volatile__( "lock; xaddl %0,(%1)"
1950                           : "=r" (ret) : "r" (dest), "0" (incr) : "memory" );
1951     return ret;
1952 }
1953
1954 extern inline LONG WINAPI InterlockedIncrement( PLONG dest );
1955 extern inline LONG WINAPI InterlockedIncrement( PLONG dest )
1956 {
1957     return InterlockedExchangeAdd( dest, 1 ) + 1;
1958 }
1959
1960 extern inline LONG WINAPI InterlockedDecrement( PLONG dest );
1961 extern inline LONG WINAPI InterlockedDecrement( PLONG dest )
1962 {
1963     return InterlockedExchangeAdd( dest, -1 ) - 1;
1964 }
1965
1966 extern inline DWORD WINAPI GetLastError(void);
1967 extern inline DWORD WINAPI GetLastError(void)
1968 {
1969     DWORD ret;
1970     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x60,%0" : "=r" (ret) );
1971     return ret;
1972 }
1973
1974 extern inline DWORD WINAPI GetCurrentProcessId(void);
1975 extern inline DWORD WINAPI GetCurrentProcessId(void)
1976 {
1977     DWORD ret;
1978     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x20,%0" : "=r" (ret) );
1979     return ret;
1980 }
1981
1982 extern inline DWORD WINAPI GetCurrentThreadId(void);
1983 extern inline DWORD WINAPI GetCurrentThreadId(void)
1984 {
1985     DWORD ret;
1986     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x24,%0" : "=r" (ret) );
1987     return ret;
1988 }
1989
1990 extern inline void WINAPI SetLastError( DWORD err );
1991 extern inline void WINAPI SetLastError( DWORD err )
1992 {
1993     __asm__ __volatile__( ".byte 0x64\n\tmovl %0,0x60" : : "r" (err) : "memory" );
1994 }
1995
1996 extern inline HANDLE WINAPI GetProcessHeap(void);
1997 extern inline HANDLE WINAPI GetProcessHeap(void)
1998 {
1999     HANDLE *pdb;
2000     __asm__ __volatile__( ".byte 0x64\n\tmovl 0x30,%0" : "=r" (pdb) );
2001     return pdb[0x18 / sizeof(HANDLE)];  /* get dword at offset 0x18 in pdb */
2002 }
2003
2004 #else  /* __i386__ && __GNUC__ */
2005 DWORD       WINAPI GetCurrentProcessId(void);
2006 DWORD       WINAPI GetCurrentThreadId(void);
2007 DWORD       WINAPI GetLastError(void);
2008 HANDLE      WINAPI GetProcessHeap(void);
2009 PVOID       WINAPI InterlockedCompareExchange(PVOID*,PVOID,PVOID);
2010 LONG        WINAPI InterlockedDecrement(PLONG);
2011 LONG        WINAPI InterlockedExchange(PLONG,LONG);
2012 LONG        WINAPI InterlockedExchangeAdd(PLONG,LONG);
2013 LONG        WINAPI InterlockedIncrement(PLONG);
2014 VOID        WINAPI SetLastError(DWORD);
2015 #endif  /* __i386__ && __GNUC__ */
2016
2017 #ifdef __WINE__
2018 #define GetCurrentProcess() ((HANDLE)0xffffffff)
2019 #define GetCurrentThread()  ((HANDLE)0xfffffffe)
2020 #endif
2021
2022 /* WinMain(entry point) must be declared in winbase.h. */
2023 /* If this is not declared, we cannot compile many sources written with C++. */
2024 int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int);
2025
2026 #ifdef __cplusplus
2027 }
2028 #endif
2029
2030 #endif  /* __WINE_WINBASE_H */