1999-03-14 16:35:05 +00:00
|
|
|
/*
|
|
|
|
* Basic types definitions
|
|
|
|
*
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
2002-03-09 23:29:33 +00: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 16:35:05 +00:00
|
|
|
*/
|
1999-02-09 15:46:25 +00:00
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
#ifndef __WINE_WINDEF_H
|
|
|
|
#define __WINE_WINDEF_H
|
1999-02-09 15:46:25 +00:00
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
#ifdef __WINE__
|
|
|
|
# undef UNICODE
|
|
|
|
#endif /* __WINE__ */
|
1999-02-09 15:46:25 +00:00
|
|
|
|
2000-10-13 17:10:34 +00:00
|
|
|
#define WINVER 0x0500
|
|
|
|
|
2000-12-15 21:31:03 +00:00
|
|
|
#include "winnt.h"
|
1999-03-14 16:35:05 +00:00
|
|
|
|
|
|
|
|
2000-12-19 04:51:10 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
/* Macros to map Winelib names to the correct implementation name */
|
|
|
|
/* depending on __WINE__ and UNICODE macros. */
|
|
|
|
/* Note that Winelib is purely Win32. */
|
|
|
|
|
|
|
|
#ifdef __WINE__
|
1999-12-25 22:45:57 +00: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
|
1999-03-14 16:35:05 +00:00
|
|
|
#else /* __WINE__ */
|
|
|
|
# ifdef UNICODE
|
|
|
|
# define WINELIB_NAME_AW(func) func##W
|
|
|
|
# else
|
|
|
|
# define WINELIB_NAME_AW(func) func##A
|
|
|
|
# endif /* UNICODE */
|
|
|
|
#endif /* __WINE__ */
|
|
|
|
|
|
|
|
#ifdef __WINE__
|
|
|
|
# define DECL_WINELIB_TYPE_AW(type) /* nothing */
|
|
|
|
#else /* __WINE__ */
|
|
|
|
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
|
|
|
#endif /* __WINE__ */
|
|
|
|
|
1999-04-25 11:05:30 +00:00
|
|
|
|
2001-07-30 18:57:18 +00:00
|
|
|
/* Integer types */
|
1999-03-14 16:35:05 +00:00
|
|
|
typedef UINT WPARAM;
|
|
|
|
typedef LONG LPARAM;
|
|
|
|
typedef LONG LRESULT;
|
|
|
|
typedef WORD ATOM;
|
|
|
|
typedef WORD CATCHBUF[9];
|
|
|
|
typedef WORD *LPCATCHBUF;
|
2001-10-08 20:31:59 +00:00
|
|
|
typedef DWORD COLORREF, *LPCOLORREF;
|
|
|
|
|
1999-02-12 13:44:38 +00:00
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
/* Handle types that exist both in Win16 and Win32. */
|
|
|
|
|
2001-07-30 18:57:18 +00:00
|
|
|
typedef int HFILE;
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HACCEL);
|
|
|
|
DECLARE_OLD_HANDLE(HBITMAP);
|
|
|
|
DECLARE_OLD_HANDLE(HBRUSH);
|
2000-12-29 03:40:55 +00:00
|
|
|
DECLARE_HANDLE(HCOLORSPACE);
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HDC);
|
2001-07-30 18:57:18 +00:00
|
|
|
DECLARE_HANDLE(HDESK);
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HENHMETAFILE);
|
|
|
|
DECLARE_OLD_HANDLE(HFONT);
|
2002-07-28 17:42:05 +00:00
|
|
|
DECLARE_HANDLE(HHOOK);
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HICON);
|
|
|
|
DECLARE_OLD_HANDLE(HINSTANCE);
|
|
|
|
DECLARE_OLD_HANDLE(HKEY);
|
2001-07-30 18:57:18 +00:00
|
|
|
DECLARE_OLD_HANDLE(HKL);
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HMENU);
|
|
|
|
DECLARE_OLD_HANDLE(HMETAFILE);
|
2002-07-19 00:28:13 +00:00
|
|
|
DECLARE_HANDLE(HMONITOR);
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HPALETTE);
|
|
|
|
DECLARE_OLD_HANDLE(HPEN);
|
|
|
|
DECLARE_OLD_HANDLE(HRGN);
|
|
|
|
DECLARE_OLD_HANDLE(HRSRC);
|
2002-07-28 23:48:27 +00:00
|
|
|
DECLARE_HANDLE(HTASK);
|
2002-07-10 23:20:49 +00:00
|
|
|
DECLARE_HANDLE(HWINEVENTHOOK);
|
2001-01-09 20:56:06 +00:00
|
|
|
DECLARE_HANDLE(HWINSTA);
|
2000-12-26 00:07:25 +00:00
|
|
|
DECLARE_OLD_HANDLE(HWND);
|
1999-03-14 16:35:05 +00:00
|
|
|
|
1999-04-25 11:05:30 +00: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 14:21:38 +00:00
|
|
|
typedef HANDLE GLOBALHANDLE;
|
|
|
|
typedef HANDLE LOCALHANDLE;
|
2000-11-10 22:32:45 +00:00
|
|
|
typedef HICON HCURSOR;
|
1999-04-25 11:05:30 +00:00
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
/* Callback function pointers types */
|
|
|
|
|
2002-01-31 23:22:07 +00:00
|
|
|
typedef INT (CALLBACK *FARPROC)();
|
|
|
|
typedef INT (CALLBACK *PROC)();
|
1999-03-14 16:35:05 +00:00
|
|
|
|
1999-02-12 13:44:38 +00:00
|
|
|
|
1999-03-14 16:35:05 +00: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-26 22:20:14 +00:00
|
|
|
#define SLOWORD(l) ((SHORT)(LONG)(l))
|
|
|
|
#define SHIWORD(l) ((SHORT)((LONG)(l) >> 16))
|
1999-03-14 16:35:05 +00: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))
|
|
|
|
|
1999-08-01 12:15:12 +00:00
|
|
|
#ifdef __WINE__
|
|
|
|
/* macros to set parts of a DWORD (not in the Windows API) */
|
|
|
|
#define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
|
|
|
|
#define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
|
2000-09-22 22:18:41 +00:00
|
|
|
#define SET_HIBYTE(dw,val) ((dw) = ((dw) & 0xffff00ff) | (LOBYTE(val) << 8))
|
1999-08-01 12:15:12 +00:00
|
|
|
#define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
|
|
|
|
#endif
|
|
|
|
|
2000-03-25 21:44:35 +00:00
|
|
|
/* min and max macros */
|
2001-05-07 20:14:00 +00:00
|
|
|
#ifndef NOMINMAX
|
1999-07-10 13:16:29 +00:00
|
|
|
#ifndef max
|
2000-03-25 21:44:35 +00:00
|
|
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
1999-07-10 13:16:29 +00:00
|
|
|
#endif
|
|
|
|
#ifndef min
|
2000-03-25 21:44:35 +00:00
|
|
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
1999-07-10 13:16:29 +00:00
|
|
|
#endif
|
2001-05-07 20:14:00 +00:00
|
|
|
#endif /* NOMINMAX */
|
1999-03-14 16:35:05 +00:00
|
|
|
|
2002-05-01 18:13:18 +00:00
|
|
|
#define MAX_PATH 260
|
1999-03-14 16:35:05 +00:00
|
|
|
#define HFILE_ERROR ((HFILE)-1)
|
1999-02-09 15:46:25 +00:00
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
/* The SIZE structure */
|
|
|
|
typedef struct tagSIZE
|
|
|
|
{
|
2000-09-19 02:43:00 +00:00
|
|
|
LONG cx;
|
|
|
|
LONG cy;
|
1999-03-14 16:35:05 +00: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 09:13:49 +00:00
|
|
|
|
|
|
|
typedef struct _POINTL
|
|
|
|
{
|
1999-03-14 16:35:05 +00:00
|
|
|
LONG x;
|
|
|
|
LONG y;
|
1999-02-13 09:13:49 +00:00
|
|
|
} POINTL;
|
|
|
|
|
1999-03-14 16:35:05 +00:00
|
|
|
/* The POINTS structure */
|
|
|
|
|
|
|
|
typedef struct tagPOINTS
|
|
|
|
{
|
2000-09-26 22:20:14 +00:00
|
|
|
SHORT x;
|
|
|
|
SHORT y;
|
1999-03-14 16:35:05 +00:00
|
|
|
} POINTS, *PPOINTS, *LPPOINTS;
|
|
|
|
|
|
|
|
/* The RECT structure */
|
|
|
|
typedef struct tagRECT
|
|
|
|
{
|
|
|
|
INT left;
|
|
|
|
INT top;
|
|
|
|
INT right;
|
|
|
|
INT bottom;
|
|
|
|
} RECT, *PRECT, *LPRECT;
|
|
|
|
typedef const RECT *LPCRECT;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct tagRECTL
|
|
|
|
{
|
|
|
|
LONG left;
|
2001-10-08 20:31:59 +00:00
|
|
|
LONG top;
|
1999-03-14 16:35:05 +00:00
|
|
|
LONG right;
|
|
|
|
LONG bottom;
|
|
|
|
} RECTL, *PRECTL, *LPRECTL;
|
|
|
|
|
|
|
|
typedef const RECTL *LPCRECTL;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
1999-02-13 09:13:49 +00:00
|
|
|
|
1999-03-28 12:39:18 +00:00
|
|
|
#endif /* __WINE_WINDEF_H */
|