1999-03-14 17:35:05 +01:00
|
|
|
/*
|
|
|
|
* Basic types definitions
|
|
|
|
*
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-03-14 17:35:05 +01:00
|
|
|
*/
|
1999-02-09 16:46:25 +01:00
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
#ifndef __WINE_WINDEF_H
|
|
|
|
#define __WINE_WINDEF_H
|
1999-02-09 16:46:25 +01:00
|
|
|
|
2003-01-04 01:52:18 +01:00
|
|
|
#ifdef __WINESRC__
|
1999-03-14 17:35:05 +01:00
|
|
|
# undef UNICODE
|
2003-01-04 01:52:18 +01:00
|
|
|
#endif /* __WINESRC__ */
|
1999-02-09 16:46:25 +01:00
|
|
|
|
2002-10-23 22:19:48 +02:00
|
|
|
#ifndef WINVER
|
2000-10-13 19:10:34 +02:00
|
|
|
#define WINVER 0x0500
|
2002-10-23 22:19:48 +02:00
|
|
|
#endif
|
2000-10-13 19:10:34 +02:00
|
|
|
|
2002-12-10 21:02:17 +01:00
|
|
|
#ifndef NO_STRICT
|
|
|
|
# ifndef STRICT
|
|
|
|
# define STRICT
|
|
|
|
# endif /* STRICT */
|
|
|
|
#endif /* NO_STRICT */
|
|
|
|
|
2002-12-10 23:56:43 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Calling conventions definitions */
|
|
|
|
|
2003-01-15 04:31:49 +01:00
|
|
|
#if defined(__i386__) && !defined(_X86_)
|
|
|
|
# define _X86_
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __stdcall
|
|
|
|
# ifdef __i386__
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# define __stdcall __attribute__((__stdcall__))
|
|
|
|
# elif defined(_MSC_VER)
|
|
|
|
/* Nothing needs to be done. __stdcall already exists */
|
|
|
|
# else
|
|
|
|
# error You need to define __stdcall for your compiler
|
|
|
|
# endif
|
|
|
|
# else /* __i386__ */
|
|
|
|
# define __stdcall
|
|
|
|
# endif /* __i386__ */
|
|
|
|
#endif /* __stdcall */
|
|
|
|
|
|
|
|
#ifndef __cdecl
|
|
|
|
# if defined(__i386__) && defined(__GNUC__)
|
|
|
|
# define __cdecl __attribute__((__cdecl__))
|
|
|
|
# elif !defined(_MSC_VER)
|
|
|
|
# define __cdecl
|
2002-12-10 23:56:43 +01:00
|
|
|
# endif
|
2003-01-15 04:31:49 +01:00
|
|
|
#endif /* __stdcall */
|
2002-12-10 23:56:43 +01:00
|
|
|
|
2003-01-04 01:52:18 +01:00
|
|
|
#ifndef __WINESRC__
|
2002-12-10 23:56:43 +01:00
|
|
|
|
|
|
|
#ifndef pascal
|
|
|
|
#define pascal __stdcall
|
|
|
|
#endif
|
|
|
|
#ifndef _pascal
|
|
|
|
#define _pascal __stdcall
|
|
|
|
#endif
|
|
|
|
#ifndef _stdcall
|
|
|
|
#define _stdcall __stdcall
|
|
|
|
#endif
|
|
|
|
#ifndef _fastcall
|
|
|
|
#define _fastcall __stdcall
|
|
|
|
#endif
|
|
|
|
#ifndef __fastcall
|
|
|
|
#define __fastcall __stdcall
|
|
|
|
#endif
|
|
|
|
#ifndef __export
|
|
|
|
#define __export __stdcall
|
|
|
|
#endif
|
|
|
|
#ifndef cdecl
|
|
|
|
#define cdecl __cdecl
|
|
|
|
#endif
|
|
|
|
#ifndef _cdecl
|
|
|
|
#define _cdecl __cdecl
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef near
|
|
|
|
#define near
|
|
|
|
#endif
|
|
|
|
#ifndef far
|
|
|
|
#define far
|
|
|
|
#endif
|
|
|
|
#ifndef _near
|
|
|
|
#define _near
|
|
|
|
#endif
|
|
|
|
#ifndef _far
|
|
|
|
#define _far
|
|
|
|
#endif
|
|
|
|
#ifndef NEAR
|
|
|
|
#define NEAR
|
|
|
|
#endif
|
|
|
|
#ifndef FAR
|
|
|
|
#define FAR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _declspec
|
|
|
|
#define _declspec(x)
|
|
|
|
#endif
|
|
|
|
#ifndef __declspec
|
|
|
|
#define __declspec(x)
|
|
|
|
#endif
|
|
|
|
|
2003-01-04 01:52:18 +01:00
|
|
|
#endif /* __WINESRC__ */
|
2002-12-10 23:56:43 +01:00
|
|
|
|
|
|
|
#define CALLBACK __stdcall
|
|
|
|
#define WINAPI __stdcall
|
|
|
|
#define APIPRIVATE __stdcall
|
|
|
|
#define PASCAL __stdcall
|
|
|
|
#define CDECL __cdecl
|
|
|
|
#define _CDECL __cdecl
|
|
|
|
#define WINAPIV __cdecl
|
|
|
|
#define APIENTRY WINAPI
|
|
|
|
#define CONST const
|
1999-03-14 17:35:05 +01:00
|
|
|
|
2002-12-10 23:56:43 +01:00
|
|
|
/* Misc. constants. */
|
1999-03-14 17:35:05 +01:00
|
|
|
|
2002-12-10 23:56:43 +01:00
|
|
|
#undef NULL
|
2000-12-19 05:51:10 +01:00
|
|
|
#ifdef __cplusplus
|
2002-12-10 23:56:43 +01:00
|
|
|
#define NULL 0
|
|
|
|
#else
|
|
|
|
#define NULL ((void*)0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef FALSE
|
|
|
|
#undef FALSE
|
2000-12-19 05:51:10 +01:00
|
|
|
#endif
|
2002-12-10 23:56:43 +01:00
|
|
|
#define FALSE 0
|
2000-12-19 05:51:10 +01:00
|
|
|
|
2002-12-10 23:56:43 +01:00
|
|
|
#ifdef TRUE
|
|
|
|
#undef TRUE
|
|
|
|
#endif
|
|
|
|
#define TRUE 1
|
|
|
|
|
|
|
|
#ifndef IN
|
|
|
|
#define IN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef OUT
|
|
|
|
#define OUT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef OPTIONAL
|
|
|
|
#define OPTIONAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Standard data types */
|
|
|
|
|
|
|
|
typedef void *LPVOID;
|
|
|
|
typedef const void *LPCVOID;
|
|
|
|
typedef int BOOL, *PBOOL, *LPBOOL;
|
|
|
|
typedef unsigned char BYTE, *PBYTE, *LPBYTE;
|
|
|
|
typedef unsigned char UCHAR, *PUCHAR;
|
|
|
|
typedef unsigned short WORD, *PWORD, *LPWORD;
|
|
|
|
typedef unsigned short USHORT, *PUSHORT;
|
|
|
|
typedef int INT, *PINT, *LPINT;
|
|
|
|
typedef unsigned int UINT, *PUINT;
|
|
|
|
typedef long *LPLONG;
|
|
|
|
typedef unsigned long DWORD, *PDWORD, *LPDWORD;
|
|
|
|
typedef unsigned long ULONG, *PULONG;
|
|
|
|
typedef float FLOAT, *PFLOAT;
|
|
|
|
typedef double DOUBLE;
|
|
|
|
typedef double DATE;
|
|
|
|
|
|
|
|
#include "winnt.h"
|
2000-12-19 05:51:10 +01:00
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
/* Macros to map Winelib names to the correct implementation name */
|
2003-01-04 01:52:18 +01:00
|
|
|
/* depending on __WINESRC__ and UNICODE macros. */
|
1999-03-14 17:35:05 +01:00
|
|
|
/* Note that Winelib is purely Win32. */
|
|
|
|
|
2003-01-04 01:52:18 +01:00
|
|
|
#ifdef __WINESRC__
|
1999-12-25 23:45:57 +01:00
|
|
|
# define WINELIB_NAME_AW(func) \
|
|
|
|
func##_must_be_suffixed_with_W_or_A_in_this_context \
|
|
|
|
func##_must_be_suffixed_with_W_or_A_in_this_context
|
2003-01-04 01:52:18 +01:00
|
|
|
#else /* __WINESRC__ */
|
1999-03-14 17:35:05 +01:00
|
|
|
# ifdef UNICODE
|
|
|
|
# define WINELIB_NAME_AW(func) func##W
|
|
|
|
# else
|
|
|
|
# define WINELIB_NAME_AW(func) func##A
|
|
|
|
# endif /* UNICODE */
|
2003-01-04 01:52:18 +01:00
|
|
|
#endif /* __WINESRC__ */
|
1999-03-14 17:35:05 +01:00
|
|
|
|
2003-01-04 01:52:18 +01:00
|
|
|
#ifdef __WINESRC__
|
1999-03-14 17:35:05 +01:00
|
|
|
# define DECL_WINELIB_TYPE_AW(type) /* nothing */
|
2003-01-04 01:52:18 +01:00
|
|
|
#else /* __WINESRC__ */
|
1999-03-14 17:35:05 +01:00
|
|
|
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
2003-01-04 01:52:18 +01:00
|
|
|
#endif /* __WINESRC__ */
|
1999-03-14 17:35:05 +01:00
|
|
|
|
1999-04-25 13:05:30 +02:00
|
|
|
|
2003-01-10 02:45:13 +01:00
|
|
|
/* Polymorphic types */
|
|
|
|
|
|
|
|
typedef UINT_PTR WPARAM;
|
|
|
|
typedef LONG_PTR LPARAM;
|
|
|
|
typedef LONG_PTR LRESULT;
|
|
|
|
|
2001-07-30 20:57:18 +02:00
|
|
|
/* Integer types */
|
2003-01-10 02:45:13 +01:00
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
typedef WORD ATOM;
|
|
|
|
typedef WORD CATCHBUF[9];
|
|
|
|
typedef WORD *LPCATCHBUF;
|
2001-10-08 22:31:59 +02:00
|
|
|
typedef DWORD COLORREF, *LPCOLORREF;
|
|
|
|
|
1999-02-12 14:44:38 +01:00
|
|
|
|
2002-12-10 23:56:43 +01:00
|
|
|
/* Handle types */
|
1999-03-14 17:35:05 +01:00
|
|
|
|
2001-07-30 20:57:18 +02:00
|
|
|
typedef int HFILE;
|
2002-08-28 02:39:39 +02:00
|
|
|
DECLARE_HANDLE(HACCEL);
|
2002-10-19 19:20:02 +02:00
|
|
|
DECLARE_HANDLE(HBITMAP);
|
|
|
|
DECLARE_HANDLE(HBRUSH);
|
2000-12-29 04:40:55 +01:00
|
|
|
DECLARE_HANDLE(HCOLORSPACE);
|
2002-10-19 19:20:02 +02:00
|
|
|
DECLARE_HANDLE(HDC);
|
2001-07-30 20:57:18 +02:00
|
|
|
DECLARE_HANDLE(HDESK);
|
2002-07-29 02:14:59 +02:00
|
|
|
DECLARE_HANDLE(HENHMETAFILE);
|
2002-10-19 19:20:02 +02:00
|
|
|
DECLARE_HANDLE(HFONT);
|
2002-07-28 19:42:05 +02:00
|
|
|
DECLARE_HANDLE(HHOOK);
|
2002-10-10 23:22:09 +02:00
|
|
|
DECLARE_HANDLE(HICON);
|
2002-10-19 19:20:02 +02:00
|
|
|
DECLARE_HANDLE(HINSTANCE);
|
2002-09-24 05:09:12 +02:00
|
|
|
DECLARE_HANDLE(HKEY);
|
2002-12-10 23:56:43 +01:00
|
|
|
typedef HKEY *PHKEY;
|
2002-08-16 03:34:19 +02:00
|
|
|
DECLARE_HANDLE(HKL);
|
2002-10-19 19:20:02 +02:00
|
|
|
DECLARE_HANDLE(HMENU);
|
2002-07-29 02:14:59 +02:00
|
|
|
DECLARE_HANDLE(HMETAFILE);
|
2002-07-19 02:28:13 +02:00
|
|
|
DECLARE_HANDLE(HMONITOR);
|
2002-08-29 03:55:55 +02:00
|
|
|
DECLARE_HANDLE(HPALETTE);
|
2002-10-19 19:20:02 +02:00
|
|
|
DECLARE_HANDLE(HPEN);
|
|
|
|
DECLARE_HANDLE(HRGN);
|
2002-09-17 00:47:05 +02:00
|
|
|
DECLARE_HANDLE(HRSRC);
|
2002-07-29 01:48:27 +02:00
|
|
|
DECLARE_HANDLE(HTASK);
|
2002-07-11 01:20:49 +02:00
|
|
|
DECLARE_HANDLE(HWINEVENTHOOK);
|
2001-01-09 21:56:06 +01:00
|
|
|
DECLARE_HANDLE(HWINSTA);
|
2002-09-06 22:40:42 +02:00
|
|
|
DECLARE_HANDLE(HWND);
|
1999-03-14 17:35:05 +01:00
|
|
|
|
1999-04-25 13:05:30 +02:00
|
|
|
/* Handle types that must remain interchangeable even with strict on */
|
|
|
|
|
|
|
|
typedef HINSTANCE HMODULE;
|
|
|
|
typedef HANDLE HGDIOBJ;
|
|
|
|
typedef HANDLE HGLOBAL;
|
|
|
|
typedef HANDLE HLOCAL;
|
2000-03-19 15:21:38 +01:00
|
|
|
typedef HANDLE GLOBALHANDLE;
|
|
|
|
typedef HANDLE LOCALHANDLE;
|
2000-11-10 23:32:45 +01:00
|
|
|
typedef HICON HCURSOR;
|
1999-04-25 13:05:30 +02:00
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
/* Callback function pointers types */
|
|
|
|
|
2002-02-01 00:22:07 +01:00
|
|
|
typedef INT (CALLBACK *FARPROC)();
|
|
|
|
typedef INT (CALLBACK *PROC)();
|
1999-03-14 17:35:05 +01:00
|
|
|
|
1999-02-12 14:44:38 +01:00
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
/* Macros to split words and longs. */
|
|
|
|
|
|
|
|
#define LOBYTE(w) ((BYTE)(WORD)(w))
|
|
|
|
#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
|
|
|
|
|
|
|
|
#define LOWORD(l) ((WORD)(DWORD)(l))
|
|
|
|
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
|
|
|
|
|
2000-09-27 00:20:14 +02:00
|
|
|
#define SLOWORD(l) ((SHORT)(LONG)(l))
|
|
|
|
#define SHIWORD(l) ((SHORT)((LONG)(l) >> 16))
|
1999-03-14 17:35:05 +01:00
|
|
|
|
|
|
|
#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
|
|
|
|
#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
|
|
|
|
#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
|
|
|
|
#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high))
|
|
|
|
#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high))
|
|
|
|
|
|
|
|
#define SELECTOROF(ptr) (HIWORD(ptr))
|
|
|
|
#define OFFSETOF(ptr) (LOWORD(ptr))
|
|
|
|
|
2000-03-25 22:44:35 +01:00
|
|
|
/* min and max macros */
|
2001-05-07 22:14:00 +02:00
|
|
|
#ifndef NOMINMAX
|
1999-07-10 15:16:29 +02:00
|
|
|
#ifndef max
|
2000-03-25 22:44:35 +01:00
|
|
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
1999-07-10 15:16:29 +02:00
|
|
|
#endif
|
|
|
|
#ifndef min
|
2000-03-25 22:44:35 +01:00
|
|
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
1999-07-10 15:16:29 +02:00
|
|
|
#endif
|
2001-05-07 22:14:00 +02:00
|
|
|
#endif /* NOMINMAX */
|
1999-03-14 17:35:05 +01:00
|
|
|
|
2002-09-12 22:43:24 +02:00
|
|
|
#ifdef MAX_PATH /* Work-around for Mingw */
|
|
|
|
#undef MAX_PATH
|
|
|
|
#endif /* MAX_PATH */
|
|
|
|
|
2002-05-01 20:13:18 +02:00
|
|
|
#define MAX_PATH 260
|
1999-03-14 17:35:05 +01:00
|
|
|
#define HFILE_ERROR ((HFILE)-1)
|
1999-02-09 16:46:25 +01:00
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
/* The SIZE structure */
|
|
|
|
typedef struct tagSIZE
|
|
|
|
{
|
2000-09-19 04:43:00 +02:00
|
|
|
LONG cx;
|
|
|
|
LONG cy;
|
1999-03-14 17:35:05 +01:00
|
|
|
} SIZE, *PSIZE, *LPSIZE;
|
|
|
|
|
|
|
|
typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
|
|
|
|
|
|
|
|
/* The POINT structure */
|
|
|
|
typedef struct tagPOINT
|
|
|
|
{
|
|
|
|
LONG x;
|
|
|
|
LONG y;
|
|
|
|
} POINT, *PPOINT, *LPPOINT;
|
1999-02-13 10:13:49 +01:00
|
|
|
|
|
|
|
typedef struct _POINTL
|
|
|
|
{
|
1999-03-14 17:35:05 +01:00
|
|
|
LONG x;
|
|
|
|
LONG y;
|
1999-02-13 10:13:49 +01:00
|
|
|
} POINTL;
|
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
/* The POINTS structure */
|
|
|
|
|
|
|
|
typedef struct tagPOINTS
|
|
|
|
{
|
2000-09-27 00:20:14 +02:00
|
|
|
SHORT x;
|
|
|
|
SHORT y;
|
1999-03-14 17:35:05 +01:00
|
|
|
} POINTS, *PPOINTS, *LPPOINTS;
|
|
|
|
|
|
|
|
/* The RECT structure */
|
|
|
|
typedef struct tagRECT
|
|
|
|
{
|
2003-01-08 22:09:25 +01:00
|
|
|
LONG left;
|
|
|
|
LONG top;
|
|
|
|
LONG right;
|
|
|
|
LONG bottom;
|
1999-03-14 17:35:05 +01:00
|
|
|
} RECT, *PRECT, *LPRECT;
|
|
|
|
typedef const RECT *LPCRECT;
|
|
|
|
|
|
|
|
typedef struct tagRECTL
|
|
|
|
{
|
|
|
|
LONG left;
|
2001-10-08 22:31:59 +02:00
|
|
|
LONG top;
|
1999-03-14 17:35:05 +01:00
|
|
|
LONG right;
|
|
|
|
LONG bottom;
|
|
|
|
} RECTL, *PRECTL, *LPRECTL;
|
|
|
|
|
|
|
|
typedef const RECTL *LPCRECTL;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
1999-02-13 10:13:49 +01:00
|
|
|
|
1999-03-28 14:39:18 +02:00
|
|
|
#endif /* __WINE_WINDEF_H */
|