Display the config file location in the incorrect config file error
[wine.git] / include / windef.h
blob7de33ea31309e3038148220cf0801f64dea1fb4a
1 /*
2 * Basic types definitions
4 * Copyright 1996 Alexandre Julliard
5 */
7 #ifndef __WINE_WINDEF_H
8 #define __WINE_WINDEF_H
10 #ifdef __WINE__
11 # undef UNICODE
12 #endif /* __WINE__ */
14 #define WINVER 0x0500
16 #include "winnt.h"
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
24 /* Macros to map Winelib names to the correct implementation name */
25 /* depending on __WINE__ and UNICODE macros. */
26 /* Note that Winelib is purely Win32. */
28 #ifdef __WINE__
29 # define WINELIB_NAME_AW(func) \
30 func##_must_be_suffixed_with_W_or_A_in_this_context \
31 func##_must_be_suffixed_with_W_or_A_in_this_context
32 #else /* __WINE__ */
33 # ifdef UNICODE
34 # define WINELIB_NAME_AW(func) func##W
35 # else
36 # define WINELIB_NAME_AW(func) func##A
37 # endif /* UNICODE */
38 #endif /* __WINE__ */
40 #ifdef __WINE__
41 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
42 #else /* __WINE__ */
43 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
44 #endif /* __WINE__ */
47 /* Integer types. These are the same for emulator and library. */
48 typedef UINT WPARAM;
49 typedef LONG LPARAM;
50 typedef LONG LRESULT;
51 typedef WORD ATOM;
52 typedef WORD CATCHBUF[9];
53 typedef WORD *LPCATCHBUF;
54 typedef HANDLE HHOOK;
55 typedef HANDLE HMONITOR;
57 /* Handle types that exist both in Win16 and Win32. */
59 DECLARE_OLD_HANDLE(HACMDRIVERID);
60 DECLARE_OLD_HANDLE(HACMDRIVER);
61 DECLARE_OLD_HANDLE(HACMOBJ);
62 DECLARE_OLD_HANDLE(HACMSTREAM);
64 DECLARE_OLD_HANDLE(HACCEL);
65 DECLARE_OLD_HANDLE(HBITMAP);
66 DECLARE_OLD_HANDLE(HBRUSH);
67 DECLARE_HANDLE(HCOLORSPACE);
68 DECLARE_OLD_HANDLE(HDC);
69 DECLARE_OLD_HANDLE(HDRVR);
70 DECLARE_OLD_HANDLE(HENHMETAFILE);
71 typedef int HFILE;
72 DECLARE_OLD_HANDLE(HFONT);
73 DECLARE_OLD_HANDLE(HICON);
74 DECLARE_OLD_HANDLE(HINSTANCE);
75 DECLARE_OLD_HANDLE(HKEY);
76 DECLARE_OLD_HANDLE(HMENU);
77 DECLARE_OLD_HANDLE(HMETAFILE);
78 DECLARE_OLD_HANDLE(HMIDI);
79 DECLARE_OLD_HANDLE(HMIDIIN);
80 DECLARE_OLD_HANDLE(HMIDIOUT);
81 DECLARE_OLD_HANDLE(HMIDISTRM);
82 DECLARE_OLD_HANDLE(HMIXER);
83 DECLARE_OLD_HANDLE(HMIXEROBJ);
84 DECLARE_OLD_HANDLE(HMMIO);
85 DECLARE_OLD_HANDLE(HPALETTE);
86 DECLARE_OLD_HANDLE(HPEN);
87 DECLARE_OLD_HANDLE(HRGN);
88 DECLARE_OLD_HANDLE(HRSRC);
89 DECLARE_OLD_HANDLE(HTASK);
90 DECLARE_OLD_HANDLE(HWAVE);
91 DECLARE_OLD_HANDLE(HWAVEIN);
92 DECLARE_OLD_HANDLE(HWAVEOUT);
93 DECLARE_HANDLE(HWINSTA);
94 DECLARE_HANDLE(HDESK);
95 DECLARE_OLD_HANDLE(HWND);
96 DECLARE_OLD_HANDLE(HKL);
98 /* Handle types that must remain interchangeable even with strict on */
100 typedef HINSTANCE HMODULE;
101 typedef HANDLE HGDIOBJ;
102 typedef HANDLE HGLOBAL;
103 typedef HANDLE HLOCAL;
104 typedef HANDLE GLOBALHANDLE;
105 typedef HANDLE LOCALHANDLE;
106 typedef HICON HCURSOR;
108 /* Callback function pointers types */
110 typedef INT CALLBACK (*FARPROC)();
111 typedef INT CALLBACK (*PROC)();
114 /* Macros to split words and longs. */
116 #define LOBYTE(w) ((BYTE)(WORD)(w))
117 #define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
119 #define LOWORD(l) ((WORD)(DWORD)(l))
120 #define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
122 #define SLOWORD(l) ((SHORT)(LONG)(l))
123 #define SHIWORD(l) ((SHORT)((LONG)(l) >> 16))
125 #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
126 #define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
127 #define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
128 #define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high))
129 #define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high))
130 #define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0))
132 #define SELECTOROF(ptr) (HIWORD(ptr))
133 #define OFFSETOF(ptr) (LOWORD(ptr))
135 #ifdef __WINE__
136 /* macros to set parts of a DWORD (not in the Windows API) */
137 #define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
138 #define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
139 #define SET_HIBYTE(dw,val) ((dw) = ((dw) & 0xffff00ff) | (LOBYTE(val) << 8))
140 #define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
141 #endif
144 /* min and max macros */
145 #define __max(a,b) (((a) > (b)) ? (a) : (b))
146 #define __min(a,b) (((a) < (b)) ? (a) : (b))
147 #ifndef max
148 #define max(a,b) (((a) > (b)) ? (a) : (b))
149 #endif
150 #ifndef min
151 #define min(a,b) (((a) < (b)) ? (a) : (b))
152 #endif
154 #define _MAX_PATH 260
155 #define MAX_PATH 260
156 #define _MAX_DRIVE 3
157 #define _MAX_DIR 256
158 #define _MAX_FNAME 255
159 #define _MAX_EXT 256
161 #define HFILE_ERROR ((HFILE)-1)
163 /* The SIZE structure */
164 typedef struct tagSIZE
166 LONG cx;
167 LONG cy;
168 } SIZE, *PSIZE, *LPSIZE;
170 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
172 /* The POINT structure */
173 typedef struct tagPOINT
175 LONG x;
176 LONG y;
177 } POINT, *PPOINT, *LPPOINT;
179 typedef struct _POINTL
181 LONG x;
182 LONG y;
183 } POINTL;
185 /* The POINTS structure */
187 typedef struct tagPOINTS
189 SHORT x;
190 SHORT y;
191 } POINTS, *PPOINTS, *LPPOINTS;
193 /* The RECT structure */
194 typedef struct tagRECT
196 INT left;
197 INT top;
198 INT right;
199 INT bottom;
200 } RECT, *PRECT, *LPRECT;
201 typedef const RECT *LPCRECT;
204 typedef struct tagRECTL
206 LONG left;
207 LONG top;
208 LONG right;
209 LONG bottom;
210 } RECTL, *PRECTL, *LPRECTL;
212 typedef const RECTL *LPCRECTL;
214 #ifdef __cplusplus
216 #endif
218 #endif /* __WINE_WINDEF_H */