ReactOS 0.4.16-dev-1946-g52006dd
minwindef.h
Go to the documentation of this file.
1/*
2 * minwindef.h
3 *
4 * Basic Win-API definitions
5 *
6 * This file is part of the ReactOS SDK.
7 *
8 * Contributors:
9 * Created by Timo Kreuzer <timo.kreuzer@reactos.org>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#ifndef _MINWINDEF_
24#define _MINWINDEF_
25
26#pragma once
27
28#include <specstrings.h>
29
30#ifndef NO_STRICT
31#ifndef STRICT
32#define STRICT 1
33#endif
34#endif
35
36#ifndef WIN32
37#define WIN32
38#endif
39
40#if defined(_MAC) && !defined(_WIN32)
41#define _WIN32
42#endif
43
44#ifndef BASETYPES
45#define BASETYPES
46#ifndef __ROS_LONG64__
47typedef unsigned long ULONG;
48#else
49typedef unsigned int ULONG;
50#endif
51typedef ULONG *PULONG;
52typedef unsigned short USHORT;
53typedef USHORT *PUSHORT;
54typedef unsigned char UCHAR;
55typedef UCHAR *PUCHAR;
56typedef _Null_terminated_ char *PSZ;
57#endif /* BASETYPES */
58
59#undef MAX_PATH // TODO: Remove this
60#define MAX_PATH 260
61
62#ifndef NULL
63#ifdef __cplusplus
64#ifndef _WIN64
65#define NULL 0
66#else
67#define NULL 0LL
68#endif /* W64 */
69#else
70#define NULL ((void *)0)
71#endif
72#endif
73
74#ifndef FALSE
75#define FALSE 0
76#endif
77
78#ifndef TRUE
79#define TRUE 1
80#endif
81
82#ifndef IN
83#define IN
84#endif
85
86#ifndef OUT
87#define OUT
88#endif
89
90#ifndef OPTIONAL
91#define OPTIONAL
92#endif
93
94#undef far
95#undef near
96#undef pascal
97
98#define far
99#define near
100#define pascal __stdcall
101
102#define cdecl
103#ifndef CDECL
104#define CDECL
105#endif
106
107#if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
108#ifndef CALLBACK
109#define CALLBACK __stdcall
110#endif
111#ifndef WINAPI
112#define WINAPI __stdcall
113#endif
114#define WINAPIV __cdecl
115#define APIENTRY WINAPI
116#define APIPRIVATE WINAPI
117#define PASCAL WINAPI
118#else
119#define CALLBACK
120#define WINAPI
121#define WINAPIV
122#define APIENTRY WINAPI
123#define APIPRIVATE
124#define PASCAL pascal
125#endif
126
127#undef FAR
128#undef NEAR
129#define FAR
130#define NEAR
131
132#ifndef CONST
133#define CONST const
134#endif
135
136typedef int BOOL;
137typedef BOOL *PBOOL;
138typedef BOOL *LPBOOL;
139typedef unsigned char BYTE;
140typedef unsigned short WORD;
141#ifndef __ROS_LONG64__
142typedef unsigned long DWORD;
143#else
144typedef unsigned int DWORD;
145#endif
146typedef float FLOAT;
147typedef FLOAT *PFLOAT;
148typedef BYTE *PBYTE;
149typedef BYTE *LPBYTE;
150typedef int *PINT;
151typedef int *LPINT;
152typedef WORD *PWORD;
153typedef WORD *LPWORD;
154#ifndef __ROS_LONG64__
155typedef long *LPLONG;
156#else
157typedef int *LPLONG;
158#endif
159typedef DWORD *PDWORD;
160typedef DWORD *LPDWORD;
161typedef void *LPVOID;
162#ifndef _LPCVOID_DEFINED
163#define _LPCVOID_DEFINED
164typedef CONST void *LPCVOID;
165#endif
166typedef int INT;
167typedef unsigned int UINT;
168typedef unsigned int *PUINT;
169
170#ifndef NT_INCLUDED
171#include <winnt.h>
172#endif
173
177
178#ifndef NOMINMAX
179#ifndef max
180#define max(a, b) (((a) > (b)) ? (a) : (b))
181#endif
182#ifndef min
183#define min(a, b) (((a) < (b)) ? (a) : (b))
184#endif
185#endif
186
187#define MAKEWORD(bLow, bHigh) ((WORD)(((BYTE)((DWORD_PTR)(bLow) & 0xff )) | (((WORD)((BYTE)((DWORD_PTR)(bHigh) & 0xff))) << 8 )))
188#define MAKELONG(wLow, wHigh) ((LONG)(((WORD)((DWORD_PTR)(wLow) & 0xffff)) | (((DWORD)((WORD)((DWORD_PTR)(wHigh) & 0xffff))) << 16)))
189#define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
190#define HIWORD(l) ((WORD)(((DWORD_PTR)(l) >> 16) & 0xffff))
191#define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff))
192#define HIBYTE(w) ((BYTE)(((DWORD_PTR)(w) >> 8) & 0xff))
193
194typedef WORD ATOM;
195
202
203typedef INT_PTR (WINAPI *FARPROC)();
205typedef INT_PTR (WINAPI *PROC)();
206
208typedef HKEY *PHKEY;
209
210DECLARE_HANDLE(HMETAFILE);
221
222typedef int HFILE;
223
224typedef struct _FILETIME
225{
229#define _FILETIME_
230
231#endif // _MINWINDEF_
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DECLARE_HANDLE(name)
Definition: mimeole.idl:23
HANDLE GLOBALHANDLE
Definition: minwindef.h:200
int BOOL
Definition: minwindef.h:136
#define CONST
Definition: minwindef.h:133
DWORD * LPDWORD
Definition: minwindef.h:160
BYTE * PBYTE
Definition: minwindef.h:148
DWORD * PDWORD
Definition: minwindef.h:159
WORD ATOM
Definition: minwindef.h:194
unsigned short WORD
Definition: minwindef.h:140
WORD * PWORD
Definition: minwindef.h:152
LONG_PTR LPARAM
Definition: minwindef.h:175
ULONG * PULONG
Definition: minwindef.h:51
BOOL * LPBOOL
Definition: minwindef.h:138
LONG_PTR LRESULT
Definition: minwindef.h:176
unsigned int UINT
Definition: minwindef.h:167
int INT
Definition: minwindef.h:166
HKEY * PHKEY
Definition: minwindef.h:208
UINT_PTR WPARAM
Definition: minwindef.h:174
_Null_terminated_ char * PSZ
Definition: minwindef.h:56
INT_PTR(WINAPI * NEARPROC)()
Definition: minwindef.h:204
int * LPINT
Definition: minwindef.h:151
unsigned char BYTE
Definition: minwindef.h:139
HANDLE LOCALHANDLE
Definition: minwindef.h:201
long * LPLONG
Definition: minwindef.h:155
unsigned char UCHAR
Definition: minwindef.h:54
unsigned short USHORT
Definition: minwindef.h:52
FLOAT * PFLOAT
Definition: minwindef.h:147
HANDLE HGLOBAL
Definition: minwindef.h:198
float FLOAT
Definition: minwindef.h:146
struct _FILETIME * PFILETIME
struct _FILETIME FILETIME
struct _FILETIME * LPFILETIME
unsigned int * PUINT
Definition: minwindef.h:168
#define WINAPI
Definition: minwindef.h:112
HANDLE HLOCAL
Definition: minwindef.h:199
UCHAR * PUCHAR
Definition: minwindef.h:55
HANDLE * SPHANDLE
Definition: minwindef.h:196
void * LPVOID
Definition: minwindef.h:161
int * PINT
Definition: minwindef.h:150
INT_PTR(WINAPI * FARPROC)()
Definition: minwindef.h:203
BYTE * LPBYTE
Definition: minwindef.h:149
int HFILE
Definition: minwindef.h:222
unsigned long DWORD
Definition: minwindef.h:142
CONST void * LPCVOID
Definition: minwindef.h:164
HANDLE * LPHANDLE
Definition: minwindef.h:197
HINSTANCE HMODULE
Definition: minwindef.h:212
WORD * LPWORD
Definition: minwindef.h:153
BOOL * PBOOL
Definition: minwindef.h:137
USHORT * PUSHORT
Definition: minwindef.h:53
unsigned long ULONG
Definition: minwindef.h:47
INT_PTR(WINAPI * PROC)()
Definition: minwindef.h:205
UINT_PTR HKL
Definition: msctf.idl:125
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define _Null_terminated_
Definition: no_sal2.h:76
unsigned short USHORT
Definition: pedump.c:61
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
int32_t INT_PTR
Definition: typedefs.h:64
float FLOAT
Definition: typedefs.h:69
uint32_t ULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned char BYTE
Definition: xxhash.c:193