source: trunk/include/win/windef.h@ 9367

Last change on this file since 9367 was 9367, checked in by sandervl, 23 years ago

header updates

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