Source code of Windows XP (NT5)
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.

424 lines
9.9 KiB

  1. // do not edit: generated from system headerfile
  2. // basic type and macro definitions elided; see lmuitype.h
  3. #ifndef NOBASICTYPES
  4. /***************************************************************************\
  5. *
  6. * Module Name: OS2DEF.H
  7. *
  8. * OS/2 Common Definitions file
  9. *
  10. * Copyright (c) 1987-1990, Microsoft Corporation. All rights reserved.
  11. *
  12. \***************************************************************************/
  13. #define OS2DEF_INCLUDED
  14. /* XLATOFF */
  15. #define PASCAL pascal
  16. #define FAR far
  17. #define NEAR near
  18. #define VOID void
  19. /* XLATON */
  20. typedef unsigned short SHANDLE;
  21. typedef void far *LHANDLE;
  22. /* XLATOFF */
  23. #define EXPENTRY pascal far _loadds
  24. #define APIENTRY pascal far
  25. /* Backwards compatability with 1.1 */
  26. #define CALLBACK pascal far _loadds
  27. #define CHAR char /* ch */
  28. #define SHORT short /* s */
  29. #define LONG long /* l */
  30. #ifndef INCL_SAADEFS
  31. #define INT int /* i */
  32. #endif /* !INCL_SAADEFS */
  33. /* XLATON */
  34. typedef unsigned char UCHAR; /* uch */
  35. typedef unsigned short USHORT; /* us */
  36. typedef unsigned long ULONG; /* ul */
  37. #ifndef INCL_SAADEFS
  38. typedef unsigned int UINT; /* ui */
  39. #endif /* !INCL_SAADEFS */
  40. typedef unsigned char BYTE; /* b */
  41. /* define NULL pointer value */
  42. /* Echo the format of the ifdefs that stdio.h uses */
  43. #if (_MSC_VER >= 600)
  44. #define NULL ((void *)0)
  45. #else
  46. #if (defined(M_I86L) || defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
  47. #define NULL 0L
  48. #else
  49. #define NULL 0
  50. #endif
  51. #endif
  52. typedef SHANDLE HFILE; /* hf */
  53. typedef HFILE far *PHFILE;
  54. typedef unsigned char far *PSZ;
  55. typedef unsigned char near *NPSZ;
  56. typedef unsigned char far *PCH;
  57. typedef unsigned char near *NPCH;
  58. typedef int (pascal far *PFN)();
  59. typedef int (pascal near *NPFN)();
  60. typedef PFN far *PPFN;
  61. typedef BYTE FAR *PBYTE;
  62. typedef BYTE near *NPBYTE;
  63. typedef CHAR FAR *PCHAR;
  64. typedef SHORT FAR *PSHORT;
  65. typedef LONG FAR *PLONG;
  66. #ifndef INCL_SAADEFS
  67. typedef INT FAR *PINT;
  68. #endif /* !INCL_SAADEFS */
  69. typedef UCHAR FAR *PUCHAR;
  70. typedef USHORT FAR *PUSHORT;
  71. typedef ULONG FAR *PULONG;
  72. #ifndef INCL_SAADEFS
  73. typedef UINT FAR *PUINT;
  74. #endif /* !INCL_SAADEFS */
  75. typedef VOID FAR *PVOID;
  76. typedef unsigned short BOOL; /* f */
  77. typedef BOOL FAR *PBOOL;
  78. #ifndef TRUE
  79. #define TRUE 1
  80. #endif
  81. #ifndef FALSE
  82. #define FALSE 0
  83. #endif
  84. #ifndef INCL_SAADEFS
  85. typedef unsigned short SEL; /* sel */
  86. typedef SEL FAR *PSEL;
  87. /*** Useful Helper Macros */
  88. /* Create untyped far pointer from selector and offset */
  89. #define MAKEP(sel, off) ((PVOID)MAKEULONG(off, sel))
  90. /* Extract selector or offset from far pointer */
  91. #define SELECTOROF(p) (((PUSHORT)&(p))[1])
  92. #define OFFSETOF(p) (((PUSHORT)&(p))[0])
  93. #endif /* !INCL_SAADEFS */
  94. /* Cast any variable to an instance of the specified type. */
  95. #define MAKETYPE(v, type) (*((type far *)&v))
  96. /* Calculate the byte offset of a field in a structure of type type. */
  97. #define FIELDOFFSET(type, field) ((SHORT)&(((type *)0)->field))
  98. /* Combine l & h to form a 32 bit quantity. */
  99. #define MAKEULONG(l, h) ((ULONG)(((USHORT)(l)) | ((ULONG)((USHORT)(h))) << 16))
  100. #define MAKELONG(l, h) ((LONG)MAKEULONG(l, h))
  101. /* Combine l & h to form a 16 bit quantity. */
  102. #define MAKEUSHORT(l, h) (((USHORT)(l)) | ((USHORT)(h)) << 8)
  103. #define MAKESHORT(l, h) ((SHORT)MAKEUSHORT(l, h))
  104. /* Extract high and low order parts of 16 and 32 bit quantity */
  105. #define LOBYTE(w) LOUCHAR(w)
  106. #define HIBYTE(w) HIUCHAR(w)
  107. #define LOUCHAR(w) ((UCHAR)(USHORT)(w))
  108. #define HIUCHAR(w) ((UCHAR)(((USHORT)(w) >> 8) & 0xff))
  109. #define LOUSHORT(l) ((USHORT)(ULONG)(l))
  110. #define HIUSHORT(l) ((USHORT)(((ULONG)(l) >> 16) & 0xffff))
  111. #endif // NOBASICTYPES
  112. /*** Common Error definitions ****/
  113. typedef ULONG ERRORID; /* errid */
  114. typedef ERRORID FAR *PERRORID;
  115. /* Combine severity and error code to produce ERRORID */
  116. #define MAKEERRORID(sev, error) (ERRORID)(MAKEULONG((error), (sev)))
  117. /* Extract error number from an errorid */
  118. #define ERRORIDERROR(errid) (LOUSHORT(errid))
  119. /* Extract severity from an errorid */
  120. #define ERRORIDSEV(errid) (HIUSHORT(errid))
  121. /* Severity codes */
  122. #define SEVERITY_NOERROR 0x0000
  123. #define SEVERITY_WARNING 0x0004
  124. #define SEVERITY_ERROR 0x0008
  125. #define SEVERITY_SEVERE 0x000C
  126. #define SEVERITY_UNRECOVERABLE 0x0010
  127. /* Base component error values */
  128. #define WINERR_BASE 0x1000 /* Window Manager */
  129. #define GPIERR_BASE 0x2000 /* Graphics Presentation Interface */
  130. #define DEVERR_BASE 0x3000 /* Device Manager */
  131. #define SPLERR_BASE 0x4000 /* Spooler */
  132. /*** Common types used across components */
  133. /*** Common DOS types */
  134. typedef USHORT HMODULE; /* hmod */
  135. typedef HMODULE FAR *PHMODULE;
  136. #ifndef INCL_SAADEFS
  137. typedef USHORT PID; /* pid */
  138. typedef PID FAR *PPID;
  139. typedef USHORT TID; /* tid */
  140. typedef TID FAR *PTID;
  141. typedef VOID FAR *HSEM; /* hsem */
  142. typedef HSEM FAR *PHSEM;
  143. #endif /* !INCL_SAADEFS */
  144. /*** Common SUP types */
  145. typedef LHANDLE HAB; /* hab */
  146. typedef HAB FAR *PHAB;
  147. /*** Common GPI/DEV types */
  148. typedef LHANDLE HPS; /* hps */
  149. typedef HPS FAR *PHPS;
  150. typedef LHANDLE HDC; /* hdc */
  151. typedef HDC FAR *PHDC;
  152. typedef LHANDLE HRGN; /* hrgn */
  153. typedef HRGN FAR *PHRGN;
  154. typedef LHANDLE HBITMAP; /* hbm */
  155. typedef HBITMAP FAR *PHBITMAP;
  156. typedef LHANDLE HMF; /* hmf */
  157. typedef HMF FAR *PHMF;
  158. typedef LONG COLOR; /* clr */
  159. typedef COLOR FAR *PCOLOR;
  160. typedef struct _POINTL { /* ptl */
  161. LONG x;
  162. LONG y;
  163. } POINTL;
  164. typedef POINTL FAR *PPOINTL;
  165. typedef POINTL near *NPPOINTL;
  166. typedef struct _POINTS { /* pts */
  167. SHORT x;
  168. SHORT y;
  169. } POINTS;
  170. typedef POINTS FAR *PPOINTS;
  171. typedef struct _RECTL { /* rcl */
  172. LONG xLeft;
  173. LONG yBottom;
  174. LONG xRight;
  175. LONG yTop;
  176. } RECTL;
  177. typedef RECTL FAR *PRECTL;
  178. typedef RECTL near *NPRECTL;
  179. typedef CHAR STR8[8]; /* str8 */
  180. typedef STR8 FAR *PSTR8;
  181. /*** common DEV/SPL types */
  182. /* structure for Device Driver data */
  183. typedef struct _DRIVDATA { /* driv */
  184. LONG cb;
  185. LONG lVersion;
  186. CHAR szDeviceName[32];
  187. CHAR abGeneralData[1];
  188. } DRIVDATA;
  189. typedef DRIVDATA far *PDRIVDATA;
  190. /* array indices for array parameter for DevOpenDC, SplQmOpen or SplQpOpen */
  191. #define ADDRESS 0
  192. #ifndef INCL_SAADEFS
  193. #define DRIVER_NAME 1
  194. #define DRIVER_DATA 2
  195. #define DATA_TYPE 3
  196. #define COMMENT 4
  197. #define PROC_NAME 5
  198. #define PROC_PARAMS 6
  199. #define SPL_PARAMS 7
  200. #define NETWORK_PARAMS 8
  201. #endif /* !INCL_SAADEFS */
  202. /* structure definition as an alternative of the array parameter */
  203. typedef struct _DEVOPENSTRUC { /* dop */
  204. PSZ pszLogAddress;
  205. PSZ pszDriverName;
  206. PDRIVDATA pdriv;
  207. PSZ pszDataType;
  208. PSZ pszComment;
  209. PSZ pszQueueProcName;
  210. PSZ pszQueueProcParams;
  211. PSZ pszSpoolerParams;
  212. PSZ pszNetworkParams;
  213. } DEVOPENSTRUC;
  214. typedef DEVOPENSTRUC FAR *PDEVOPENSTRUC;
  215. /*** common AVIO/GPI types */
  216. /* values of fsSelection field of FATTRS structure */
  217. #define FATTR_SEL_ITALIC 0x0001
  218. #define FATTR_SEL_UNDERSCORE 0x0002
  219. #define FATTR_SEL_OUTLINE 0x0008 /* Hollow Outline Font */
  220. #define FATTR_SEL_STRIKEOUT 0x0010
  221. #define FATTR_SEL_BOLD 0x0020
  222. /* values of fsType field of FATTRS structure */
  223. #define FATTR_TYPE_KERNING 0x0004
  224. #define FATTR_TYPE_MBCS 0x0008
  225. #define FATTR_TYPE_DBCS 0x0010
  226. #define FATTR_TYPE_ANTIALIASED 0x0020
  227. /* values of fsFontUse field of FATTRS structure */
  228. #define FATTR_FONTUSE_NOMIX 0x0002
  229. #define FATTR_FONTUSE_OUTLINE 0x0004
  230. #define FATTR_FONTUSE_TRANSFORMABLE 0x0008
  231. /* size for fields in the font structures */
  232. #define FACESIZE 32
  233. /* font struct for Vio/GpiCreateLogFont */
  234. typedef struct _FATTRS { /* fat */
  235. USHORT usRecordLength;
  236. USHORT fsSelection;
  237. LONG lMatch;
  238. CHAR szFacename[FACESIZE];
  239. USHORT idRegistry;
  240. USHORT usCodePage;
  241. LONG lMaxBaselineExt;
  242. LONG lAveCharWidth;
  243. USHORT fsType;
  244. USHORT fsFontUse;
  245. } FATTRS;
  246. typedef FATTRS far *PFATTRS;
  247. /* values of fsType field of FONTMETRICS structure */
  248. #define FM_TYPE_FIXED 0x0001
  249. #define FM_TYPE_LICENSED 0x0002
  250. #define FM_TYPE_KERNING 0x0004
  251. #define FM_TYPE_DBCS 0x0010
  252. #define FM_TYPE_MBCS 0x0018
  253. #define FM_TYPE_64K 0x8000
  254. /* values of fsDefn field of FONTMETRICS structure */
  255. #define FM_DEFN_OUTLINE 0x0001
  256. #define FM_DEFN_GENERIC 0x8000
  257. /* values of fsSelection field of FONTMETRICS structure */
  258. #define FM_SEL_ITALIC 0x0001
  259. #define FM_SEL_UNDERSCORE 0x0002
  260. #define FM_SEL_NEGATIVE 0x0004
  261. #define FM_SEL_OUTLINE 0x0008 /* Hollow Outline Font */
  262. #define FM_SEL_STRIKEOUT 0x0010
  263. #define FM_SEL_BOLD 0x0020
  264. /* values of fsCapabilities field of FONTMETRICS structure */
  265. #define FM_CAP_NOMIX 0x0001
  266. /* font metrics returned by GpiQueryFonts and others */
  267. typedef struct _FONTMETRICS { /* fm */
  268. CHAR szFamilyname[FACESIZE];
  269. CHAR szFacename[FACESIZE];
  270. USHORT idRegistry;
  271. USHORT usCodePage;
  272. LONG lEmHeight;
  273. LONG lXHeight;
  274. LONG lMaxAscender;
  275. LONG lMaxDescender;
  276. LONG lLowerCaseAscent;
  277. LONG lLowerCaseDescent;
  278. LONG lInternalLeading;
  279. LONG lExternalLeading;
  280. LONG lAveCharWidth;
  281. LONG lMaxCharInc;
  282. LONG lEmInc;
  283. LONG lMaxBaselineExt;
  284. SHORT sCharSlope;
  285. SHORT sInlineDir;
  286. SHORT sCharRot;
  287. USHORT usWeightClass;
  288. USHORT usWidthClass;
  289. SHORT sXDeviceRes;
  290. SHORT sYDeviceRes;
  291. SHORT sFirstChar;
  292. SHORT sLastChar;
  293. SHORT sDefaultChar;
  294. SHORT sBreakChar;
  295. SHORT sNominalPointSize;
  296. SHORT sMinimumPointSize;
  297. SHORT sMaximumPointSize;
  298. USHORT fsType;
  299. USHORT fsDefn;
  300. USHORT fsSelection;
  301. USHORT fsCapabilities;
  302. LONG lSubscriptXSize;
  303. LONG lSubscriptYSize;
  304. LONG lSubscriptXOffset;
  305. LONG lSubscriptYOffset;
  306. LONG lSuperscriptXSize;
  307. LONG lSuperscriptYSize;
  308. LONG lSuperscriptXOffset;
  309. LONG lSuperscriptYOffset;
  310. LONG lUnderscoreSize;
  311. LONG lUnderscorePosition;
  312. LONG lStrikeoutSize;
  313. LONG lStrikeoutPosition;
  314. SHORT sKerningPairs;
  315. SHORT sFamilyClass;
  316. LONG lMatch;
  317. } FONTMETRICS;
  318. typedef FONTMETRICS far *PFONTMETRICS;
  319. /*** Common WIN types */
  320. typedef LHANDLE HWND; /* hwnd */
  321. typedef HWND FAR *PHWND;
  322. typedef struct _WRECT { /* wrc */
  323. SHORT xLeft;
  324. SHORT dummy1;
  325. SHORT yBottom;
  326. SHORT dummy2;
  327. SHORT xRight;
  328. SHORT dummy3;
  329. SHORT yTop;
  330. SHORT dummy4;
  331. } WRECT;
  332. typedef WRECT FAR *PWRECT;
  333. typedef WRECT near *NPWRECT;
  334. typedef struct _WPOINT { /* wpt */
  335. SHORT x;
  336. SHORT dummy1;
  337. SHORT y;
  338. SHORT dummy2;
  339. } WPOINT;
  340. typedef WPOINT FAR *PWPOINT;
  341. typedef WPOINT near *NPWPOINT;