- split logoff and shutdown resources
[reactos.git] / reactos / w32api / include / windef.h
1 #ifndef _WINDEF_H
2 #define _WINDEF_H
3 #if __GNUC__ >=3
4 #pragma GCC system_header
5 #endif
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 #ifndef WINVER
12 #define WINVER 0x0400
13 /*
14 * If you need Win32 API features newer the Win95 and WinNT then you must
15 * define WINVER before including windows.h or any other method of including
16 * the windef.h header.
17 */
18 #endif
19 #ifndef _WIN32_WINNT
20 #define _WIN32_WINNT WINVER
21 /*
22 * There may be the need to define _WIN32_WINNT to a value different from
23 * the value of WINVER. I don't have any example of why you would do that.
24 * However, if you must then define _WIN32_WINNT to the value required before
25 * including windows.h or any other method of including the windef.h header.
26 */
27 #endif
28 #ifndef WIN32
29 #define WIN32
30 #endif
31 #ifndef _WIN32
32 #define _WIN32
33 #endif
34 #define FAR
35 #define far
36 #define NEAR
37 #define near
38 #ifndef CONST
39 #define CONST const
40 #endif
41 #undef MAX_PATH
42 #define MAX_PATH 260
43
44 #ifndef NULL
45 #ifdef __cplusplus
46 #define NULL 0
47 #else
48 #define NULL ((void*)0)
49 #endif
50 #endif
51 #ifndef FALSE
52 #define FALSE 0
53 #endif
54 #ifndef TRUE
55 #define TRUE 1
56 #endif
57 #define IN
58 #define OUT
59 #ifndef OPTIONAL
60 #define OPTIONAL
61 #endif
62
63 #ifdef __GNUC__
64 #define PACKED __attribute__((packed))
65 #ifndef _fastcall
66 #define _fastcall __attribute__((fastcall))
67 #endif
68 #ifndef __fastcall
69 #define __fastcall __attribute__((fastcall))
70 #endif
71 #ifndef _stdcall
72 #define _stdcall __attribute__((stdcall))
73 #endif
74 #ifndef __stdcall
75 #define __stdcall __attribute__((stdcall))
76 #endif
77 #ifndef _cdecl
78 #define _cdecl __attribute__((cdecl))
79 #endif
80 #ifndef __cdecl
81 #define __cdecl __attribute__((cdecl))
82 #endif
83 #ifndef __declspec
84 #define __declspec(e) __attribute__((e))
85 #endif
86 #ifndef _declspec
87 #define _declspec(e) __attribute__((e))
88 #endif
89 #elif defined(__WATCOMC__)
90 #define PACKED
91 #else
92 #define PACKED
93 #define _cdecl
94 #define __cdecl
95 #endif
96
97 #undef pascal
98 #undef _pascal
99 #undef __pascal
100 #define pascal __stdcall
101 #define _pascal __stdcall
102 #define __pascal __stdcall
103 #define PASCAL _pascal
104 #define CDECL _cdecl
105 #define STDCALL __stdcall
106 #define WINAPI __stdcall
107 #define WINAPIV __cdecl
108 #define APIENTRY __stdcall
109 #define CALLBACK __stdcall
110 #define APIPRIVATE __stdcall
111
112 #define DECLSPEC_IMPORT __declspec(dllimport)
113 #define DECLSPEC_EXPORT __declspec(dllexport)
114 #ifdef __GNUC__
115 #define DECLSPEC_NORETURN __declspec(noreturn)
116 #define DECLARE_STDCALL_P( type ) __stdcall type
117 #elif defined(__WATCOMC__)
118 #define DECLSPEC_NORETURN
119 #define DECLARE_STDCALL_P( type ) type __stdcall
120 #elif defined(_MSC_VER)
121 #define DECLSPEC_NORETURN __declspec(noreturn)
122 #define DECLARE_STDCALL_P( type ) type __stdcall
123 #endif /* __GNUC__/__WATCOMC__ */
124 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
125 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
126 #define LOWORD(l) ((WORD)((DWORD)(l)))
127 #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
128 #define LOBYTE(w) ((BYTE)(w))
129 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
130
131 #ifndef __WATCOMC__
132 #ifndef _export
133 #define _export
134 #endif
135 #ifndef __export
136 #define __export
137 #endif
138 #endif
139
140 #ifndef NOMINMAX
141 #ifndef max
142 #define max(a,b) ((a)>(b)?(a):(b))
143 #endif
144 #ifndef min
145 #define min(a,b) ((a)<(b)?(a):(b))
146 #endif
147 #endif
148
149 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
150 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
151 #define DBG_UNREFERENCED_PARAMETER(P)
152 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
153
154 #ifdef __GNUC__
155 #ifndef NONAMELESSUNION
156 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
157 #define _ANONYMOUS_UNION __extension__
158 #define _ANONYMOUS_STRUCT __extension__
159 #else
160 #if defined(__cplusplus)
161 #define _ANONYMOUS_UNION __extension__
162 #endif /* __cplusplus */
163 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
164 #endif /* NONAMELESSUNION */
165 #elif defined(__WATCOMC__) || defined(_MSC_VER)
166 #define _ANONYMOUS_UNION
167 #define _ANONYMOUS_STRUCT
168 #endif /* __GNUC__/__WATCOMC__ */
169
170 #ifndef _ANONYMOUS_UNION
171 #define _ANONYMOUS_UNION
172 #define _UNION_NAME(x) x
173 #define DUMMYUNIONNAME u
174 #define DUMMYUNIONNAME2 u2
175 #define DUMMYUNIONNAME3 u3
176 #define DUMMYUNIONNAME4 u4
177 #define DUMMYUNIONNAME5 u5
178 #define DUMMYUNIONNAME6 u6
179 #define DUMMYUNIONNAME7 u7
180 #define DUMMYUNIONNAME8 u8
181 #else
182 #define _UNION_NAME(x)
183 #define DUMMYUNIONNAME
184 #define DUMMYUNIONNAME2
185 #define DUMMYUNIONNAME3
186 #define DUMMYUNIONNAME4
187 #define DUMMYUNIONNAME5
188 #define DUMMYUNIONNAME6
189 #define DUMMYUNIONNAME7
190 #define DUMMYUNIONNAME8
191 #endif
192 #ifndef _ANONYMOUS_STRUCT
193 #define _ANONYMOUS_STRUCT
194 #define _STRUCT_NAME(x) x
195 #define DUMMYSTRUCTNAME s
196 #define DUMMYSTRUCTNAME2 s2
197 #define DUMMYSTRUCTNAME3 s3
198 #else
199 #define _STRUCT_NAME(x)
200 #define DUMMYSTRUCTNAME
201 #define DUMMYSTRUCTNAME2
202 #define DUMMYSTRUCTNAME3
203 #endif
204
205 #ifndef NO_STRICT
206 #ifndef STRICT
207 #define STRICT 1
208 #endif
209 #endif
210
211 /* FIXME: This will make some code compile. The programs will most
212 likely crash when an exception is raised, but at least they will
213 compile. */
214 #if defined (__GNUC__) && defined (__SEH_NOOP)
215 #define __try
216 #define __except(x) if (0) /* don't execute handler */
217 #define __finally
218
219 #define _try __try
220 #define _except __except
221 #define _finally __finally
222 #endif
223
224 #ifndef DWORD_DEFINED
225 #define DWORD_DEFINED
226 typedef unsigned long DWORD;
227 #endif//DWORD_DEFINED
228
229 typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
230 /* FIXME: Is there a good solution to this? */
231 #ifndef XFree86Server
232 #ifndef __OBJC__
233 typedef WINBOOL BOOL;
234 #else
235 #define BOOL WINBOOL
236 #endif
237 typedef unsigned char BYTE;
238 #endif /* ndef XFree86Server */
239 typedef BOOL *PBOOL,*LPBOOL;
240 typedef unsigned short WORD;
241 typedef float FLOAT;
242 typedef FLOAT *PFLOAT;
243 typedef BYTE *PBYTE,*LPBYTE;
244 typedef int *PINT,*LPINT;
245 typedef WORD *PWORD,*LPWORD;
246 typedef long *LPLONG;
247 typedef DWORD *PDWORD,*LPDWORD;
248 typedef CONST void *PCVOID,*LPCVOID;
249 typedef int INT;
250 typedef unsigned int UINT,*PUINT,*LPUINT;
251
252 #ifndef NT_INCLUDED
253 #include <winnt.h>
254 #endif
255
256 typedef UINT_PTR WPARAM;
257 typedef LONG_PTR LPARAM;
258 typedef LONG_PTR LRESULT;
259 #ifndef _HRESULT_DEFINED
260 typedef LONG HRESULT;
261 #define _HRESULT_DEFINED
262 #endif
263 #ifndef XFree86Server
264 typedef WORD ATOM;
265 #endif /* XFree86Server */
266 typedef HANDLE HGLOBAL;
267 typedef HANDLE HLOCAL;
268 typedef HANDLE GLOBALHANDLE;
269 typedef HANDLE LOCALHANDLE;
270 typedef void *HGDIOBJ;
271 DECLARE_HANDLE(HACCEL);
272 DECLARE_HANDLE(HBITMAP);
273 DECLARE_HANDLE(HBRUSH);
274 DECLARE_HANDLE(HCOLORSPACE);
275 DECLARE_HANDLE(HDC);
276 DECLARE_HANDLE(HGLRC);
277 DECLARE_HANDLE(HDESK);
278 DECLARE_HANDLE(HENHMETAFILE);
279 DECLARE_HANDLE(HFONT);
280 DECLARE_HANDLE(HICON);
281 DECLARE_HANDLE(HKEY);
282 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
283 /* #if (WINVER >= 0x0500) */
284 DECLARE_HANDLE(HMONITOR);
285 DECLARE_HANDLE(HUMPD);
286 #define HMONITOR_DECLARED 1
287 DECLARE_HANDLE(HTERMINAL);
288 DECLARE_HANDLE(HWINEVENTHOOK);
289 /* #endif */
290 typedef HKEY *PHKEY;
291 DECLARE_HANDLE(HMENU);
292 DECLARE_HANDLE(HMETAFILE);
293 DECLARE_HANDLE(HINSTANCE);
294 typedef HINSTANCE HMODULE;
295 DECLARE_HANDLE(HPALETTE);
296 DECLARE_HANDLE(HPEN);
297 DECLARE_HANDLE(HRGN);
298 DECLARE_HANDLE(HRSRC);
299 DECLARE_HANDLE(HSTR);
300 DECLARE_HANDLE(HTASK);
301 DECLARE_HANDLE(HWND);
302 DECLARE_HANDLE(HWINSTA);
303 DECLARE_HANDLE(HKL);
304 typedef int HFILE;
305 typedef HICON HCURSOR;
306 typedef DWORD COLORREF;
307 typedef int (WINAPI *FARPROC)();
308 typedef int (WINAPI *NEARPROC)();
309 typedef int (WINAPI *PROC)();
310 typedef struct tagRECT {
311 LONG left;
312 LONG top;
313 LONG right;
314 LONG bottom;
315 } RECT,*PRECT,*LPRECT;
316 typedef const RECT *LPCRECT;
317 typedef struct tagRECTL {
318 LONG left;
319 LONG top;
320 LONG right;
321 LONG bottom;
322 } RECTL,*PRECTL,*LPRECTL;
323 typedef const RECTL *LPCRECTL;
324 typedef struct tagPOINT {
325 LONG x;
326 LONG y;
327 } POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
328 typedef struct tagSIZE {
329 LONG cx;
330 LONG cy;
331 } SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
332 typedef struct tagPOINTS {
333 SHORT x;
334 SHORT y;
335 } POINTS,*PPOINTS,*LPPOINTS;
336
337 #ifdef __cplusplus
338 }
339 #endif
340 #endif