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