wine  6.0.1
About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs.
  Fossies Dox: wine-6.0.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

windef.h
Go to the documentation of this file.
1 /*
2  * Basic types definitions
3  *
4  * Copyright 1996 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #ifndef _WINDEF_
22 #define _WINDEF_
23 
24 #ifndef WINVER
25 #define WINVER 0x0500
26 #endif
27 
28 #ifndef NO_STRICT
29 # ifndef STRICT
30 # define STRICT
31 # endif /* STRICT */
32 #endif /* NO_STRICT */
33 
34 #ifndef __has_attribute
35 #define __has_attribute(x) 0
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /* Calling conventions definitions */
43 
44 #if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)) && !defined(_WIN64)
45 #define _WIN64
46 #endif
47 
48 #ifndef _WIN64
49 # if defined(__i386__) && !defined(_X86_)
50 # define _X86_
51 # endif
52 # if defined(_X86_) && !defined(__i386__)
53 # define __i386__
54 # endif
55 #endif
56 
57 #ifndef _MSC_VER
58 # undef __stdcall
59 # ifdef __i386__
60 # ifdef __GNUC__
61 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
62 # define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
63 # else
64 # define __stdcall __attribute__((__stdcall__))
65 # endif
66 # else
67 # error You need to define __stdcall for your compiler
68 # endif
69 # elif defined(__x86_64__) && defined (__GNUC__)
70 # if __has_attribute(__force_align_arg_pointer__)
71 # define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
72 # else
73 # define __stdcall __attribute__((ms_abi))
74 # endif
75 # elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(_WIN32)
76 # define __stdcall __attribute__((pcs("aapcs-vfp")))
77 # elif defined(__aarch64__) && defined (__GNUC__) && __has_attribute(ms_abi)
78 # define __stdcall __attribute__((ms_abi))
79 # else /* __i386__ */
80 # define __stdcall
81 # endif /* __i386__ */
82 #endif /* __stdcall */
83 
84 #ifndef _MSC_VER
85 # undef __cdecl
86 # if defined(__i386__) && defined(__GNUC__)
87 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
88 # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
89 # else
90 # define __cdecl __attribute__((__cdecl__))
91 # endif
92 # else
93 # define __cdecl __stdcall
94 # endif
95 #endif
96 
97 #if !defined(_MSC_VER) && !defined(__fastcall)
98 # define __fastcall __stdcall
99 #endif
100 
101 #if (!defined(_MSC_VER) || !defined(__clang__)) && !defined(__thiscall)
102 # define __thiscall __stdcall
103 #endif
104 
105 #ifndef __ms_va_list
106 # if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined (__GNUC__)
107 # define __ms_va_list __builtin_ms_va_list
108 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
109 # define __ms_va_end(list) __builtin_ms_va_end(list)
110 # define __ms_va_copy(dest,src) __builtin_ms_va_copy(dest,src)
111 # else
112 # define __ms_va_list va_list
113 # define __ms_va_start(list,arg) va_start(list,arg)
114 # define __ms_va_end(list) va_end(list)
115 # ifdef va_copy
116 # define __ms_va_copy(dest,src) va_copy(dest,src)
117 # else
118 # define __ms_va_copy(dest,src) ((dest) = (src))
119 # endif
120 # endif
121 #endif
122 
123 #if defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(_WIN32)
124 # define WINAPIV __attribute__((pcs("aapcs")))
125 #else
126 # define WINAPIV __cdecl
127 #endif
128 
129 #ifdef __WINESRC__
130 #define __ONLY_IN_WINELIB(x) do_not_use_this_in_wine
131 #else
132 #define __ONLY_IN_WINELIB(x) x
133 #endif
134 
135 #ifndef _MSC_VER
136 #ifndef _stdcall
137 #define _stdcall __ONLY_IN_WINELIB(__stdcall)
138 #endif
139 #ifndef _fastcall
140 #define _fastcall __ONLY_IN_WINELIB(__stdcall)
141 #endif
142 #ifndef __fastcall
143 #define __fastcall __ONLY_IN_WINELIB(__stdcall)
144 #endif
145 #ifndef cdecl
146 #define cdecl __ONLY_IN_WINELIB(__cdecl)
147 #endif
148 #ifndef _cdecl
149 #define _cdecl __ONLY_IN_WINELIB(__cdecl)
150 #endif
151 #endif /* _MSC_VER */
152 
153 #ifndef pascal
154 #define pascal __ONLY_IN_WINELIB(__stdcall)
155 #endif
156 #ifndef _pascal
157 #define _pascal __ONLY_IN_WINELIB(__stdcall)
158 #endif
159 #ifndef __export
160 #define __export __ONLY_IN_WINELIB(__stdcall)
161 #endif
162 #ifndef near
163 #define near __ONLY_IN_WINELIB(/* nothing */)
164 #endif
165 #ifndef far
166 #define far __ONLY_IN_WINELIB(/* nothing */)
167 #endif
168 #ifndef _near
169 #define _near __ONLY_IN_WINELIB(/* nothing */)
170 #endif
171 #ifndef _far
172 #define _far __ONLY_IN_WINELIB(/* nothing */)
173 #endif
174 #ifndef NEAR
175 #define NEAR __ONLY_IN_WINELIB(/* nothing */)
176 #endif
177 #ifndef FAR
178 #define FAR __ONLY_IN_WINELIB(/* nothing */)
179 #endif
180 
181 #ifndef _MSC_VER
182 # ifndef _declspec
183 # define _declspec(x) __ONLY_IN_WINELIB(/* nothing */)
184 # endif
185 # ifndef __declspec
186 # define __declspec(x) __ONLY_IN_WINELIB(/* nothing */)
187 # endif
188 #endif
189 
190 #ifdef _MSC_VER
191 # define inline __inline
192 #endif
193 
194 #define CALLBACK __stdcall
195 #define WINAPI __stdcall
196 #define APIPRIVATE __stdcall
197 #define PASCAL __stdcall
198 #define CDECL __cdecl
199 #define _CDECL __cdecl
200 #define APIENTRY WINAPI
201 #define CONST __ONLY_IN_WINELIB(const)
202 
203 /* Misc. constants. */
204 
205 #undef NULL
206 #ifdef __cplusplus
207 #define NULL 0
208 #else
209 #define NULL ((void*)0)
210 #endif
211 
212 #ifdef FALSE
213 #undef FALSE
214 #endif
215 #define FALSE 0
216 
217 #ifdef TRUE
218 #undef TRUE
219 #endif
220 #define TRUE 1
221 
222 #ifndef IN
223 #define IN
224 #endif
225 
226 #ifndef OUT
227 #define OUT
228 #endif
229 
230 #ifndef OPTIONAL
231 #define OPTIONAL
232 #endif
233 
234 /* Standard data types */
235 
236 #ifndef BASETYPES
237 #define BASETYPES
238 typedef unsigned char UCHAR, *PUCHAR;
239 typedef unsigned short USHORT, *PUSHORT;
240 #ifdef WINE_USE_LONG
241 typedef unsigned long ULONG, *PULONG;
242 #else
243 typedef unsigned int ULONG, *PULONG;
244 #endif
245 #endif
246 
247 typedef void *LPVOID;
248 typedef const void *LPCVOID;
249 typedef int BOOL, *PBOOL, *LPBOOL;
250 typedef unsigned char BYTE, *PBYTE, *LPBYTE;
251 typedef unsigned short WORD, *PWORD, *LPWORD;
252 typedef int INT, *PINT, *LPINT;
253 typedef unsigned int UINT, *PUINT;
254 typedef float FLOAT, *PFLOAT;
255 typedef char *PSZ;
256 #ifdef WINE_USE_LONG
257 typedef long *LPLONG;
258 typedef unsigned long DWORD, *PDWORD, *LPDWORD;
259 #else
260 typedef int *LPLONG;
261 typedef unsigned int DWORD, *PDWORD, *LPDWORD;
262 #endif
263 
264 /* Macros to map Winelib names to the correct implementation name */
265 /* Note that Winelib is purely Win32. */
266 
267 #ifdef __WINESRC__
268 #define WINE_NO_UNICODE_MACROS 1
269 #define WINE_STRICT_PROTOTYPES 1
270 #endif
271 
272 #ifdef WINE_NO_UNICODE_MACROS
273 # define WINELIB_NAME_AW(func) \
274  func##_must_be_suffixed_with_W_or_A_in_this_context \
275  func##_must_be_suffixed_with_W_or_A_in_this_context
276 #else /* WINE_NO_UNICODE_MACROS */
277 # ifdef UNICODE
278 # define WINELIB_NAME_AW(func) func##W
279 # else
280 # define WINELIB_NAME_AW(func) func##A
281 # endif
282 #endif /* WINE_NO_UNICODE_MACROS */
283 
284 #ifdef WINE_NO_UNICODE_MACROS
285 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
286 #else
287 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
288 #endif
289 
290 #include <winnt.h>
291 
292 /* Polymorphic types */
293 
294 typedef UINT_PTR WPARAM;
295 typedef LONG_PTR LPARAM;
297 
298 /* Integer types */
299 
300 typedef WORD ATOM;
302 
303 
304 /* Handle types */
305 
306 typedef int HFILE;
321 typedef HKEY *PHKEY;
334 
335 /* Handle types that must remain interchangeable even with strict on */
336 
338 typedef HANDLE HGDIOBJ;
339 typedef HANDLE HGLOBAL;
340 typedef HANDLE HLOCAL;
343 typedef HICON HCURSOR;
344 
345 /* Callback function pointers types */
346 
347 #ifdef WINE_STRICT_PROTOTYPES
348 typedef INT_PTR (CALLBACK *FARPROC)(void);
349 typedef INT_PTR (CALLBACK *NEARPROC)(void);
350 typedef INT_PTR (CALLBACK *PROC)(void);
351 #else
352 typedef INT_PTR (CALLBACK *FARPROC)();
353 typedef INT_PTR (CALLBACK *NEARPROC)();
354 typedef INT_PTR (CALLBACK *PROC)();
355 #endif
356 
357 /* Macros to split words and longs. */
358 
359 #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xFF))
360 #define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8))
361 
362 #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xFFFF))
363 #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))
364 
365 #define MAKEWORD(low,high) ((WORD)(((BYTE)((DWORD_PTR)(low) & 0xFF)) | ((WORD)((BYTE)((DWORD_PTR)(high) & 0xFF))) << 8))
366 #define MAKELONG(low,high) ((LONG)(((WORD)((DWORD_PTR)(low) & 0xFFFF)) | ((DWORD)((WORD)((DWORD_PTR)(high) & 0xFFFF))) << 16))
367 
368 /* min and max macros */
369 #ifndef NOMINMAX
370 #ifndef max
371 #define max(a,b) (((a) > (b)) ? (a) : (b))
372 #endif
373 #ifndef min
374 #define min(a,b) (((a) < (b)) ? (a) : (b))
375 #endif
376 #endif /* NOMINMAX */
377 
378 #ifdef MAX_PATH /* Work-around for Mingw */
379 #undef MAX_PATH
380 #endif /* MAX_PATH */
381 
382 #define MAX_PATH 260
383 #define HFILE_ERROR ((HFILE)-1)
384 
385 /* The SIZE structure */
386 typedef struct tagSIZE
387 {
391 
392 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
393 
394 /* The POINT structure */
395 typedef struct tagPOINT
396 {
400 
401 typedef struct _POINTL
402 {
406 
407 /* The POINTS structure */
408 
409 typedef struct tagPOINTS
410 {
411 #ifdef WORDS_BIGENDIAN
412  SHORT y;
413  SHORT x;
414 #else
417 #endif
419 
420 typedef struct _FILETIME {
421 #ifdef WORDS_BIGENDIAN
424 #else
427 #endif
429 #define _FILETIME_
430 
431 /* The RECT structure */
432 typedef struct tagRECT
433 {
439 typedef const RECT *LPCRECT;
440 
441 typedef struct _RECTL
442 {
448 
449 typedef const RECTL *LPCRECTL;
450 
451 /* DPI awareness */
452 typedef enum DPI_AWARENESS
453 {
459 
460 #define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
461 #define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
462 #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
463 #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
464 #define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5)
465 
466 #ifdef __cplusplus
467 }
468 #endif
469 
470 #endif /* _WINDEF_ */
unsigned long UINT_PTR
Definition: basetsd.h:128
long LONG_PTR
Definition: basetsd.h:129
long INT_PTR
Definition: basetsd.h:127
#define DECLARE_HANDLE(name)
Definition: mimeole.idl:23
void(CDECL *mono_callspec_set_assembly)(MonoAssembly *assembly) DECLSPEC_HIDDEN
UINT_PTR HKL
Definition: msctf.idl:101
Definition: windef.h:312
Definition: windef.h:320
Definition: windef.h:327
Definition: windef.h:328
Definition: dcommon.idl:28
DWORD dwHighDateTime
Definition: winbase.h:253
DWORD dwLowDateTime
Definition: winbase.h:252
LONG y
Definition: windef.h:404
LONG x
Definition: windef.h:403
Definition: windef.h:442
LONG top
Definition: windef.h:444
LONG left
Definition: windef.h:443
LONG right
Definition: windef.h:445
LONG bottom
Definition: windef.h:446
SHORT y
Definition: windef.h:416
SHORT x
Definition: windef.h:415
LONG y
Definition: windef.h:398
LONG x
Definition: windef.h:397
LONG right
Definition: windef.h:436
LONG bottom
Definition: windef.h:437
LONG top
Definition: windef.h:435
LONG left
Definition: windef.h:434
LONG cx
Definition: windef.h:388
LONG cy
Definition: windef.h:389
HANDLE GLOBALHANDLE
Definition: windef.h:341
int BOOL
Definition: windef.h:249
struct tagPOINTS * PPOINTS
WORD ATOM
Definition: windef.h:300
unsigned short WORD
Definition: windef.h:251
int * PBOOL
Definition: windef.h:249
struct tagPOINT POINT
unsigned char * PUCHAR
Definition: windef.h:238
INT_PTR(* PROC)()
Definition: windef.h:354
LONG_PTR LRESULT
Definition: windef.h:296
unsigned int * PUINT
Definition: windef.h:253
int * PINT
Definition: windef.h:252
unsigned int UINT
Definition: windef.h:253
int INT
Definition: windef.h:252
DPI_AWARENESS
Definition: windef.h:453
@ DPI_AWARENESS_PER_MONITOR_AWARE
Definition: windef.h:457
@ DPI_AWARENESS_SYSTEM_AWARE
Definition: windef.h:456
@ DPI_AWARENESS_INVALID
Definition: windef.h:454
@ DPI_AWARENESS_UNAWARE
Definition: windef.h:455
HKEY * PHKEY
Definition: windef.h:321
struct tagSIZE * LPSIZE
LONG_PTR LPARAM
Definition: windef.h:295
struct _POINTL POINTL
struct tagPOINTS POINTS
unsigned int * PULONG
Definition: windef.h:243
INT_PTR(* FARPROC)()
Definition: windef.h:352
struct _POINTL * PPOINTL
unsigned char * LPBYTE
Definition: windef.h:250
unsigned int * PDWORD
Definition: windef.h:261
unsigned char BYTE
Definition: windef.h:250
HANDLE LOCALHANDLE
Definition: windef.h:342
unsigned int * LPDWORD
Definition: windef.h:261
unsigned char UCHAR
Definition: windef.h:238
unsigned int DWORD
Definition: windef.h:261
int * LPBOOL
Definition: windef.h:249
unsigned short USHORT
Definition: windef.h:239
struct tagRECT RECT
HANDLE HGLOBAL
Definition: windef.h:339
SIZE * PSIZEL
Definition: windef.h:392
const RECTL * LPCRECTL
Definition: windef.h:449
unsigned char * PBYTE
Definition: windef.h:250
SIZE SIZEL
Definition: windef.h:392
float FLOAT
Definition: windef.h:254
struct _FILETIME * PFILETIME
struct _FILETIME FILETIME
struct _FILETIME * LPFILETIME
struct tagSIZE SIZE
struct tagRECT * LPRECT
INT_PTR(* NEARPROC)()
Definition: windef.h:353
float * PFLOAT
Definition: windef.h:254
HANDLE HLOCAL
Definition: windef.h:340
int * LPINT
Definition: windef.h:252
HANDLE HGDIOBJ
Definition: windef.h:338
UINT_PTR WPARAM
Definition: windef.h:294
const RECT * LPCRECT
Definition: windef.h:439
struct tagSIZE * PSIZE
struct _RECTL * LPRECTL
void * LPVOID
Definition: windef.h:247
unsigned int ULONG
Definition: windef.h:243
struct _RECTL RECTL
struct _RECTL * PRECTL
DWORD COLORREF
Definition: windef.h:301
int HFILE
Definition: windef.h:306
#define CALLBACK
Definition: windef.h:194
DWORD * LPCOLORREF
Definition: windef.h:301
struct tagPOINTS * LPPOINTS
const void * LPCVOID
Definition: windef.h:248
int * LPLONG
Definition: windef.h:260
HINSTANCE HMODULE
Definition: windef.h:337
struct tagRECT * PRECT
unsigned short * PUSHORT
Definition: windef.h:239
char * PSZ
Definition: windef.h:255
HICON HCURSOR
Definition: windef.h:343
struct tagPOINT * LPPOINT
SIZE * LPSIZEL
Definition: windef.h:392
struct tagPOINT * PPOINT
unsigned short * LPWORD
Definition: windef.h:251
unsigned short * PWORD
Definition: windef.h:251
int LONG
Definition: winnt.h:459
short SHORT
Definition: winnt.h:455