Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

394 lines
9.1 KiB

  1. /****************************************************************************
  2. * *
  3. * windef.h -- Basic Windows Type Definitions *
  4. * *
  5. * Copyright (c) Microsoft Corporation. All rights reserved. *
  6. * *
  7. ****************************************************************************/
  8. #ifndef _WINDEF_
  9. #define _WINDEF_
  10. #ifndef NO_STRICT ;public_NT
  11. #ifndef STRICT ;public_NT
  12. #define STRICT 1 ;public_NT
  13. #endif ;public_NT
  14. #endif /* NO_STRICT */ ;public_NT
  15. // Win32 defines _WIN32 automatically,
  16. // but Macintosh doesn't, so if we are using
  17. // Win32 Functions, we must do it here
  18. #ifdef _MAC
  19. #ifndef _WIN32
  20. #define _WIN32
  21. #endif
  22. #endif //_MAC
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #ifndef WINVER ;public_win40
  27. #define WINVER 0x0500 ;public_win40
  28. #endif /* WINVER */ ;public_win40
  29. /*
  30. * BASETYPES is defined in ntdef.h if these types are already defined
  31. */
  32. #ifndef BASETYPES
  33. #define BASETYPES
  34. typedef unsigned long ULONG;
  35. typedef ULONG *PULONG;
  36. typedef unsigned short USHORT;
  37. typedef USHORT *PUSHORT;
  38. typedef unsigned char UCHAR;
  39. typedef UCHAR *PUCHAR;
  40. typedef char *PSZ;
  41. #endif /* !BASETYPES */
  42. #define MAX_PATH 260
  43. #ifndef NULL
  44. #ifdef __cplusplus
  45. #define NULL 0
  46. #else
  47. #define NULL ((void *)0)
  48. #endif
  49. #endif
  50. #ifndef FALSE
  51. #define FALSE 0
  52. #endif
  53. #ifndef TRUE
  54. #define TRUE 1
  55. #endif
  56. #ifndef IN
  57. #define IN
  58. #endif
  59. #ifndef OUT
  60. #define OUT
  61. #endif
  62. #ifndef OPTIONAL
  63. #define OPTIONAL
  64. #endif
  65. #undef far
  66. #undef near
  67. #undef pascal
  68. #define far
  69. #define near
  70. #if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))
  71. #define pascal __stdcall
  72. #else
  73. #define pascal
  74. #endif
  75. #if defined(DOSWIN32) || defined(_MAC)
  76. #define cdecl _cdecl
  77. #ifndef CDECL
  78. #define CDECL _cdecl
  79. #endif
  80. #else
  81. #define cdecl
  82. #ifndef CDECL
  83. #define CDECL
  84. #endif
  85. #endif
  86. #ifdef _MAC
  87. #define CALLBACK PASCAL
  88. #define WINAPI CDECL
  89. #define WINAPIV CDECL
  90. #define APIENTRY WINAPI
  91. #define APIPRIVATE CDECL
  92. #ifdef _68K_
  93. #define PASCAL __pascal
  94. #else
  95. #define PASCAL
  96. #endif
  97. #elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  98. #define CALLBACK __stdcall
  99. #define WINAPI __stdcall
  100. #define WINAPIV __cdecl
  101. #define APIENTRY WINAPI
  102. #define APIPRIVATE __stdcall
  103. #define PASCAL __stdcall
  104. #else
  105. #define CALLBACK
  106. #define WINAPI
  107. #define WINAPIV
  108. #define APIENTRY WINAPI
  109. #define APIPRIVATE
  110. #define PASCAL pascal
  111. #endif
  112. #undef FAR
  113. #undef NEAR
  114. #define FAR far
  115. #define NEAR near
  116. #ifndef CONST
  117. #define CONST const
  118. #endif
  119. typedef unsigned long DWORD;
  120. typedef int BOOL;
  121. typedef unsigned char BYTE;
  122. typedef unsigned short WORD;
  123. typedef float FLOAT;
  124. typedef FLOAT *PFLOAT;
  125. typedef BOOL near *PBOOL;
  126. typedef BOOL far *LPBOOL;
  127. typedef BYTE near *PBYTE;
  128. typedef BYTE far *LPBYTE;
  129. typedef int near *PINT;
  130. typedef int far *LPINT;
  131. typedef WORD near *PWORD;
  132. typedef WORD far *LPWORD;
  133. typedef long far *LPLONG;
  134. typedef DWORD near *PDWORD;
  135. typedef DWORD far *LPDWORD;
  136. typedef void far *LPVOID;
  137. typedef CONST void far *LPCVOID;
  138. typedef int INT;
  139. typedef unsigned int UINT;
  140. typedef unsigned int *PUINT;
  141. #ifndef NT_INCLUDED
  142. #include <winnt.h>
  143. #endif /* NT_INCLUDED */
  144. /* Types use for passing & returning polymorphic values */
  145. typedef UINT_PTR WPARAM;
  146. typedef LONG_PTR LPARAM;
  147. typedef LONG_PTR LRESULT;
  148. #ifndef NOMINMAX
  149. #ifndef max
  150. #define max(a,b) (((a) > (b)) ? (a) : (b))
  151. #endif
  152. #ifndef min
  153. #define min(a,b) (((a) < (b)) ? (a) : (b))
  154. #endif
  155. #endif /* NOMINMAX */
  156. #define MAKEWORD(a, b) ((WORD)(((BYTE)((DWORD_PTR)(a) & 0xff)) | ((WORD)((BYTE)((DWORD_PTR)(b) & 0xff))) << 8))
  157. #define MAKELONG(a, b) ((LONG)(((WORD)((DWORD_PTR)(a) & 0xffff)) | ((DWORD)((WORD)((DWORD_PTR)(b) & 0xffff))) << 16))
  158. #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
  159. #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))
  160. #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff))
  161. #define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8))
  162. #ifndef WIN_INTERNAL
  163. DECLARE_HANDLE (HWND);
  164. DECLARE_HANDLE (HHOOK);
  165. #ifdef WINABLE
  166. DECLARE_HANDLE (HEVENT);
  167. #endif
  168. #endif
  169. typedef WORD ATOM;
  170. typedef HANDLE NEAR *SPHANDLE;
  171. typedef HANDLE FAR *LPHANDLE;
  172. typedef HANDLE HGLOBAL;
  173. typedef HANDLE HLOCAL;
  174. typedef HANDLE GLOBALHANDLE;
  175. typedef HANDLE LOCALHANDLE;
  176. #ifndef _MAC
  177. #ifdef _WIN64
  178. typedef INT_PTR (FAR WINAPI *FARPROC)();
  179. typedef INT_PTR (NEAR WINAPI *NEARPROC)();
  180. typedef INT_PTR (WINAPI *PROC)();
  181. #else
  182. typedef int (FAR WINAPI *FARPROC)();
  183. typedef int (NEAR WINAPI *NEARPROC)();
  184. typedef int (WINAPI *PROC)();
  185. #endif // _WIN64
  186. #else
  187. typedef int (CALLBACK *FARPROC)();
  188. typedef int (CALLBACK *NEARPROC)();
  189. typedef int (CALLBACK *PROC)();
  190. #endif
  191. #if !defined(_MAC) || !defined(GDI_INTERNAL)
  192. #ifdef STRICT
  193. typedef void NEAR* HGDIOBJ;
  194. #else
  195. DECLARE_HANDLE(HGDIOBJ);
  196. #endif
  197. #endif
  198. DECLARE_HANDLE(HKEY);
  199. typedef HKEY *PHKEY;
  200. #if !defined(_MAC) || !defined(WIN_INTERNAL)
  201. DECLARE_HANDLE(HACCEL);
  202. #endif
  203. #if !defined(_MAC) || !defined(GDI_INTERNAL)
  204. DECLARE_HANDLE(HBITMAP);
  205. DECLARE_HANDLE(HBRUSH);
  206. #endif
  207. ;begin_winver_400
  208. DECLARE_HANDLE(HCOLORSPACE);
  209. ;end_winver_400
  210. #if !defined(_MAC) || !defined(GDI_INTERNAL)
  211. DECLARE_HANDLE(HDC);
  212. #endif
  213. DECLARE_HANDLE(HGLRC); // OpenGL
  214. DECLARE_HANDLE(HDESK);
  215. DECLARE_HANDLE(HENHMETAFILE);
  216. #if !defined(_MAC) || !defined(GDI_INTERNAL)
  217. DECLARE_HANDLE(HFONT);
  218. #endif
  219. DECLARE_HANDLE(HICON);
  220. #if !defined(_MAC) || !defined(WIN_INTERNAL)
  221. DECLARE_HANDLE(HMENU);
  222. #endif
  223. DECLARE_HANDLE(HMETAFILE);
  224. DECLARE_HANDLE(HINSTANCE);
  225. typedef HINSTANCE HMODULE; /* HMODULEs can be used in place of HINSTANCEs */
  226. #if !defined(_MAC) || !defined(GDI_INTERNAL)
  227. DECLARE_HANDLE(HPALETTE);
  228. DECLARE_HANDLE(HPEN);
  229. #endif
  230. DECLARE_HANDLE(HRGN);
  231. DECLARE_HANDLE(HRSRC);
  232. DECLARE_HANDLE(HSTR);
  233. DECLARE_HANDLE(HTASK);
  234. DECLARE_HANDLE(HWINSTA);
  235. DECLARE_HANDLE(HKL);
  236. ;begin_winver_500
  237. #ifndef _MAC
  238. DECLARE_HANDLE(HMONITOR);
  239. DECLARE_HANDLE(HWINEVENTHOOK);
  240. #endif
  241. DECLARE_HANDLE(HUMPD);
  242. ;end_winver_500
  243. #ifndef _MAC
  244. typedef int HFILE;
  245. typedef HICON HCURSOR; /* HICONs & HCURSORs are polymorphic */
  246. #else
  247. typedef short HFILE;
  248. DECLARE_HANDLE(HCURSOR); /* HICONs & HCURSORs are not polymorphic */
  249. #endif
  250. typedef DWORD COLORREF;
  251. typedef DWORD *LPCOLORREF;
  252. #define HFILE_ERROR ((HFILE)-1)
  253. typedef struct tagRECT
  254. {
  255. LONG left;
  256. LONG top;
  257. LONG right;
  258. LONG bottom;
  259. } RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
  260. typedef const RECT FAR* LPCRECT;
  261. typedef struct _RECTL /* rcl */
  262. {
  263. LONG left;
  264. LONG top;
  265. LONG right;
  266. LONG bottom;
  267. } RECTL, *PRECTL, *LPRECTL;
  268. typedef const RECTL FAR* LPCRECTL;
  269. typedef struct tagPOINT
  270. {
  271. LONG x;
  272. LONG y;
  273. } POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;
  274. typedef struct _POINTL /* ptl */
  275. {
  276. LONG x;
  277. LONG y;
  278. } POINTL, *PPOINTL;
  279. typedef struct tagSIZE
  280. {
  281. LONG cx;
  282. LONG cy;
  283. } SIZE, *PSIZE, *LPSIZE;
  284. typedef SIZE SIZEL;
  285. typedef SIZE *PSIZEL, *LPSIZEL;
  286. typedef struct tagPOINTS
  287. {
  288. #ifndef _MAC
  289. SHORT x;
  290. SHORT y;
  291. #else
  292. SHORT y;
  293. SHORT x;
  294. #endif
  295. } POINTS, *PPOINTS, *LPPOINTS;
  296. //
  297. // File System time stamps are represented with the following structure:
  298. //
  299. typedef struct _FILETIME {
  300. DWORD dwLowDateTime;
  301. DWORD dwHighDateTime;
  302. } FILETIME, *PFILETIME, *LPFILETIME;
  303. #define _FILETIME_
  304. /* mode selections for the device mode function */
  305. #define DM_UPDATE 1
  306. #define DM_COPY 2
  307. #define DM_PROMPT 4
  308. #define DM_MODIFY 8
  309. #define DM_IN_BUFFER DM_MODIFY
  310. #define DM_IN_PROMPT DM_PROMPT
  311. #define DM_OUT_BUFFER DM_COPY
  312. #define DM_OUT_DEFAULT DM_UPDATE
  313. /* device capabilities indices */
  314. #define DC_FIELDS 1
  315. #define DC_PAPERS 2
  316. #define DC_PAPERSIZE 3
  317. #define DC_MINEXTENT 4
  318. #define DC_MAXEXTENT 5
  319. #define DC_BINS 6
  320. #define DC_DUPLEX 7
  321. #define DC_SIZE 8
  322. #define DC_EXTRA 9
  323. #define DC_VERSION 10
  324. #define DC_DRIVER 11
  325. #define DC_BINNAMES 12
  326. #define DC_ENUMRESOLUTIONS 13
  327. #define DC_FILEDEPENDENCIES 14
  328. #define DC_TRUETYPE 15
  329. #define DC_PAPERNAMES 16
  330. #define DC_ORIENTATION 17
  331. #define DC_COPIES 18
  332. #ifdef __cplusplus
  333. }
  334. #endif
  335. #endif /* _WINDEF_ */