source: branches/swt/include/win/windef.h@ 22078

Last change on this file since 22078 was 22078, checked in by rousseau, 11 years ago

Added definitions for 'in', 'out' and friends

In Windows PSDK these are in 'specstrings.h'.
In Wine these are in 'imagehlp.h' and 'dbghelp.h'.
While 'imagehlp.h' exists in Odin32, it is not included by default,
so we'll put these in 'windef.h' for now.

File size: 24.2 KB
Line 
1/*
2 * Basic types definitions
3 *
4 * Copyright 1996 Alexandre Julliard
5 */
6
7#ifndef __WINE_WINDEF_H
8#define __WINE_WINDEF_H
9
10#if (defined(__WINE__)) && (!defined(__WIN32OS2__))
11# include "config.h"
12# undef UNICODE
13#endif /* __WINE__ */
14
15#ifdef __WIN32OS2__
16#if defined (__IBMC__) || (defined(__IBMCPP__) && (__IBMCPP__ < 400))
17#define CINTERFACE
18#endif
19#endif
20
21#define WINVER 0x0500
22
23#ifdef UNICODE
24#include <wchar.h>
25#endif
26
27#include <basetsd.h>
28
29///-------------------------------------------------------------------[swt-os2]
30/// In Windows PSDK these are in 'specstrings.h'.
31/// In Wine these are in 'imagehlp.h' and 'dbghelp.h'.
32/// While 'imagehlp.h' exists in Odin32, it is not included by default.
33/// So, we'll put these here for now.
34/* A set of documentation macros (see also dbghelp.h) */
35#ifndef __deref_out
36# define __deref_out
37#endif
38#ifndef __deref_out_opt
39# define __deref_out_opt
40#endif
41#ifndef __deref_opt_out
42# define __deref_opt_out
43#endif
44#ifndef __in
45# define __in
46#endif
47#ifndef __in_opt
48# define __in_opt
49#endif
50#ifndef __in_bcount
51# define __in_bcount(x)
52#endif
53#ifndef __in_bcount_opt
54# define __in_bcount_opt(x)
55#endif
56#ifndef __in_ecount
57# define __in_ecount(x)
58#endif
59#ifndef __inout
60# define __inout
61#endif
62#ifndef __inout_opt
63# define __inout_opt
64#endif
65#ifndef __inout_bcount
66# define __inout_bcount(x)
67#endif
68#ifndef __inout_ecount
69# define __inout_ecount(x)
70#endif
71#ifndef __out
72# define __out
73#endif
74#ifndef __out_opt
75# define __out_opt
76#endif
77#ifndef __out_bcount
78# define __out_bcount(x)
79#endif
80#ifndef __out_bcount_opt
81# define __out_bcount_opt(x)
82#endif
83#ifndef __out_ecount
84# define __out_ecount(x)
85#endif
86#ifndef __out_ecount_opt
87# define __out_ecount_opt(x)
88#endif
89#ifndef __out_xcount
90# define __out_xcount(x)
91#endif
92///----------------------------------------------------------------------------
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97
98/* Misc. constants. */
99
100#ifdef FALSE
101#undef FALSE
102#endif
103#define FALSE 0
104
105#ifdef TRUE
106#undef TRUE
107#endif
108#define TRUE 1
109
110#ifdef NULL
111#undef NULL
112#endif
113#define NULL 0
114
115/* Macros to map Winelib names to the correct implementation name */
116/* depending on __WINE__ and UNICODE macros. */
117/* Note that Winelib is purely Win32. */
118
119#ifdef __WINE__
120#ifdef __WIN32OS2__
121# define WINELIB_NAME_AW(func) func
122#else
123# define WINELIB_NAME_AW(func) this_is_a_syntax_error this_is_a_syntax_error
124#endif
125#else /* __WINE__ */
126# ifdef UNICODE
127# define WINELIB_NAME_AW(func) func##W
128# else
129# define WINELIB_NAME_AW(func) func##A
130# endif /* UNICODE */
131#endif /* __WINE__ */
132
133#ifdef __WINE__
134# define DECL_WINELIB_TYPE_AW(type) /* nothing */
135#else /* __WINE__ */
136# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
137#endif /* __WINE__ */
138
139
140/* Calling conventions definitions */
141
142#ifndef __WIN32OS2__
143#ifdef __i386__
144# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
145# define __stdcall __attribute__((__stdcall__))
146# define __cdecl __attribute__((__cdecl__))
147# define __RESTORE_ES __asm__ __volatile__("pushl %ds\n\tpopl %es")
148# else
149# error You need gcc >= 2.7 to build Wine on a 386
150# endif /* __GNUC__ */
151#else /* __i386__ */
152# define __stdcall
153# define __cdecl
154# define __RESTORE_ES
155#endif /* __i386__ */
156#endif
157
158
159#ifdef __WIN32OS2__
160#include <odin.h>
161#if defined(__GNUC__)
162extern int _argcA;
163extern char **_argvA;
164#define __argcA _argcA
165#define __argvA _argvA
166#else
167extern int __argcA;
168extern char **__argvA;
169#endif
170#endif
171
172/* define needed macros as required */
173#ifndef CALLBACK
174 #define CALLBACK __stdcall
175#endif
176
177#ifndef WINAPI
178 #define WINAPI __stdcall
179#endif
180
181#ifndef APIPRIVATE
182 #define APIPRIVATE __stdcall
183#endif
184
185#ifndef PASCAL
186 #define PASCAL __stdcall
187#endif
188
189#ifndef pascal
190 #define pascal __stdcall
191#endif
192
193#ifndef _pascal
194 #define _pascal __stdcall
195#endif
196
197#ifndef _stdcall
198 #define _stdcall __stdcall
199#endif
200
201#ifndef _fastcall
202 #define _fastcall __stdcall
203#endif
204
205#ifndef __export
206 #define __export
207#endif
208
209#ifndef CDECL
210 #define CDECL __cdecl
211#endif
212
213#ifndef _CDECL
214 #define _CDECL __cdecl
215#endif
216
217#ifndef cdecl
218 #define cdecl __cdecl
219#endif
220
221#ifndef _cdecl
222 #define _cdecl __cdecl
223#endif
224
225#ifndef WINAPIV
226 #define WINAPIV __cdecl
227#endif
228
229#ifndef APIENTRY
230 #define APIENTRY WINAPI
231#endif
232
233#ifndef WIN32API
234 #define WIN32API WINAPI
235#endif
236
237#ifndef __EMX__
238#if (__IBMC__ < 400) && (__IBMCPP__ < 360)
239#ifndef __declspec
240 #define __declspec(x)
241#endif
242
243#ifndef dllimport
244 #define dllimport
245#endif
246
247#ifndef dllexport
248 #define dllexport
249#endif
250#endif // (__IBMC__ < 400) && (__IBMCPP__ < 360)
251#endif // __EMX__
252
253#ifndef CONST
254 #define CONST const
255#endif
256
257/* Anonymous union/struct handling */
258
259#ifndef NONAMELESSSTRUCT
260#define DUMMYSTRUCTNAME
261#define DUMMYSTRUCTNAME1
262#define DUMMYSTRUCTNAME2
263#define DUMMYSTRUCTNAME3
264#define DUMMYSTRUCTNAME4
265#define DUMMYSTRUCTNAME5
266#define DUMMYSTRUCTNAME_DOT
267#define DUMMYSTRUCTNAME1_DOT
268#define DUMMYSTRUCTNAME2_DOT
269#define DUMMYSTRUCTNAME3_DOT
270#define DUMMYSTRUCTNAME4_DOT
271#define DUMMYSTRUCTNAME5_DOT
272#else /* !defined(NONAMELESSSTRUCT) */
273#define DUMMYSTRUCTNAME s
274#define DUMMYSTRUCTNAME1 s1
275#define DUMMYSTRUCTNAME2 s2
276#define DUMMYSTRUCTNAME3 s3
277#define DUMMYSTRUCTNAME4 s4
278#define DUMMYSTRUCTNAME5 s5
279#define DUMMYSTRUCTNAME_DOT s.
280#define DUMMYSTRUCTNAME1_DOT s1.
281#define DUMMYSTRUCTNAME2_DOT s2.
282#define DUMMYSTRUCTNAME3_DOT s3.
283#define DUMMYSTRUCTNAME4_DOT s4.
284#define DUMMYSTRUCTNAME5_DOT s5.
285#endif /* !defined(NONAMELESSSTRUCT) */
286
287#ifndef NONAMELESSUNION
288#define DUMMYUNIONNAME
289#define DUMMYUNIONNAME1
290#define DUMMYUNIONNAME2
291#define DUMMYUNIONNAME3
292#define DUMMYUNIONNAME4
293#define DUMMYUNIONNAME5
294#define DUMMYUNIONNAME6
295#define DUMMYUNIONNAME7
296#define DUMMYUNIONNAME8
297#define DUMMYUNIONNAME_DOT
298#define DUMMYUNIONNAME1_DOT
299#define DUMMYUNIONNAME2_DOT
300#define DUMMYUNIONNAME3_DOT
301#define DUMMYUNIONNAME4_DOT
302#define DUMMYUNIONNAME5_DOT
303#define DUMMYUNIONNAME6_DOT
304#define DUMMYUNIONNAME7_DOT
305#define DUMMYUNIONNAME8_DOT
306#else /* !defined(NONAMELESSUNION) */
307#define DUMMYUNIONNAME u
308#define DUMMYUNIONNAME1 u1
309#define DUMMYUNIONNAME2 u2
310#define DUMMYUNIONNAME3 u3
311#define DUMMYUNIONNAME4 u4
312#define DUMMYUNIONNAME5 u5
313#define DUMMYUNIONNAME6 u6
314#define DUMMYUNIONNAME7 u7
315#define DUMMYUNIONNAME8 u8
316#define DUMMYUNIONNAME_DOT u.
317#define DUMMYUNIONNAME1_DOT u1.
318#define DUMMYUNIONNAME2_DOT u2.
319#define DUMMYUNIONNAME3_DOT u3.
320#define DUMMYUNIONNAME4_DOT u4.
321#define DUMMYUNIONNAME5_DOT u5.
322#define DUMMYUNIONNAME6_DOT u6.
323#define DUMMYUNIONNAME7_DOT u7.
324#define DUMMYUNIONNAME8_DOT u8.
325#endif /* !defined(NONAMELESSUNION) */
326
327
328/* Standard data types. These are the same for emulator and library. */
329
330#if defined(__GNUC__) && defined(__cplusplus)
331/* prototypes like foo(VOID) don't work with typedef */
332#define VOID void
333#else
334typedef void VOID;
335#endif
336typedef int INT;
337typedef unsigned int UINT;
338typedef unsigned short WORD;
339typedef unsigned long DWORD;
340typedef unsigned long ULONG;
341typedef unsigned char BYTE;
342typedef long LONG;
343typedef short SHORT;
344typedef unsigned short USHORT;
345typedef char CHAR;
346typedef unsigned char UCHAR;
347/* Some systems might have wchar_t, but we really need 16 bit characters */
348#ifdef UNICODE
349typedef wchar_t WCHAR;
350#else
351typedef unsigned short WCHAR;
352#endif
353typedef unsigned short BOOL16;
354#ifdef __FORCE_BOOL_AS_INT__
355typedef int BOOL;
356#else
357typedef unsigned long BOOL;
358#endif
359typedef double DATE;
360typedef double DOUBLE;
361#if (__IBMC__ < 360) && (__IBMCPP__ < 360) && !defined (__EMX__)
362typedef double LONGLONG;
363typedef double ULONGLONG;
364typedef double ULONGULONG;
365typedef double DWORDLONG;
366#elif defined (__EMX__)
367#ifndef _INT64_T_DECLARED
368typedef long long int64_t; /* LONGLONG */
369typedef unsigned long long u_int64_t; /* LONGLONG */
370#endif
371#ifndef _UINT64_T_DECLARED
372typedef unsigned long long uint64_t; /* LONGLONG */
373#endif
374typedef int64_t LONGLONG;
375typedef uint64_t ULONGLONG;
376typedef uint64_t ULONGULONG;
377typedef uint64_t DWORDLONG;
378#else
379#include <inttypes.h>
380typedef int64_t LONGLONG;
381typedef uint64_t ULONGLONG;
382typedef uint64_t ULONGULONG;
383typedef uint64_t DWORDLONG;
384#endif
385
386/* FIXME: Wine does not compile with strict on, therefore strict
387 * handles are presently only usable on machines where sizeof(UINT) ==
388 * sizeof(void*). HANDLEs are supposed to be void* but a large amount
389 * of WINE code operates on HANDLES as if they are UINTs. So to WINE
390 * they exist as UINTs but to the Winelib user who turns on strict,
391 * they exist as void*. If there is a size difference between UINT and
392 * void* then things get ugly. */
393#ifdef STRICT
394typedef UINT16 HANDLE16;
395typedef VOID* HANDLE;
396#else
397typedef UINT16 HANDLE16;
398typedef ULONG HANDLE;
399#endif
400
401typedef HANDLE16 *LPHANDLE16;
402typedef HANDLE *LPHANDLE;
403typedef HANDLE GLOBALHANDLE;
404typedef HANDLE LOCALHANDLE;
405
406/* Integer types. These are the same for emulator and library. */
407typedef UINT16 WPARAM16;
408typedef UINT WPARAM;
409typedef LONG LPARAM;
410typedef LONG HRESULT;
411typedef LONG LRESULT;
412typedef WORD ATOM;
413typedef WORD CATCHBUF[9];
414typedef WORD *LPCATCHBUF;
415typedef DWORD REGSAM;
416typedef HANDLE HHOOK;
417typedef HANDLE HKEY;
418typedef HANDLE HMONITOR;
419typedef DWORD LCID;
420typedef WORD LANGID;
421typedef DWORD LCTYPE;
422typedef float FLOAT;
423
424/* Pointers types. These are the same for emulator and library. */
425/* winnt types */
426typedef VOID *PVOID;
427typedef const void *PCVOID;
428typedef CHAR *PCHAR;
429typedef UCHAR *PUCHAR;
430typedef BYTE *PBYTE;
431typedef USHORT *PUSHORT;
432typedef SHORT *PSHORT;
433typedef ULONG *PULONG;
434typedef LONG *PLONG;
435typedef DWORD *PDWORD;
436/* common win32 types */
437#ifdef __WINE__
438typedef CHAR *LPTSTR;
439typedef const CHAR *LPCTSTR;
440#endif
441typedef CHAR *LPSTR;
442typedef CHAR *PSTR;
443typedef const CHAR *LPCSTR;
444typedef const CHAR *PCSTR;
445typedef WCHAR *LPWSTR;
446typedef WCHAR *PWSTR;
447typedef const WCHAR *LPCWSTR;
448typedef const WCHAR *PCWSTR;
449typedef BYTE *LPBYTE;
450typedef WORD *LPWORD;
451typedef DWORD *LPDWORD;
452typedef LONG *LPLONG;
453typedef VOID *LPVOID;
454typedef const VOID *LPCVOID;
455typedef INT16 *LPINT16;
456typedef UINT16 *LPUINT16;
457typedef INT *PINT;
458typedef INT *LPINT;
459typedef UINT *PUINT;
460typedef UINT *LPUINT;
461typedef HKEY *LPHKEY;
462typedef HKEY *PHKEY;
463typedef FLOAT *PFLOAT;
464typedef FLOAT *LPFLOAT;
465typedef BOOL *PBOOL;
466typedef BOOL *LPBOOL;
467
468/* Special case: a segmented pointer is just a pointer in the user's code. */
469
470#ifdef __WINE__
471typedef DWORD SEGPTR;
472#else
473typedef void* SEGPTR;
474#endif /* __WINE__ */
475
476/* Handle types that exist both in Win16 and Win32. */
477
478#ifdef STRICT
479#define DECLARE_HANDLE(a) \
480 typedef HANDLE16 a##16; \
481 typedef a##16 *P##a##16; \
482 typedef a##16 *NP##a##16; \
483 typedef a##16 *LP##a##16; \
484 typedef struct a##__ { int unused; } *a; \
485 typedef a *P##a; \
486 typedef a *LP##a
487#else /*STRICT*/
488#define DECLARE_HANDLE(a) \
489 typedef HANDLE16 a##16; \
490 typedef a##16 *P##a##16; \
491 typedef a##16 *NP##a##16; \
492 typedef a##16 *LP##a##16; \
493 typedef HANDLE a; \
494 typedef a *P##a; \
495 typedef a *LP##a
496#endif /*STRICT*/
497
498DECLARE_HANDLE(HACMDRIVERID);
499DECLARE_HANDLE(HACMDRIVER);
500DECLARE_HANDLE(HACMOBJ);
501DECLARE_HANDLE(HACMSTREAM);
502DECLARE_HANDLE(HMETAFILEPICT);
503
504typedef int HFILE;
505typedef HANDLE16 HFILE16;
506
507DECLARE_HANDLE(HACCEL);
508DECLARE_HANDLE(HBITMAP);
509DECLARE_HANDLE(HBRUSH);
510DECLARE_HANDLE(HCOLORSPACE);
511DECLARE_HANDLE(HDC);
512DECLARE_HANDLE(HGLRC); // OpenGL
513DECLARE_HANDLE(HDROP);
514DECLARE_HANDLE(HDRVR);
515DECLARE_HANDLE(HDWP);
516DECLARE_HANDLE(HENHMETAFILE);
517DECLARE_HANDLE(HFONT);
518DECLARE_HANDLE(HICON);
519DECLARE_HANDLE(HINSTANCE);
520DECLARE_HANDLE(HMENU);
521DECLARE_HANDLE(HMETAFILE);
522DECLARE_HANDLE(HMIDI);
523DECLARE_HANDLE(HMIDIIN);
524DECLARE_HANDLE(HMIDIOUT);
525DECLARE_HANDLE(HMIDISTRM);
526DECLARE_HANDLE(HMIXER);
527DECLARE_HANDLE(HMIXEROBJ);
528DECLARE_HANDLE(HMMIO);
529DECLARE_HANDLE(HPALETTE);
530DECLARE_HANDLE(HPEN);
531DECLARE_HANDLE(HQUEUE);
532DECLARE_HANDLE(HRGN);
533DECLARE_HANDLE(HRSRC);
534DECLARE_HANDLE(HTASK);
535DECLARE_HANDLE(HWAVE);
536DECLARE_HANDLE(HWAVEIN);
537DECLARE_HANDLE(HWAVEOUT);
538DECLARE_HANDLE(HWINSTA);
539DECLARE_HANDLE(HDESK);
540DECLARE_HANDLE(HWND);
541DECLARE_HANDLE(HKL);
542DECLARE_HANDLE(HIC);
543DECLARE_HANDLE(HRASCONN);
544DECLARE_HANDLE(HPRINTER);
545
546/* HICONs & HCURSORs are polymorphic */
547typedef HICON HCURSOR;
548typedef HICON16 HCURSOR16;
549
550/* Handle types that must remain interchangeable even with strict on */
551
552typedef HINSTANCE16 HMODULE16;
553typedef HINSTANCE HMODULE;
554typedef HANDLE16 HGDIOBJ16;
555typedef HANDLE16 HGLOBAL16;
556typedef HANDLE16 HLOCAL16;
557typedef HANDLE HGDIOBJ;
558typedef HANDLE HGLOBAL;
559typedef HANDLE HLOCAL;
560
561/* Callback function pointers types */
562
563#ifdef __IBMC__
564typedef BOOL16 (* CALLBACK DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
565typedef BOOL (* CALLBACK DLGPROC)(HWND,UINT,WPARAM,LPARAM);
566typedef LRESULT (* CALLBACK DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
567typedef LRESULT (* CALLBACK DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
568typedef INT16 (* CALLBACK EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
569typedef INT (* CALLBACK EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
570typedef INT (* CALLBACK EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
571DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
572typedef LRESULT (* CALLBACK FARPROC16)();
573typedef LRESULT (* CALLBACK FARPROC)();
574typedef INT16 (* CALLBACK PROC16)();
575typedef INT (* CALLBACK PROC)();
576typedef INT16 (* CALLBACK GOBJENUMPROC16)(SEGPTR,LPARAM);
577typedef INT (* CALLBACK GOBJENUMPROC)(LPVOID,LPARAM);
578typedef BOOL16 (* CALLBACK GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
579typedef BOOL (* CALLBACK GRAYSTRINGPROC)(HDC,LPARAM,INT);
580typedef LRESULT (* CALLBACK HOOKPROC16)(INT16,WPARAM16,LPARAM);
581typedef LRESULT (* CALLBACK HOOKPROC)(INT,WPARAM,LPARAM);
582typedef VOID (* CALLBACK LINEDDAPROC16)(INT16,INT16,LPARAM);
583typedef VOID (* CALLBACK LINEDDAPROC)(INT,INT,LPARAM);
584typedef BOOL16 (* CALLBACK PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
585typedef BOOL (* CALLBACK PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
586typedef BOOL (* CALLBACK PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
587DECL_WINELIB_TYPE_AW(PROPENUMPROC)
588typedef BOOL (* CALLBACK PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
589typedef BOOL (* CALLBACK PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
590DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
591typedef VOID (* CALLBACK TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
592typedef VOID (* CALLBACK TIMERPROC)(HWND,UINT,UINT,DWORD);
593typedef LRESULT (* CALLBACK WNDENUMPROC16)(HWND16,LPARAM);
594//typedef LRESULT (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
595typedef BOOL (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
596typedef LRESULT (* CALLBACK WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
597typedef LRESULT (* CALLBACK WNDPROC)(HWND,UINT,WPARAM,LPARAM);
598#else
599typedef BOOL16 ( CALLBACK * DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
600typedef BOOL ( CALLBACK * DLGPROC)(HWND,UINT,WPARAM,LPARAM);
601typedef LRESULT ( CALLBACK * DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
602typedef LRESULT ( CALLBACK * DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
603typedef INT16 ( CALLBACK * EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
604typedef INT ( CALLBACK * EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
605typedef INT ( CALLBACK * EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
606DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
607typedef LRESULT ( CALLBACK * FARPROC16)();
608typedef LRESULT ( CALLBACK * FARPROC)();
609typedef INT16 ( CALLBACK * PROC16)();
610typedef INT ( CALLBACK * PROC)();
611typedef INT16 ( CALLBACK * GOBJENUMPROC16)(SEGPTR,LPARAM);
612typedef INT ( CALLBACK * GOBJENUMPROC)(LPVOID,LPARAM);
613typedef BOOL16 ( CALLBACK * GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
614typedef BOOL ( CALLBACK * GRAYSTRINGPROC)(HDC,LPARAM,INT);
615typedef LRESULT ( CALLBACK * HOOKPROC16)(INT16,WPARAM16,LPARAM);
616typedef LRESULT ( CALLBACK * HOOKPROC)(INT,WPARAM,LPARAM);
617typedef VOID ( CALLBACK * LINEDDAPROC16)(INT16,INT16,LPARAM);
618typedef VOID ( CALLBACK * LINEDDAPROC)(INT,INT,LPARAM);
619typedef BOOL16 ( CALLBACK * PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
620typedef BOOL ( CALLBACK * PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
621typedef BOOL ( CALLBACK * PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
622DECL_WINELIB_TYPE_AW(PROPENUMPROC)
623typedef BOOL ( CALLBACK * PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
624typedef BOOL ( CALLBACK * PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
625DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
626typedef VOID ( CALLBACK * TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
627typedef VOID ( CALLBACK * TIMERPROC)(HWND,UINT,UINT,DWORD);
628typedef LRESULT ( CALLBACK * WNDENUMPROC16)(HWND16,LPARAM);
629typedef BOOL ( CALLBACK * WNDENUMPROC)(HWND,LPARAM);
630typedef LRESULT ( CALLBACK * WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
631typedef LRESULT ( CALLBACK * WNDPROC)(HWND,UINT,WPARAM,LPARAM);
632#endif
633
634/* TCHAR data types definitions for Winelib. */
635/* These types are _not_ defined for the emulator, because they */
636/* depend on the UNICODE macro that only exists in user's code. */
637
638#if !defined(__WINE__) && !defined(_TCHAR_DEFINED)
639#define _TCHAR_DEFINED
640# ifdef UNICODE
641typedef WCHAR TCHAR, *PTCHAR;
642typedef LPWSTR LPTSTR, PTSTR;
643typedef LPCWSTR LPCTSTR, PCTSTR;
644#define __TEXT(string) L##string /*probably wrong */
645# else /* UNICODE */
646typedef CHAR TCHAR, *PTCHAR;
647typedef LPSTR LPTSTR, PTSTR;
648typedef LPCSTR LPCTSTR, PCTSTR;
649#define __TEXT(string) string
650# endif /* UNICODE */
651#endif /* __WINE__ */
652#define TEXT(quote) __TEXT(quote)
653
654/* Data types specific to the library. These do _not_ exist in the emulator. */
655
656
657
658/* Define some empty macros for compatibility with Windows code. */
659
660#ifndef __WINE__
661#define NEAR
662#define FAR
663#define near
664#define far
665#define _near
666#define _far
667#define IN
668#define OUT
669#define OPTIONAL
670#endif /* __WINE__ */
671
672/* Macro for structure packing. */
673
674#ifdef __GNUC__
675#define WINE_PACKED __attribute__ ((packed))
676#define WINE_UNUSED __attribute__ ((unused))
677#else
678#define WINE_PACKED /* nothing */
679#define WINE_UNUSED /* nothing */
680#endif
681
682/* Macros to split words and longs. */
683
684#define LOBYTE(w) ((BYTE)(WORD)(w))
685#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
686
687#define LOWORD(l) ((WORD)(DWORD)(l))
688#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
689
690#define SLOWORD(l) ((INT16)(LONG)(l))
691#define SHIWORD(l) ((INT16)((LONG)(l) >> 16))
692
693#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
694#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
695#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
696#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high))
697#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high))
698#define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0))
699
700#define SELECTOROF(ptr) (HIWORD(ptr))
701#define OFFSETOF(ptr) (LOWORD(ptr))
702
703/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
704/* Note: These macros are semantically broken, at least for wrc. wrc
705 spits out data in the platform's current binary format, *not* in
706 little-endian format. These macros are used throughout the resource
707 code to load and store data to the resources. Since it is unlikely
708 that we'll ever be dealing with little-endian resource data, the
709 byte-swapping nature of these macros has been disabled. Rather than
710 remove the use of these macros from the resource loading code, the
711 macros have simply been disabled. In the future, someone may want
712 to reactivate these macros for other purposes. In that case, the
713 resource code will have to be modified to use different macros. */
714
715#if 1
716#define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w))
717#define GET_WORD(ptr) (*(WORD *)(ptr))
718#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
719#define GET_DWORD(ptr) (*(DWORD *)(ptr))
720#else
721#define PUT_WORD(ptr,w) (*(BYTE *)(ptr) = LOBYTE(w), \
722 *((BYTE *)(ptr) + 1) = HIBYTE(w))
723#define GET_WORD(ptr) ((WORD)(*(BYTE *)(ptr) | \
724 (WORD)(*((BYTE *)(ptr)+1) << 8)))
725#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
726 PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
727#define GET_DWORD(ptr) ((DWORD)(GET_WORD(ptr) | \
728 ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
729#endif /* 1 */
730
731/* MIN and MAX macros */
732
733#ifdef MAX
734#undef MAX
735#endif
736#define MAX(a,b) (((a) > (b)) ? (a) : (b))
737
738#ifdef MIN
739#undef MIN
740#endif
741#define MIN(a,b) (((a) < (b)) ? (a) : (b))
742
743#ifdef __max /* watcom stdlib.h defines this */
744#undef __max
745#endif
746#define __max(a,b) MAX(a,b)
747
748#ifdef __min /* watcom stdlib.h defines this */
749#undef __min
750#endif
751#define __min(a,b) MIN(a,b)
752#ifndef RC_INVOKED
753#include <stdlib.h>
754#endif
755
756#if !defined(__WATCOMC__) || !defined(_MAX_PATH)
757#define _MAX_PATH 260
758#endif
759#define MAX_PATH 260
760#define _MAX_DRIVE 3
761#if !defined(__WATCOMC__) && !defined(_MAX_DIR)
762#define _MAX_DIR 256
763#endif
764#if !defined(__WIN32OS2__) && !defined(_MAX_FNAME)
765#define _MAX_FNAME 255
766#endif
767#if !defined(__WATCOMC__) && !defined(_MAX_EXT)
768#define _MAX_EXT 256
769#endif
770
771#define HFILE_ERROR16 ((HFILE16)-1)
772#define HFILE_ERROR ((HFILE)-1)
773
774/* Winelib run-time flag */
775
776#ifdef __WINE__
777extern int __winelib;
778#endif /* __WINE__ */
779
780/* The SIZE structure */
781
782typedef struct
783{
784 INT16 cx;
785 INT16 cy;
786} SIZE16, *PSIZE16, *LPSIZE16;
787
788typedef struct tagSIZE
789{
790 INT cx;
791 INT cy;
792} SIZE, *PSIZE, *LPSIZE;
793
794
795typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
796
797#define CONV_SIZE16TO32(s16,s32) \
798 ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
799#define CONV_SIZE32TO16(s32,s16) \
800 ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
801
802/* The POINT structure */
803
804typedef struct
805{
806 INT16 x;
807 INT16 y;
808} POINT16, *PPOINT16, *LPPOINT16;
809
810typedef struct tagPOINT
811{
812 LONG x;
813 LONG y;
814} POINT, *PPOINT, *LPPOINT;
815
816typedef struct _POINTL
817{
818 LONG x;
819 LONG y;
820} POINTL;
821
822#define CONV_POINT16TO32(p16,p32) \
823 ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
824#define CONV_POINT32TO16(p32,p16) \
825 ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
826
827#define MAKEPOINT(l) (*((POINT *)&(l)))
828
829#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
830
831/* The POINTS structure */
832
833typedef struct tagPOINTS
834{
835 SHORT x;
836 SHORT y;
837} POINTS, *PPOINTS, *LPPOINTS;
838
839
840#define MAKEPOINTS(l) (*((POINTS *)&(l)))
841
842
843/* The RECT structure */
844
845typedef struct
846{
847 INT16 left;
848 INT16 top;
849 INT16 right;
850 INT16 bottom;
851} RECT16, *LPRECT16;
852
853typedef struct tagRECT
854{
855 INT left;
856 INT top;
857 INT right;
858 INT bottom;
859} RECT, *PRECT, *LPRECT;
860typedef const RECT *LPCRECT;
861
862
863typedef struct tagRECTL
864{
865 LONG left;
866 LONG top;
867 LONG right;
868 LONG bottom;
869} RECTL, *PRECTL, *LPRECTL;
870
871typedef const RECTL *LPCRECTL;
872
873/*
874 * 8.9.99 DJR DECIMAL support
875 */
876typedef struct tagDEC
877{
878 USHORT wReserved;
879 union
880 {
881 struct
882 {
883 BYTE scale;
884 BYTE sign;
885 } a;
886 USHORT signscale;
887 } b;
888 ULONG Hi32;
889 union
890 {
891 struct
892 {
893 ULONG Lo32;
894 ULONG Mid32;
895 } c;
896 ULONGLONG Lo64;
897 } d;
898} DECIMAL;
899typedef DECIMAL *LPDECIMAL;
900
901#include <winbase.h>
902
903#ifdef __cplusplus
904}
905#endif
906
907#endif /* __WINE_WINDEF_H */
Note: See TracBrowser for help on using the repository browser.