mirror of
https://github.com/reactos/reactos.git
synced 2024-08-27 13:48:42 +00:00
442 lines
9.5 KiB
C
442 lines
9.5 KiB
C
#ifndef _WINDEF_H
|
|
#define _WINDEF_H
|
|
|
|
#ifndef _M_AMD64
|
|
#if !defined(__ROS_LONG64__)
|
|
#ifdef __WINESRC__
|
|
#define __ROS_LONG64__
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma warning(push)
|
|
#pragma warning(disable:4255)
|
|
#endif
|
|
|
|
#ifndef WINVER
|
|
#define WINVER 0x0400
|
|
/*
|
|
* If you need Win32 API features newer the Win95 and WinNT then you must
|
|
* define WINVER before including windows.h or any other method of including
|
|
* the windef.h header.
|
|
*/
|
|
#endif
|
|
#ifndef _WIN32_WINNT
|
|
#define _WIN32_WINNT WINVER
|
|
/*
|
|
* There may be the need to define _WIN32_WINNT to a value different from
|
|
* the value of WINVER. I don't have any example of why you would do that.
|
|
* However, if you must then define _WIN32_WINNT to the value required before
|
|
* including windows.h or any other method of including the windef.h header.
|
|
*/
|
|
#endif
|
|
#ifndef WIN32
|
|
#define WIN32
|
|
#endif
|
|
#ifndef _WIN32
|
|
#define _WIN32
|
|
#endif
|
|
#define FAR
|
|
#define far
|
|
#define NEAR
|
|
#define near
|
|
#ifndef CONST
|
|
#define CONST const
|
|
#endif
|
|
#undef MAX_PATH
|
|
#define MAX_PATH 260
|
|
|
|
#ifndef NULL
|
|
#ifdef __cplusplus
|
|
#define NULL 0
|
|
#else
|
|
#define NULL ((void*)0)
|
|
#endif
|
|
#endif
|
|
#ifndef FALSE
|
|
#define FALSE 0
|
|
#endif
|
|
#ifndef TRUE
|
|
#define TRUE 1
|
|
#endif
|
|
|
|
#ifndef IN
|
|
#define IN
|
|
#endif
|
|
#ifndef OUT
|
|
#define OUT
|
|
#endif
|
|
#ifndef OPTIONAL
|
|
#define OPTIONAL
|
|
#endif
|
|
|
|
/* needed by header files generated by WIDL */
|
|
#ifdef __WINESRC__
|
|
#define WINE_NO_UNICODE_MACROS
|
|
#endif
|
|
|
|
#ifdef WINE_NO_UNICODE_MACROS
|
|
# 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
|
|
#else /* WINE_NO_UNICODE_MACROS */
|
|
# ifdef UNICODE
|
|
# define WINELIB_NAME_AW(func) func##W
|
|
# else
|
|
# define WINELIB_NAME_AW(func) func##A
|
|
# endif
|
|
#endif /* WINE_NO_UNICODE_MACROS */
|
|
|
|
#ifdef WINE_NO_UNICODE_MACROS
|
|
# define DECL_WINELIB_TYPE_AW(type) /* nothing */
|
|
#else
|
|
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
|
#endif
|
|
|
|
#ifdef __GNUC__
|
|
#define PACKED __attribute__((packed))
|
|
#ifndef _fastcall
|
|
#define _fastcall __attribute__((fastcall))
|
|
#endif
|
|
#ifndef __fastcall
|
|
#define __fastcall __attribute__((fastcall))
|
|
#endif
|
|
#ifndef _stdcall
|
|
#define _stdcall __attribute__((stdcall))
|
|
#endif
|
|
#ifndef __stdcall
|
|
#define __stdcall __attribute__((stdcall))
|
|
#endif
|
|
#ifndef _cdecl
|
|
#define _cdecl __attribute__((cdecl))
|
|
#endif
|
|
#ifndef __cdecl
|
|
#define __cdecl __attribute__((cdecl))
|
|
#endif
|
|
#ifndef __declspec
|
|
#define __declspec(e) __attribute__((e))
|
|
#endif
|
|
#ifndef _declspec
|
|
#define _declspec(e) __attribute__((e))
|
|
#endif
|
|
#elif defined(__WATCOMC__)
|
|
#define PACKED
|
|
#else
|
|
#define PACKED
|
|
#define _cdecl
|
|
#define __cdecl
|
|
#endif
|
|
|
|
#undef pascal
|
|
#undef _pascal
|
|
#undef __pascal
|
|
#define pascal __stdcall
|
|
#define _pascal __stdcall
|
|
#define __pascal __stdcall
|
|
|
|
#define CDECL _cdecl
|
|
|
|
#if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
|
|
#define CALLBACK __stdcall
|
|
#define WINAPI __stdcall
|
|
#define WINAPIV __cdecl
|
|
#define APIENTRY WINAPI
|
|
#define APIPRIVATE __stdcall
|
|
#define PASCAL __stdcall
|
|
#else
|
|
#define CALLBACK
|
|
#define WINAPI
|
|
#define WINAPIV
|
|
#define APIENTRY WINAPI
|
|
#define APIPRIVATE
|
|
#define PASCAL pascal
|
|
#endif
|
|
|
|
#define DECLSPEC_IMPORT __declspec(dllimport)
|
|
#define DECLSPEC_EXPORT __declspec(dllexport)
|
|
#ifndef DECLSPEC_NOINLINE
|
|
#if (_MSC_VER >= 1300)
|
|
#define DECLSPEC_NOINLINE __declspec(noinline)
|
|
#elif defined(__GNUC__)
|
|
#define DECLSPEC_NOINLINE __attribute__((noinline))
|
|
#else
|
|
#define DECLSPEC_NOINLINE
|
|
#endif
|
|
#endif
|
|
#ifdef __GNUC__
|
|
#define DECLSPEC_NORETURN __declspec(noreturn)
|
|
#define DECLARE_STDCALL_P( type ) __stdcall type
|
|
#elif defined(__WATCOMC__)
|
|
#define DECLSPEC_NORETURN
|
|
#define DECLARE_STDCALL_P( type ) type __stdcall
|
|
#elif defined(_MSC_VER)
|
|
#define DECLSPEC_NORETURN __declspec(noreturn)
|
|
#define DECLARE_STDCALL_P( type ) type __stdcall
|
|
#endif /* __GNUC__/__WATCOMC__ */
|
|
#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
|
|
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
|
|
#define LOWORD(l) ((WORD)((DWORD_PTR)(l)))
|
|
#define HIWORD(l) ((WORD)(((DWORD_PTR)(l)>>16)&0xFFFF))
|
|
#define LOBYTE(w) ((BYTE)(w))
|
|
#define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
|
|
|
|
#ifndef __WATCOMC__
|
|
#ifndef _export
|
|
#define _export
|
|
#endif
|
|
#ifndef __export
|
|
#define __export
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef NOMINMAX
|
|
#ifndef max
|
|
#define max(a,b) ((a)>(b)?(a):(b))
|
|
#endif
|
|
|
|
#ifndef min
|
|
#define min(a,b) ((a)<(b)?(a):(b))
|
|
#endif
|
|
#endif
|
|
|
|
#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
|
|
#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
|
|
#define DBG_UNREFERENCED_PARAMETER(P)
|
|
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
|
|
|
|
#ifndef __ANONYMOUS_DEFINED
|
|
#define __ANONYMOUS_DEFINED
|
|
|
|
#ifndef NONAMELESSUNION
|
|
#ifdef __GNUC__
|
|
#define _ANONYMOUS_UNION __extension__
|
|
#define _ANONYMOUS_STRUCT __extension__
|
|
#elif defined(__WATCOMC__) || defined(_MSC_VER)
|
|
#define _ANONYMOUS_UNION
|
|
#define _ANONYMOUS_STRUCT
|
|
#endif /* __GNUC__/__WATCOMC__ */
|
|
#endif /* NONAMELESSUNION */
|
|
|
|
#ifndef _ANONYMOUS_UNION
|
|
#define _ANONYMOUS_UNION
|
|
#define _UNION_NAME(x) x
|
|
#define DUMMYUNIONNAME u
|
|
#define DUMMYUNIONNAME1 u1
|
|
#define DUMMYUNIONNAME2 u2
|
|
#define DUMMYUNIONNAME3 u3
|
|
#define DUMMYUNIONNAME4 u4
|
|
#define DUMMYUNIONNAME5 u5
|
|
#define DUMMYUNIONNAME6 u6
|
|
#define DUMMYUNIONNAME7 u7
|
|
#define DUMMYUNIONNAME8 u8
|
|
#else
|
|
#define _UNION_NAME(x)
|
|
#define DUMMYUNIONNAME
|
|
#define DUMMYUNIONNAME1
|
|
#define DUMMYUNIONNAME2
|
|
#define DUMMYUNIONNAME3
|
|
#define DUMMYUNIONNAME4
|
|
#define DUMMYUNIONNAME5
|
|
#define DUMMYUNIONNAME6
|
|
#define DUMMYUNIONNAME7
|
|
#define DUMMYUNIONNAME8
|
|
#endif
|
|
#ifndef _ANONYMOUS_STRUCT
|
|
#define _ANONYMOUS_STRUCT
|
|
#define _STRUCT_NAME(x) x
|
|
#define DUMMYSTRUCTNAME s
|
|
#define DUMMYSTRUCTNAME1 s1
|
|
#define DUMMYSTRUCTNAME2 s2
|
|
#define DUMMYSTRUCTNAME3 s3
|
|
#define DUMMYSTRUCTNAME4 s4
|
|
#define DUMMYSTRUCTNAME5 s5
|
|
#else
|
|
#define _STRUCT_NAME(x)
|
|
#define DUMMYSTRUCTNAME
|
|
#define DUMMYSTRUCTNAME1
|
|
#define DUMMYSTRUCTNAME2
|
|
#define DUMMYSTRUCTNAME3
|
|
#define DUMMYSTRUCTNAME4
|
|
#define DUMMYSTRUCTNAME5
|
|
#endif
|
|
|
|
#endif /* __ANONYMOUS_DEFINED */
|
|
|
|
#ifndef NO_STRICT
|
|
#ifndef STRICT
|
|
#define STRICT 1
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef DWORD_DEFINED
|
|
#define DWORD_DEFINED
|
|
#ifndef __ROS_LONG64__
|
|
typedef unsigned long DWORD;
|
|
#else
|
|
typedef unsigned int DWORD;
|
|
#endif
|
|
#endif//DWORD_DEFINED
|
|
|
|
typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
|
|
/* FIXME: Is there a good solution to this? */
|
|
#ifndef XFree86Server
|
|
#ifndef __OBJC__
|
|
typedef WINBOOL BOOL;
|
|
#else
|
|
#define BOOL WINBOOL
|
|
#endif
|
|
typedef unsigned char BYTE;
|
|
#endif /* ndef XFree86Server */
|
|
typedef BOOL *PBOOL,*LPBOOL;
|
|
typedef unsigned short WORD;
|
|
typedef float FLOAT;
|
|
typedef FLOAT *PFLOAT;
|
|
typedef BYTE *PBYTE,*LPBYTE;
|
|
typedef int *PINT,*LPINT;
|
|
typedef WORD *PWORD,*LPWORD;
|
|
#ifndef __ROS_LONG64__
|
|
typedef long *LPLONG;
|
|
#else
|
|
typedef int *LPLONG;
|
|
#endif
|
|
typedef DWORD *PDWORD,*LPDWORD;
|
|
typedef CONST void *LPCVOID;
|
|
|
|
typedef unsigned int UINT,*PUINT,*LPUINT;
|
|
|
|
typedef void *LPVOID;
|
|
|
|
#ifndef __ms_va_list
|
|
# if defined(__x86_64__) && defined (__GNUC__)
|
|
# define __ms_va_list __builtin_ms_va_list
|
|
# define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
|
|
# define __ms_va_end(list) __builtin_ms_va_end(list)
|
|
# else
|
|
# define __ms_va_list va_list
|
|
# define __ms_va_start(list,arg) va_start(list,arg)
|
|
# define __ms_va_end(list) va_end(list)
|
|
# endif
|
|
#endif
|
|
|
|
//
|
|
// Check if ntdef.h already defined these for us
|
|
//
|
|
#ifndef BASETYPES
|
|
#define BASETYPES
|
|
#ifndef __ROS_LONG64__
|
|
typedef unsigned long ULONG, *PULONG;
|
|
#else
|
|
typedef unsigned int ULONG, *PULONG;
|
|
#endif
|
|
typedef unsigned short USHORT, *PUSHORT;
|
|
typedef unsigned char UCHAR, *PUCHAR;
|
|
typedef char *PSZ;
|
|
typedef int INT;
|
|
#endif /* BASETYPES */
|
|
|
|
#ifndef NT_INCLUDED
|
|
#include <winnt.h>
|
|
#endif
|
|
|
|
typedef HANDLE *LPHANDLE;
|
|
typedef UINT_PTR WPARAM;
|
|
typedef LONG_PTR LPARAM;
|
|
typedef LONG_PTR LRESULT;
|
|
#ifndef _HRESULT_DEFINED
|
|
typedef LONG HRESULT;
|
|
#define _HRESULT_DEFINED
|
|
#endif
|
|
#ifndef XFree86Server
|
|
typedef WORD ATOM;
|
|
#endif /* XFree86Server */
|
|
typedef HANDLE HGLOBAL;
|
|
typedef HANDLE HLOCAL;
|
|
typedef HANDLE GLOBALHANDLE;
|
|
typedef HANDLE LOCALHANDLE;
|
|
typedef void *HGDIOBJ;
|
|
DECLARE_HANDLE(HACCEL);
|
|
DECLARE_HANDLE(HBITMAP);
|
|
DECLARE_HANDLE(HBRUSH);
|
|
DECLARE_HANDLE(HCOLORSPACE);
|
|
DECLARE_HANDLE(HDC);
|
|
DECLARE_HANDLE(HGLRC);
|
|
DECLARE_HANDLE(HDESK);
|
|
DECLARE_HANDLE(HENHMETAFILE);
|
|
DECLARE_HANDLE(HFONT);
|
|
DECLARE_HANDLE(HICON);
|
|
DECLARE_HANDLE(HKEY);
|
|
/* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
|
|
/* #if (WINVER >= 0x0500) */
|
|
DECLARE_HANDLE(HMONITOR);
|
|
DECLARE_HANDLE(HUMPD);
|
|
#define HMONITOR_DECLARED 1
|
|
DECLARE_HANDLE(HTERMINAL);
|
|
DECLARE_HANDLE(HWINEVENTHOOK);
|
|
/* #endif */
|
|
typedef HKEY *PHKEY;
|
|
DECLARE_HANDLE(HMENU);
|
|
DECLARE_HANDLE(HMETAFILE);
|
|
DECLARE_HANDLE(HINSTANCE);
|
|
typedef HINSTANCE HMODULE;
|
|
DECLARE_HANDLE(HPALETTE);
|
|
DECLARE_HANDLE(HPEN);
|
|
DECLARE_HANDLE(HRGN);
|
|
DECLARE_HANDLE(HRSRC);
|
|
DECLARE_HANDLE(HSTR);
|
|
DECLARE_HANDLE(HTASK);
|
|
DECLARE_HANDLE(HWND);
|
|
DECLARE_HANDLE(HWINSTA);
|
|
DECLARE_HANDLE(HKL);
|
|
typedef int HFILE;
|
|
typedef HICON HCURSOR;
|
|
typedef DWORD COLORREF;
|
|
#ifdef _WIN64
|
|
typedef INT_PTR (FAR WINAPI *FARPROC)();
|
|
typedef INT_PTR (NEAR WINAPI *NEARPROC)();
|
|
typedef INT_PTR (WINAPI *PROC)();
|
|
#else
|
|
typedef int (FAR WINAPI *FARPROC)();
|
|
typedef int (NEAR WINAPI *NEARPROC)();
|
|
typedef int (WINAPI *PROC)();
|
|
#endif
|
|
typedef struct tagRECT {
|
|
LONG left;
|
|
LONG top;
|
|
LONG right;
|
|
LONG bottom;
|
|
} RECT,*PRECT,*LPRECT;
|
|
typedef const RECT *LPCRECT;
|
|
typedef struct tagRECTL {
|
|
LONG left;
|
|
LONG top;
|
|
LONG right;
|
|
LONG bottom;
|
|
} RECTL,*PRECTL,*LPRECTL;
|
|
typedef const RECTL *LPCRECTL;
|
|
typedef struct tagPOINT {
|
|
LONG x;
|
|
LONG y;
|
|
} POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
|
|
typedef struct tagSIZE {
|
|
LONG cx;
|
|
LONG cy;
|
|
} SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
|
|
typedef struct tagPOINTS {
|
|
SHORT x;
|
|
SHORT y;
|
|
} POINTS,*PPOINTS,*LPPOINTS;
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma warning(pop)
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|