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.

604 lines
19 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: ntgdistr.h
  3. *
  4. * Copyright (c) Microsoft Corporation. All rights reserved.
  5. \**************************************************************************/
  6. // PUBLIC Structures and constants
  7. typedef enum _ARCTYPE
  8. {
  9. ARCTYPE_ARC = 0,
  10. ARCTYPE_ARCTO,
  11. ARCTYPE_CHORD,
  12. ARCTYPE_PIE,
  13. ARCTYPE_MAX
  14. } ARCTYPE;
  15. //
  16. // Font Types
  17. //
  18. typedef enum _LFTYPE {
  19. LF_TYPE_USER, // user (defined by APP)
  20. LF_TYPE_SYSTEM, // system stock font
  21. LF_TYPE_SYSTEM_FIXED, // system fixed pitch stock font
  22. LF_TYPE_OEM, // oem (terminal) stock font
  23. LF_TYPE_DEVICE_DEFAULT, // device default stock font
  24. LF_TYPE_ANSI_VARIABLE, // ANSI variable pitch stock font
  25. LF_TYPE_ANSI_FIXED, // ANSI fixed pitch stock font
  26. LF_TYPE_DEFAULT_GUI // default GUI stock font
  27. } LFTYPE;
  28. // for GetDCDWord
  29. #define DDW_JOURNAL 0
  30. #define DDW_RELABS 1
  31. #define DDW_BREAKEXTRA 2
  32. #define DDW_CBREAK 3
  33. #define DDW_ARCDIRECTION 4
  34. #define DDW_SAVEDEPTH 5
  35. #define DDW_FONTLANGUAGEINFO 6
  36. #define DDW_ISMEMDC 7
  37. #define DDW_MAPMODE 8
  38. #define DDW_TEXTCHARACTEREXTRA 9
  39. #define DDW_MAX 10 // must equal highest DDW_XXXXX plus one
  40. // for GetAndSetDCDword
  41. #define GASDDW_EPSPRINTESCCALLED 1
  42. #define GASDDW_COPYCOUNT 2
  43. #define GASDDW_TEXTALIGN 3
  44. #define GASDDW_RELABS 4
  45. #define GASDDW_TEXTCHARACTEREXTRA 5
  46. #define GASDDW_SELECTFONT 6
  47. #define GASDDW_MAPPERFLAGS 7
  48. #define GASDDW_MAPMODE 8
  49. #define GASDDW_ARCDIRECTION 9
  50. #define GASDDW_MAX 10 // must equal highest GASDDW_XXXXX plus one
  51. // for GetDCPoint
  52. #define DCPT_VPEXT 1
  53. #define DCPT_WNDEXT 2
  54. #define DCPT_VPORG 3
  55. #define DCPT_WNDORG 4
  56. #define DCPT_ASPECTRATIOFILTER 5
  57. #define DCPT_DCORG 6
  58. #define DCPT_MAX 7 // must equal highest DCPT_XXXXX plus one
  59. // for GetAndSetDCPoint
  60. #define GASDCPT_CURRENTPOSITION 1
  61. #define GASDCPT_MAX 2 // must equal highest GASDCPT_XXXXX plus one
  62. // private ModifyWorldTransform modes
  63. #define MWT_SET (MWT_MAX+1)
  64. // modes from converting points
  65. #define XFP_DPTOLP 0
  66. #define XFP_LPTODP 1
  67. #define XFP_LPTODPFX 2
  68. //BUGBUG private devcaps for client side xform's
  69. #define HORZSIZEM (int)0x80000000
  70. #define VERTSIZEM (int)0x80000002
  71. //
  72. // Object identifiers
  73. //
  74. #define MFEN_IDENTIFIER 0x5845464D /* 'MFEN' */
  75. #define MFPICT_IDENTIFIER 0x5F50464D /* 'MFP_' */
  76. //
  77. // Object types, used for handles.
  78. //
  79. // Note: When modifying this list, also please modify list in hmgrapi.cxx!
  80. //
  81. #define DEF_TYPE 0
  82. #define DC_TYPE 1
  83. #define UNUSED1_TYPE 2 // Unused
  84. #define UNUSED2_TYPE 3 // Unused
  85. #define RGN_TYPE 4
  86. #define SURF_TYPE 5
  87. #define CLIENTOBJ_TYPE 6
  88. #define PATH_TYPE 7
  89. #define PAL_TYPE 8
  90. #define ICMLCS_TYPE 9
  91. #define LFONT_TYPE 10
  92. #define RFONT_TYPE 11
  93. #define PFE_TYPE 12
  94. #define PFT_TYPE 13
  95. #define ICMCXF_TYPE 14
  96. #define SPRITE_TYPE 15
  97. #define BRUSH_TYPE 16
  98. #define UMPD_TYPE 17
  99. #define UNUSED4_TYPE 18 // Unused
  100. #define SPACE_TYPE 19
  101. #define UNUSED5_TYPE 20 // Unused
  102. #define META_TYPE 21
  103. #define EFSTATE_TYPE 22
  104. #define BMFD_TYPE 23 // Unused
  105. #define VTFD_TYPE 24 // Unused
  106. #define TTFD_TYPE 25 // Unused
  107. #define RC_TYPE 26 // Unused
  108. #define TEMP_TYPE 27 // Unused
  109. #define DRVOBJ_TYPE 28
  110. #define DCIOBJ_TYPE 29 // Unused
  111. #define SPOOL_TYPE 30
  112. #define MAX_TYPE 30 // Don't go over 31 -- limited by TYPE_BITS
  113. // SAMEHANDLE/DIFFHANDLE macros
  114. //
  115. // These macros should be used to compare engine handles (such as HDCs, etc),
  116. // when insensitivity to the user defined bits are needed.
  117. // BUGBUG - this should be accessible to USER
  118. #define SAMEHANDLE(H,K) (H == K)
  119. #define DIFFHANDLE(H,K) (H != K)
  120. // the following define the format of GDI handles. Any information that is needed
  121. // for the type is here. All other handle information is in gre\hmgr.h.
  122. #define INDEX_BITS 16
  123. #define TYPE_BITS 5
  124. #define ALTTYPE_BITS 2
  125. #define STOCK_BITS 1
  126. #define UNIQUE_BITS 8
  127. #define TYPE_SHIFT (INDEX_BITS)
  128. #define ALTTYPE_SHIFT (TYPE_SHIFT + TYPE_BITS)
  129. #define STOCK_SHIFT (ALTTYPE_SHIFT + ALTTYPE_BITS)
  130. #define MAX_HANDLE_COUNT 0x10000
  131. #define MIN_HANDLE_QUOTA 0x100
  132. #define INITIAL_HANDLE_QUOTA 0x3000
  133. #define MAKE_HMGR_HANDLE(Index,Unique) LongToHandle(((((LONG) Unique) << INDEX_BITS) | ((LONG) Index)))
  134. #define FULLUNIQUE_MASK 0xffff0000
  135. #define FULLUNIQUE_STOCK_MASK (1 << (TYPE_BITS+ALTTYPE_BITS))
  136. // if the GDISTOCKOBJ bit is set in a handle, it is a stock object.
  137. #define GDISTOCKOBJ (1 << STOCK_SHIFT)
  138. #define IS_STOCKOBJ(h) ((ULONG_PTR)(h) & GDISTOCKOBJ)
  139. // LO_TYPE(h) returns the client side type given a GRE handle.
  140. // GRE_TYPE(h) returns the gre side type given a client type
  141. #define LO_TYPE(h) (DWORD)((ULONG_PTR)(h) & (((1 << (TYPE_BITS + ALTTYPE_BITS)) - 1) << TYPE_SHIFT))
  142. #define GRE_TYPE(h) (DWORD)(((ULONG_PTR)(h) >> INDEX_BITS) & ((1 << TYPE_BITS) - 1))
  143. // ALTTYPEx are modifiers to distinguish client side object types that all map to
  144. // a single server side type. BRUSH_TYPE maps to LO_BRUSH_TYPE, LO_PEN_TYPE and LO_EXTPEN_TYPE
  145. #define ALTTYPE1 (1 << ALTTYPE_SHIFT)
  146. #define ALTTYPE2 (2 << ALTTYPE_SHIFT)
  147. #define ALTTYPE3 (3 << ALTTYPE_SHIFT)
  148. #define LO_BRUSH_TYPE (BRUSH_TYPE << TYPE_SHIFT)
  149. #define LO_DC_TYPE (DC_TYPE << TYPE_SHIFT)
  150. #define LO_BITMAP_TYPE (SURF_TYPE << TYPE_SHIFT)
  151. #define LO_PALETTE_TYPE (PAL_TYPE << TYPE_SHIFT)
  152. #define LO_FONT_TYPE (LFONT_TYPE << TYPE_SHIFT)
  153. #define LO_REGION_TYPE (RGN_TYPE << TYPE_SHIFT)
  154. #define LO_ICMLCS_TYPE (ICMLCS_TYPE << TYPE_SHIFT)
  155. #define LO_CLIENTOBJ_TYPE (CLIENTOBJ_TYPE << TYPE_SHIFT)
  156. #define LO_ALTDC_TYPE (LO_DC_TYPE | ALTTYPE1)
  157. #define LO_PEN_TYPE (LO_BRUSH_TYPE | ALTTYPE1)
  158. #define LO_EXTPEN_TYPE (LO_BRUSH_TYPE | ALTTYPE2)
  159. #define LO_DIBSECTION_TYPE (LO_BITMAP_TYPE | ALTTYPE1)
  160. #define LO_METAFILE16_TYPE (LO_CLIENTOBJ_TYPE | ALTTYPE1)
  161. #define LO_METAFILE_TYPE (LO_CLIENTOBJ_TYPE | ALTTYPE2)
  162. #define LO_METADC16_TYPE (LO_CLIENTOBJ_TYPE | ALTTYPE3)
  163. //
  164. // Format of HGDIOBJ typedef'ed so it
  165. // is available in the symbol file.
  166. //
  167. typedef struct {
  168. ULONG_PTR Index:INDEX_BITS;
  169. ULONG_PTR Type:TYPE_BITS;
  170. ULONG_PTR AltType:ALTTYPE_BITS;
  171. ULONG_PTR Stock:STOCK_BITS;
  172. ULONG_PTR Unique:UNIQUE_BITS;
  173. } GDIHandleBitFields;
  174. //
  175. // Enum of object types so the values
  176. // are available in the symbol file.
  177. //
  178. #define ENUMObjType(type) GDIObjType_##type = type
  179. typedef enum {
  180. ENUMObjType(DEF_TYPE),
  181. ENUMObjType(DC_TYPE),
  182. ENUMObjType(UNUSED1_TYPE),
  183. ENUMObjType(UNUSED2_TYPE),
  184. ENUMObjType(RGN_TYPE),
  185. ENUMObjType(SURF_TYPE),
  186. ENUMObjType(CLIENTOBJ_TYPE),
  187. ENUMObjType(PATH_TYPE),
  188. ENUMObjType(PAL_TYPE),
  189. ENUMObjType(ICMLCS_TYPE),
  190. ENUMObjType(LFONT_TYPE),
  191. ENUMObjType(RFONT_TYPE),
  192. ENUMObjType(PFE_TYPE),
  193. ENUMObjType(PFT_TYPE),
  194. ENUMObjType(ICMCXF_TYPE),
  195. ENUMObjType(SPRITE_TYPE),
  196. ENUMObjType(BRUSH_TYPE),
  197. ENUMObjType(UMPD_TYPE),
  198. ENUMObjType(UNUSED4_TYPE),
  199. ENUMObjType(SPACE_TYPE),
  200. ENUMObjType(UNUSED5_TYPE),
  201. ENUMObjType(META_TYPE),
  202. ENUMObjType(EFSTATE_TYPE),
  203. ENUMObjType(BMFD_TYPE),
  204. ENUMObjType(VTFD_TYPE),
  205. ENUMObjType(TTFD_TYPE),
  206. ENUMObjType(RC_TYPE),
  207. ENUMObjType(TEMP_TYPE),
  208. ENUMObjType(DRVOBJ_TYPE),
  209. ENUMObjType(DCIOBJ_TYPE),
  210. ENUMObjType(SPOOL_TYPE),
  211. ENUMObjType(MAX_TYPE),
  212. GDIObjTypeTotal
  213. } GDIObjType;
  214. #define ENUMLoObjType(type) GDILoObjType_##type = type
  215. typedef enum {
  216. ENUMLoObjType(LO_BRUSH_TYPE),
  217. ENUMLoObjType(LO_DC_TYPE),
  218. ENUMLoObjType(LO_BITMAP_TYPE),
  219. ENUMLoObjType(LO_PALETTE_TYPE),
  220. ENUMLoObjType(LO_FONT_TYPE),
  221. ENUMLoObjType(LO_REGION_TYPE),
  222. ENUMLoObjType(LO_ICMLCS_TYPE),
  223. ENUMLoObjType(LO_CLIENTOBJ_TYPE),
  224. ENUMLoObjType(LO_ALTDC_TYPE),
  225. ENUMLoObjType(LO_PEN_TYPE),
  226. ENUMLoObjType(LO_EXTPEN_TYPE),
  227. ENUMLoObjType(LO_DIBSECTION_TYPE),
  228. ENUMLoObjType(LO_METAFILE16_TYPE),
  229. ENUMLoObjType(LO_METAFILE_TYPE),
  230. ENUMLoObjType(LO_METADC16_TYPE),
  231. } GDILoObjType;
  232. // fl values for CreateDIBitmapInternal
  233. #define CDBI_INTERNAL 0x0001
  234. #define CDBI_DIBSECTION 0x0002
  235. #define CDBI_NOPALETTE 0x0004
  236. // The UFI allows us to identify four different items:
  237. //
  238. // Device Fonts: CheckSum = 0 and Index identifies the printer driver index of font to
  239. // use. Since we assume drivers are identical on both machines we can
  240. // rely on Index being enough to identify the font.
  241. //
  242. // Type1 Device Fonts: This refers to a Type1 font that has been installed on
  243. // the client machine and is enumerated by the postcript driver
  244. // as a device font. In this case CheckSum = 1 and Index
  245. // is the checksum of the Type 1 font file.
  246. //
  247. // Type1 Rasterizer: This item identifies not a font, but a Type1 rasterizer.
  248. // Here CheckSum = 2 and Index is the version number of the
  249. // Type1 rasterizer. A rasterizer with version number N supports
  250. // fonts used by a rasterizers with versions 0-N. If a rasterizer
  251. // exists on a server, this UFI MUST appear FIRST in the list of
  252. // UFI's returned to the client.
  253. //
  254. // Engine Font: This includes bitmap, vector, TT, and Type1 fonts rasterized by
  255. // a Type1 rasterizer. Here CheckSum is a checksum of the font file
  256. // and Index is the index of the face in the font file.
  257. #define DEVICE_FONT_TYPE 0
  258. #define TYPE1_FONT_TYPE 1
  259. #define TYPE1_RASTERIZER 2
  260. #define A_VALID_ENGINE_CHECKSUM 3
  261. #define UFI_DEVICE_FONT(pufi) ((pufi)->CheckSum == DEVICE_FONT_TYPE)
  262. #define UFI_TYPE1_FONT(pufi) ((pufi)->CheckSum == TYPE1_FONT_TYPE)
  263. #define UFI_TYPE1_RASTERIZER(pufi) ((pufi)->CheckSum == TYPE1_RASTERIZER)
  264. #define UFI_ENGINE_FONT(pufi) ((pufi)->CheckSum > TYPE1_RASTERIZER)
  265. #define UFI_HASH_VALUE(pufi) (((pufi)->CheckSum==TYPE1_FONT_TYPE) ? \
  266. (pufi)->Index : (pufi)->CheckSum )
  267. #define UFI_SAME_FACE(pufi1,pufi2) \
  268. (((pufi1)->CheckSum == (pufi2)->CheckSum) && ((pufi1)->Index == (pufi2)->Index))
  269. #define UFI_SAME_FILE(pufi1,pufi2) ((((pufi1)->CheckSum==TYPE1_FONT_TYPE) && ((pufi2)->CheckSum==TYPE1_FONT_TYPE)) ? \
  270. ((pufi1)->Index == (pufi2)->Index) : \
  271. ((pufi1)->CheckSum == (pufi2)->CheckSum))
  272. #define UFI_SAME_RASTERIZER_VERSION(pufiClient,pufiServer) \
  273. (((pufiClient)->CheckSum == (pufiServer)->CheckSum) && \
  274. ((pufiClient)->Index <= (pufiServer)->Index))
  275. #define UFI_CLEAR_ID(pufi) {(pufi)->CheckSum = (pufi)->Index = 0;}
  276. /*
  277. /**************************************************************************\
  278. *
  279. * // The pointer arithmetic for ENUMFONTDATAW is as follows:
  280. *
  281. * sizeof(ENUMLOGFONTEXW)+sizeof(data appended to logfont) =
  282. * dpNtmi - offsetof(ENUMFONTDATAW,u);
  283. *
  284. * sizeof(NTMW_INTERNAL) + sizeof(data appended to NTMW_INTERNAL) =
  285. * cjEfdw - dpNtmi;
  286. *
  287. * // typically, if we are talking about mm font we will have:
  288. *
  289. * data appended to logfont = design vector
  290. * data appended to NTMW_INTERNAL = full axes information
  291. *
  292. \**************************************************************************/
  293. #if (_WIN32_WINNT >= 0x0500)
  294. typedef struct _ENUMFONTDATAW { // efdw
  295. ULONG cjEfdw; // size of this structure
  296. ULONG dpNtmi; // offset to NTMW_INTERNAL from the top of efdw
  297. FLONG flType;
  298. ENUMLOGFONTEXDVW elfexw;
  299. // here follows NTMW_INTERNAL at the offset of dpNtmi
  300. } ENUMFONTDATAW, *PENUMFONTDATAW;
  301. #endif
  302. #define ALIGN4(X) (((X) + 3) & ~3)
  303. #define ALIGN8(X) (((X) + 7) & ~7)
  304. // here we define dpNtmi and cjEfdw for "regular", non multiple master fonts:
  305. #if (_WIN32_WINNT >= 0x0500)
  306. #define DP_NTMI0 ALIGN4(offsetof(ENUMFONTDATAW,elfexw) + offsetof(ENUMLOGFONTEXDVW,elfDesignVector) + offsetof(DESIGNVECTOR,dvValues))
  307. #endif
  308. #define CJ_NTMI0 ALIGN4(offsetof(NTMW_INTERNAL,entmw) + offsetof(ENUMTEXTMETRICW,etmAxesList) + offsetof(AXESLISTW,axlAxisInfo))
  309. #define CJ_EFDW0 (DP_NTMI0 + CJ_NTMI0)
  310. // ENUMFONTDATAW.flType internal values:
  311. //
  312. // ENUMFONT_SCALE_HACK [Win95 compat] Enumerate font back in several
  313. // sizes; mask out before doing callback to app.
  314. #define ENUMFONT_SCALE_HACK 0x80000000
  315. #define ENUMFONT_FLTYPE_MASK ( DEVICE_FONTTYPE | RASTER_FONTTYPE | TRUETYPE_FONTTYPE )
  316. // GreGetTextExtentW flags
  317. #define GGTE_WIN3_EXTENT 0x0001
  318. #define GGTE_GLYPH_INDEX 0x0002
  319. /******************************************************************************
  320. * stuff for client side text extents and charwidths
  321. ******************************************************************************/
  322. #define GCW_WIN3 0x00000001 // win3 bold simulation off-by-1 hack
  323. #define GCW_INT 0x00000002 // integer or float
  324. #define GCW_16BIT 0x00000004 // 16-bit or 32-bit widths
  325. #define GCW_GLYPH_INDEX 0x00000008 // input are glyph indices
  326. // stuff for GetCharABCWidths
  327. #define GCABCW_INT 0x00000001
  328. #define GCABCW_GLYPH_INDEX 0x00000002
  329. // stuff for GetTextExtentEx
  330. #define GTEEX_GLYPH_INDEX 0x0001
  331. /**************************************************************************\
  332. *
  333. * stuff from csgdi.h
  334. *
  335. \**************************************************************************/
  336. #define CJSCAN(width,planes,bits) ((((width)*(planes)*(bits)+31) & ~31) / 8)
  337. #define CJSCANW(width,planes,bits) ((((width)*(planes)*(bits)+15) & ~15) / 8)
  338. #define I_ANIMATEPALETTE 0
  339. #define I_SETPALETTEENTRIES 1
  340. #define I_GETPALETTEENTRIES 2
  341. #define I_GETSYSTEMPALETTEENTRIES 3
  342. #define I_GETDIBCOLORTABLE 4
  343. #define I_SETDIBCOLORTABLE 5
  344. #define I_POLYPOLYGON 1
  345. #define I_POLYPOLYLINE 2
  346. #define I_POLYBEZIER 3
  347. #define I_POLYLINETO 4
  348. #define I_POLYBEZIERTO 5
  349. #define I_POLYPOLYRGN 6
  350. HANDLE WINAPI SetObjectOwner(HGDIOBJ, HANDLE);
  351. // BUGBUG
  352. // RANDOM floating point stuff - try to cleanup later.
  353. // BUGBUG
  354. // We littered modules with __CPLUSPLUS to not conflict with efloat.hxx
  355. // efloat.hxx should more or less disappear.
  356. //
  357. #if defined(_AMD64_) || defined(_IA64_) || defined(BUILD_WOW6432)
  358. typedef FLOAT EFLOAT_S;
  359. #define EFLOAT_0 ((FLOAT) 0)
  360. #define EFLOAT_1Over16 ((FLOAT) 1/16)
  361. #define EFLOAT_1 ((FLOAT) 1)
  362. #define EFLOAT_16 ((FLOAT) 16)
  363. #ifndef __CPLUSPLUS
  364. extern LONG lCvtWithRound( FLOAT f, LONG l );
  365. #define efDivEFLOAT(x,y,z) (x=y/z)
  366. #define vAbsEFLOAT(x) {if (x<0.0f) x=-x;}
  367. #define vFxToEf(fx,ef) {ef = ((FLOAT) fx) / 16.0f;}
  368. #define vMulEFLOAT(x,y,z) {x=y*z;}
  369. #define lEfToF(x) (*(LONG *)(&x)) // Warning: FLOAT typed as LONG!
  370. #define bIsOneEFLOAT(x) (x==1.0f)
  371. #define bIsOneSixteenthEFLOAT(x) (x==0.0625f)
  372. #define bEqualEFLOAT(x,y) (x==y)
  373. #define lCvt(ef,ll) (lCvtWithRound(ef,ll))
  374. #endif
  375. #else
  376. typedef struct _EFLOAT_S
  377. {
  378. LONG lMant;
  379. LONG lExp;
  380. } EFLOAT_S;
  381. #define EFLOAT_0 {0, 0}
  382. #define EFLOAT_1Over16 {0x040000000, -2}
  383. #define EFLOAT_1 {0x040000000, 2}
  384. #define EFLOAT_16 {0x040000000, 6}
  385. #ifndef __CPLUSPLUS
  386. EFLOAT_S *mulff3_c(EFLOAT_S *,const EFLOAT_S *,const EFLOAT_S *);
  387. EFLOAT_S *divff3_c(EFLOAT_S *,const EFLOAT_S *,const EFLOAT_S *);
  388. VOID fxtoef_c(LONG,EFLOAT_S *);
  389. LONG eftof_c(EFLOAT_S *);
  390. #define efDivEFLOAT(x,y,z) (*divff3_c(&x,&y,&z))
  391. #define vAbsEFLOAT(x) {if (x.lMant<0) x.lMant=-x.lMant;}
  392. #define vFxToEf(fx,ef) (fxtoef_c(fx,&ef))
  393. #define vMulEFLOAT(x,y,z) {mulff3_c(&x,&y,&z);}
  394. #define lEfToF(x) (eftof_c(&x)) // Warning: FLOAT typed as LONG!
  395. #define bEqualEFLOAT(x,y) ((x.lMant==y.lMant)&&(x.lExp==y.lExp))
  396. #define bIsOneEFLOAT(x) ((x.lMant==0x40000000L)&&(x.lExp==2))
  397. #define bIsOneSixteenthEFLOAT(x) ((x.lMant==0x40000000L)&&(x.lExp==-2))
  398. LONG lCvt(EFLOAT_S,LONG);
  399. #endif
  400. #endif
  401. typedef struct _WIDTHDATA
  402. {
  403. USHORT sOverhang;
  404. USHORT sHeight;
  405. USHORT sCharInc;
  406. USHORT sBreak;
  407. BYTE iFirst;
  408. BYTE iLast;
  409. BYTE iBreak;
  410. BYTE iDefault;
  411. USHORT sDBCSInc;
  412. USHORT sDefaultInc;
  413. } WIDTHDATA;
  414. #define NO_WIDTH 0xFFFF
  415. typedef struct _DEVCAPS
  416. {
  417. ULONG ulVersion;
  418. ULONG ulTechnology;
  419. ULONG ulHorzSizeM;
  420. ULONG ulVertSizeM;
  421. ULONG ulHorzSize;
  422. ULONG ulVertSize;
  423. ULONG ulHorzRes;
  424. ULONG ulVertRes;
  425. ULONG ulBitsPixel;
  426. ULONG ulPlanes;
  427. ULONG ulNumPens;
  428. ULONG ulNumFonts;
  429. ULONG ulNumColors;
  430. ULONG ulRasterCaps;
  431. ULONG ulAspectX;
  432. ULONG ulAspectY;
  433. ULONG ulAspectXY;
  434. ULONG ulLogPixelsX;
  435. ULONG ulLogPixelsY;
  436. ULONG ulSizePalette;
  437. ULONG ulColorRes;
  438. ULONG ulPhysicalWidth;
  439. ULONG ulPhysicalHeight;
  440. ULONG ulPhysicalOffsetX;
  441. ULONG ulPhysicalOffsetY;
  442. ULONG ulTextCaps;
  443. ULONG ulVRefresh;
  444. ULONG ulDesktopHorzRes;
  445. ULONG ulDesktopVertRes;
  446. ULONG ulBltAlignment;
  447. ULONG ulPanningHorzRes;
  448. ULONG ulPanningVertRes;
  449. ULONG xPanningAlignment;
  450. ULONG yPanningAlignment;
  451. ULONG ulShadeBlendCaps;
  452. ULONG ulColorManagementCaps;
  453. } DEVCAPS, *PDEVCAPS;
  454. // This structure is a copy from d3dhal.h. We need it here to have exactly
  455. // the same offset for pvBuffer in D3DNTHAL_CONTEXTCREATEI
  456. typedef struct _D3DHAL_CONTEXTCREATEDATA_DUMMY
  457. {
  458. LPVOID lpDDGbl;
  459. LPVOID lpDDS;
  460. LPVOID lpDDSZ;
  461. LPVOID dwrstates;
  462. LPVOID dwhContext;
  463. HRESULT ddrval;
  464. } D3DHAL_CONTEXTCREATEDATA_DUMMY;
  465. // For D3D context creation information.
  466. typedef struct _D3DNTHAL_CONTEXTCREATEI
  467. {
  468. // Space for a D3DNTHAL_CONTEXTCREATE record.
  469. // The structure isn't directly declared here to
  470. // avoid header inclusion problems. This field
  471. // is asserted to be the same size as the actual type.
  472. D3DHAL_CONTEXTCREATEDATA_DUMMY ContextCreateData;
  473. // Private buffer information.
  474. PVOID pvBuffer;
  475. ULONG cjBuffer;
  476. } D3DNTHAL_CONTEXTCREATEI;
  477. //
  478. // D3D execute buffer batching declarations.
  479. //
  480. #define D3DEX_BATCH_SURFACE_MAX 4
  481. typedef struct _D3DEX_BATCH_HEADER
  482. {
  483. DWORD nSurfaces;
  484. DWORD pdds[D3DEX_BATCH_SURFACE_MAX];
  485. } D3DEX_BATCH_HEADER;
  486. #define D3DEX_BATCH_STATE 0
  487. #define D3DEX_BATCH_PRIMITIVE 1
  488. #define D3DEX_BATCH_PRIMITIVE_EXE 2