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.

604 lines
20 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 DEFAULT_HANDLE_QUOTA 0x02710
  132. #define MAKE_HMGR_HANDLE(Index,Unique) LongToHandle(((((LONG) Unique) << INDEX_BITS) | ((LONG) Index)))
  133. #define FULLUNIQUE_MASK 0xffff0000
  134. #define FULLUNIQUE_STOCK_MASK (1 << (TYPE_BITS+ALTTYPE_BITS))
  135. // if the GDISTOCKOBJ bit is set in a handle, it is a stock object.
  136. #define GDISTOCKOBJ (1 << STOCK_SHIFT)
  137. #define IS_STOCKOBJ(h) ((ULONG_PTR)(h) & GDISTOCKOBJ)
  138. // LO_TYPE(h) returns the client side type given a GRE handle.
  139. // GRE_TYPE(h) returns the gre side type given a client type
  140. #define LO_TYPE(h) (DWORD)((ULONG_PTR)(h) & (((1 << (TYPE_BITS + ALTTYPE_BITS)) - 1) << TYPE_SHIFT))
  141. #define GRE_TYPE(h) (DWORD)(((ULONG_PTR)(h) >> INDEX_BITS) & ((1 << TYPE_BITS) - 1))
  142. // ALTTYPEx are modifiers to distinguish client side object types that all map to
  143. // a single server side type. BRUSH_TYPE maps to LO_BRUSH_TYPE, LO_PEN_TYPE and LO_EXTPEN_TYPE
  144. #define ALTTYPE1 (1 << ALTTYPE_SHIFT)
  145. #define ALTTYPE2 (2 << ALTTYPE_SHIFT)
  146. #define ALTTYPE3 (3 << ALTTYPE_SHIFT)
  147. #define LO_BRUSH_TYPE (BRUSH_TYPE << TYPE_SHIFT)
  148. #define LO_DC_TYPE (DC_TYPE << TYPE_SHIFT)
  149. #define LO_BITMAP_TYPE (SURF_TYPE << TYPE_SHIFT)
  150. #define LO_PALETTE_TYPE (PAL_TYPE << TYPE_SHIFT)
  151. #define LO_FONT_TYPE (LFONT_TYPE << TYPE_SHIFT)
  152. #define LO_REGION_TYPE (RGN_TYPE << TYPE_SHIFT)
  153. #define LO_ICMLCS_TYPE (ICMLCS_TYPE << TYPE_SHIFT)
  154. #define LO_CLIENTOBJ_TYPE (CLIENTOBJ_TYPE << TYPE_SHIFT)
  155. #define LO_ALTDC_TYPE (LO_DC_TYPE | ALTTYPE1)
  156. #define LO_PEN_TYPE (LO_BRUSH_TYPE | ALTTYPE1)
  157. #define LO_EXTPEN_TYPE (LO_BRUSH_TYPE | ALTTYPE2)
  158. #define LO_DIBSECTION_TYPE (LO_BITMAP_TYPE | ALTTYPE1)
  159. #define LO_METAFILE16_TYPE (LO_CLIENTOBJ_TYPE | ALTTYPE1)
  160. #define LO_METAFILE_TYPE (LO_CLIENTOBJ_TYPE | ALTTYPE2)
  161. #define LO_METADC16_TYPE (LO_CLIENTOBJ_TYPE | ALTTYPE3)
  162. //
  163. // Format of HGDIOBJ typedef'ed so it
  164. // is available in the symbol file.
  165. //
  166. typedef struct {
  167. ULONG_PTR Index:INDEX_BITS;
  168. ULONG_PTR Type:TYPE_BITS;
  169. ULONG_PTR AltType:ALTTYPE_BITS;
  170. ULONG_PTR Stock:STOCK_BITS;
  171. ULONG_PTR Unique:UNIQUE_BITS;
  172. } GDIHandleBitFields;
  173. //
  174. // Enum of object types so the values
  175. // are available in the symbol file.
  176. //
  177. #define ENUMObjType(type) GDIObjType_##type = type
  178. typedef enum {
  179. ENUMObjType(DEF_TYPE),
  180. ENUMObjType(DC_TYPE),
  181. ENUMObjType(UNUSED1_TYPE),
  182. ENUMObjType(UNUSED2_TYPE),
  183. ENUMObjType(RGN_TYPE),
  184. ENUMObjType(SURF_TYPE),
  185. ENUMObjType(CLIENTOBJ_TYPE),
  186. ENUMObjType(PATH_TYPE),
  187. ENUMObjType(PAL_TYPE),
  188. ENUMObjType(ICMLCS_TYPE),
  189. ENUMObjType(LFONT_TYPE),
  190. ENUMObjType(RFONT_TYPE),
  191. ENUMObjType(PFE_TYPE),
  192. ENUMObjType(PFT_TYPE),
  193. ENUMObjType(ICMCXF_TYPE),
  194. ENUMObjType(SPRITE_TYPE),
  195. ENUMObjType(BRUSH_TYPE),
  196. ENUMObjType(UMPD_TYPE),
  197. ENUMObjType(UNUSED4_TYPE),
  198. ENUMObjType(SPACE_TYPE),
  199. ENUMObjType(UNUSED5_TYPE),
  200. ENUMObjType(META_TYPE),
  201. ENUMObjType(EFSTATE_TYPE),
  202. ENUMObjType(BMFD_TYPE),
  203. ENUMObjType(VTFD_TYPE),
  204. ENUMObjType(TTFD_TYPE),
  205. ENUMObjType(RC_TYPE),
  206. ENUMObjType(TEMP_TYPE),
  207. ENUMObjType(DRVOBJ_TYPE),
  208. ENUMObjType(DCIOBJ_TYPE),
  209. ENUMObjType(SPOOL_TYPE),
  210. ENUMObjType(MAX_TYPE),
  211. GDIObjTypeTotal
  212. } GDIObjType;
  213. #define ENUMLoObjType(type) GDILoObjType_##type = type
  214. typedef enum {
  215. ENUMLoObjType(LO_BRUSH_TYPE),
  216. ENUMLoObjType(LO_DC_TYPE),
  217. ENUMLoObjType(LO_BITMAP_TYPE),
  218. ENUMLoObjType(LO_PALETTE_TYPE),
  219. ENUMLoObjType(LO_FONT_TYPE),
  220. ENUMLoObjType(LO_REGION_TYPE),
  221. ENUMLoObjType(LO_ICMLCS_TYPE),
  222. ENUMLoObjType(LO_CLIENTOBJ_TYPE),
  223. ENUMLoObjType(LO_ALTDC_TYPE),
  224. ENUMLoObjType(LO_PEN_TYPE),
  225. ENUMLoObjType(LO_EXTPEN_TYPE),
  226. ENUMLoObjType(LO_DIBSECTION_TYPE),
  227. ENUMLoObjType(LO_METAFILE16_TYPE),
  228. ENUMLoObjType(LO_METAFILE_TYPE),
  229. ENUMLoObjType(LO_METADC16_TYPE),
  230. } GDILoObjType;
  231. // fl values for CreateDIBitmapInternal
  232. #define CDBI_INTERNAL 0x0001
  233. #define CDBI_DIBSECTION 0x0002
  234. #define CDBI_NOPALETTE 0x0004
  235. // The UFI allows us to identify four different items:
  236. //
  237. // Device Fonts: CheckSum = 0 and Index identifies the printer driver index of font to
  238. // use. Since we assume drivers are identical on both machines we can
  239. // rely on Index being enough to identify the font.
  240. //
  241. // Type1 Device Fonts: This refers to a Type1 font that has been installed on
  242. // the client machine and is enumerated by the postcript driver
  243. // as a device font. In this case CheckSum = 1 and Index
  244. // is the checksum of the Type 1 font file.
  245. //
  246. // Type1 Rasterizer: This item identifies not a font, but a Type1 rasterizer.
  247. // Here CheckSum = 2 and Index is the version number of the
  248. // Type1 rasterizer. A rasterizer with version number N supports
  249. // fonts used by a rasterizers with versions 0-N. If a rasterizer
  250. // exists on a server, this UFI MUST appear FIRST in the list of
  251. // UFI's returned to the client.
  252. //
  253. // Engine Font: This includes bitmap, vector, TT, and Type1 fonts rasterized by
  254. // a Type1 rasterizer. Here CheckSum is a checksum of the font file
  255. // and Index is the index of the face in the font file.
  256. #define DEVICE_FONT_TYPE 0
  257. #define TYPE1_FONT_TYPE 1
  258. #define TYPE1_RASTERIZER 2
  259. #define A_VALID_ENGINE_CHECKSUM 3
  260. #define UFI_DEVICE_FONT(pufi) ((pufi)->CheckSum == DEVICE_FONT_TYPE)
  261. #define UFI_TYPE1_FONT(pufi) ((pufi)->CheckSum == TYPE1_FONT_TYPE)
  262. #define UFI_TYPE1_RASTERIZER(pufi) ((pufi)->CheckSum == TYPE1_RASTERIZER)
  263. #define UFI_ENGINE_FONT(pufi) ((pufi)->CheckSum > TYPE1_RASTERIZER)
  264. #define UFI_HASH_VALUE(pufi) (((pufi)->CheckSum==TYPE1_FONT_TYPE) ? \
  265. (pufi)->Index : (pufi)->CheckSum )
  266. #define UFI_SAME_FACE(pufi1,pufi2) \
  267. (((pufi1)->CheckSum == (pufi2)->CheckSum) && ((pufi1)->Index == (pufi2)->Index))
  268. #define UFI_SAME_FILE(pufi1,pufi2) ((((pufi1)->CheckSum==TYPE1_FONT_TYPE) && ((pufi2)->CheckSum==TYPE1_FONT_TYPE)) ? \
  269. ((pufi1)->Index == (pufi2)->Index) : \
  270. ((pufi1)->CheckSum == (pufi2)->CheckSum))
  271. #define UFI_SAME_RASTERIZER_VERSION(pufiClient,pufiServer) \
  272. (((pufiClient)->CheckSum == (pufiServer)->CheckSum) && \
  273. ((pufiClient)->Index <= (pufiServer)->Index))
  274. #define UFI_CLEAR_ID(pufi) {(pufi)->CheckSum = (pufi)->Index = 0;}
  275. /*
  276. /**************************************************************************\
  277. *
  278. * // The pointer arithmetic for ENUMFONTDATAW is as follows:
  279. *
  280. * sizeof(ENUMLOGFONTEXW)+sizeof(data appended to logfont) =
  281. * dpNtmi - offsetof(ENUMFONTDATAW,u);
  282. *
  283. * sizeof(NTMW_INTERNAL) + sizeof(data appended to NTMW_INTERNAL) =
  284. * cjEfdw - dpNtmi;
  285. *
  286. * // typically, if we are talking about mm font we will have:
  287. *
  288. * data appended to logfont = design vector
  289. * data appended to NTMW_INTERNAL = full axes information
  290. *
  291. \**************************************************************************/
  292. #if (_WIN32_WINNT >= 0x0500)
  293. typedef struct _ENUMFONTDATAW { // efdw
  294. ULONG cjEfdw; // size of this structure
  295. ULONG dpNtmi; // offset to NTMW_INTERNAL from the top of efdw
  296. FLONG flType;
  297. ENUMLOGFONTEXDVW elfexw;
  298. // here follows NTMW_INTERNAL at the offset of dpNtmi
  299. } ENUMFONTDATAW, *PENUMFONTDATAW;
  300. #endif
  301. #define ALIGN4(X) (((X) + 3) & ~3)
  302. #define ALIGN8(X) (((X) + 7) & ~7)
  303. // here we define dpNtmi and cjEfdw for "regular", non multiple master fonts:
  304. #if (_WIN32_WINNT >= 0x0500)
  305. #define DP_NTMI0 ALIGN4(offsetof(ENUMFONTDATAW,elfexw) + offsetof(ENUMLOGFONTEXDVW,elfDesignVector) + offsetof(DESIGNVECTOR,dvValues))
  306. #endif
  307. #define CJ_NTMI0 ALIGN4(offsetof(NTMW_INTERNAL,entmw) + offsetof(ENUMTEXTMETRICW,etmAxesList) + offsetof(AXESLISTW,axlAxisInfo))
  308. #define CJ_EFDW0 (DP_NTMI0 + CJ_NTMI0)
  309. // ENUMFONTDATAW.flType internal values:
  310. //
  311. // ENUMFONT_SCALE_HACK [Win95 compat] Enumerate font back in several
  312. // sizes; mask out before doing callback to app.
  313. #define ENUMFONT_SCALE_HACK 0x80000000
  314. #define ENUMFONT_FLTYPE_MASK ( DEVICE_FONTTYPE | RASTER_FONTTYPE | TRUETYPE_FONTTYPE )
  315. // GreGetTextExtentW flags
  316. #define GGTE_WIN3_EXTENT 0x0001
  317. #define GGTE_GLYPH_INDEX 0x0002
  318. /******************************************************************************
  319. * stuff for client side text extents and charwidths
  320. ******************************************************************************/
  321. #define GCW_WIN3 0x00000001 // win3 bold simulation off-by-1 hack
  322. #define GCW_INT 0x00000002 // integer or float
  323. #define GCW_16BIT 0x00000004 // 16-bit or 32-bit widths
  324. #define GCW_GLYPH_INDEX 0x00000008 // input are glyph indices
  325. // stuff for GetCharABCWidths
  326. #define GCABCW_INT 0x00000001
  327. #define GCABCW_GLYPH_INDEX 0x00000002
  328. // stuff for GetTextExtentEx
  329. #define GTEEX_GLYPH_INDEX 0x0001
  330. /**************************************************************************\
  331. *
  332. * stuff from csgdi.h
  333. *
  334. \**************************************************************************/
  335. #define CJSCAN(width,planes,bits) ((((width)*(planes)*(bits)+31) & ~31) / 8)
  336. #define CJSCANW(width,planes,bits) ((((width)*(planes)*(bits)+15) & ~15) / 8)
  337. #define I_ANIMATEPALETTE 0
  338. #define I_SETPALETTEENTRIES 1
  339. #define I_GETPALETTEENTRIES 2
  340. #define I_GETSYSTEMPALETTEENTRIES 3
  341. #define I_GETDIBCOLORTABLE 4
  342. #define I_SETDIBCOLORTABLE 5
  343. #define I_POLYPOLYGON 1
  344. #define I_POLYPOLYLINE 2
  345. #define I_POLYBEZIER 3
  346. #define I_POLYLINETO 4
  347. #define I_POLYBEZIERTO 5
  348. #define I_POLYPOLYRGN 6
  349. HANDLE WINAPI SetObjectOwner(HGDIOBJ, HANDLE);
  350. // BUGBUG
  351. // RANDOM floating point stuff - try to cleanup later.
  352. // BUGBUG
  353. // We littered modules with __CPLUSPLUS to not conflict with efloat.hxx
  354. // efloat.hxx should more or less disappear.
  355. //
  356. #if defined(_AMD64_) || defined(_IA64_) || defined(BUILD_WOW6432)
  357. typedef FLOAT EFLOAT_S;
  358. #define EFLOAT_0 ((FLOAT) 0)
  359. #define EFLOAT_1Over16 ((FLOAT) 1/16)
  360. #define EFLOAT_1 ((FLOAT) 1)
  361. #define EFLOAT_16 ((FLOAT) 16)
  362. #ifndef __CPLUSPLUS
  363. extern LONG lCvtWithRound( FLOAT f, LONG l );
  364. #define efDivEFLOAT(x,y,z) (x=y/z)
  365. #define vAbsEFLOAT(x) {if (x<0.0f) x=-x;}
  366. #define vFxToEf(fx,ef) {ef = ((FLOAT) fx) / 16.0f;}
  367. #define vMulEFLOAT(x,y,z) {x=y*z;}
  368. #define lEfToF(x) (*(LONG *)(&x)) // Warning: FLOAT typed as LONG!
  369. #define bIsOneEFLOAT(x) (x==1.0f)
  370. #define bIsOneSixteenthEFLOAT(x) (x==0.0625f)
  371. #define bEqualEFLOAT(x,y) (x==y)
  372. #define lCvt(ef,ll) (lCvtWithRound(ef,ll))
  373. #endif
  374. #else
  375. typedef struct _EFLOAT_S
  376. {
  377. LONG lMant;
  378. LONG lExp;
  379. } EFLOAT_S;
  380. #define EFLOAT_0 {0, 0}
  381. #define EFLOAT_1Over16 {0x040000000, -2}
  382. #define EFLOAT_1 {0x040000000, 2}
  383. #define EFLOAT_16 {0x040000000, 6}
  384. #ifndef __CPLUSPLUS
  385. EFLOAT_S *mulff3_c(EFLOAT_S *,const EFLOAT_S *,const EFLOAT_S *);
  386. EFLOAT_S *divff3_c(EFLOAT_S *,const EFLOAT_S *,const EFLOAT_S *);
  387. VOID fxtoef_c(LONG,EFLOAT_S *);
  388. LONG eftof_c(EFLOAT_S *);
  389. #define efDivEFLOAT(x,y,z) (*divff3_c(&x,&y,&z))
  390. #define vAbsEFLOAT(x) {if (x.lMant<0) x.lMant=-x.lMant;}
  391. #define vFxToEf(fx,ef) (fxtoef_c(fx,&ef))
  392. #define vMulEFLOAT(x,y,z) {mulff3_c(&x,&y,&z);}
  393. #define lEfToF(x) (eftof_c(&x)) // Warning: FLOAT typed as LONG!
  394. #define bEqualEFLOAT(x,y) ((x.lMant==y.lMant)&&(x.lExp==y.lExp))
  395. #define bIsOneEFLOAT(x) ((x.lMant==0x40000000L)&&(x.lExp==2))
  396. #define bIsOneSixteenthEFLOAT(x) ((x.lMant==0x40000000L)&&(x.lExp==-2))
  397. LONG lCvt(EFLOAT_S,LONG);
  398. #endif
  399. #endif
  400. typedef struct _WIDTHDATA
  401. {
  402. USHORT sOverhang;
  403. USHORT sHeight;
  404. USHORT sCharInc;
  405. USHORT sBreak;
  406. BYTE iFirst;
  407. BYTE iLast;
  408. BYTE iBreak;
  409. BYTE iDefault;
  410. USHORT sDBCSInc;
  411. USHORT sDefaultInc;
  412. } WIDTHDATA;
  413. #define NO_WIDTH 0xFFFF
  414. typedef struct _DEVCAPS
  415. {
  416. ULONG ulVersion;
  417. ULONG ulTechnology;
  418. ULONG ulHorzSizeM;
  419. ULONG ulVertSizeM;
  420. ULONG ulHorzSize;
  421. ULONG ulVertSize;
  422. ULONG ulHorzRes;
  423. ULONG ulVertRes;
  424. ULONG ulBitsPixel;
  425. ULONG ulPlanes;
  426. ULONG ulNumPens;
  427. ULONG ulNumFonts;
  428. ULONG ulNumColors;
  429. ULONG ulRasterCaps;
  430. ULONG ulAspectX;
  431. ULONG ulAspectY;
  432. ULONG ulAspectXY;
  433. ULONG ulLogPixelsX;
  434. ULONG ulLogPixelsY;
  435. ULONG ulSizePalette;
  436. ULONG ulColorRes;
  437. ULONG ulPhysicalWidth;
  438. ULONG ulPhysicalHeight;
  439. ULONG ulPhysicalOffsetX;
  440. ULONG ulPhysicalOffsetY;
  441. ULONG ulTextCaps;
  442. ULONG ulVRefresh;
  443. ULONG ulDesktopHorzRes;
  444. ULONG ulDesktopVertRes;
  445. ULONG ulBltAlignment;
  446. ULONG ulPanningHorzRes;
  447. ULONG ulPanningVertRes;
  448. ULONG xPanningAlignment;
  449. ULONG yPanningAlignment;
  450. ULONG ulShadeBlendCaps;
  451. ULONG ulColorManagementCaps;
  452. } DEVCAPS, *PDEVCAPS;
  453. // This structure is a copy from d3dhal.h. We need it here to have exactly
  454. // the same offset for pvBuffer in D3DNTHAL_CONTEXTCREATEI
  455. typedef struct _D3DHAL_CONTEXTCREATEDATA_DUMMY
  456. {
  457. LPVOID lpDDGbl;
  458. LPVOID lpDDS;
  459. LPVOID lpDDSZ;
  460. LPVOID dwrstates;
  461. LPVOID dwhContext;
  462. HRESULT ddrval;
  463. } D3DHAL_CONTEXTCREATEDATA_DUMMY;
  464. // For D3D context creation information.
  465. typedef struct _D3DNTHAL_CONTEXTCREATEI
  466. {
  467. // Space for a D3DNTHAL_CONTEXTCREATE record.
  468. // The structure isn't directly declared here to
  469. // avoid header inclusion problems. This field
  470. // is asserted to be the same size as the actual type.
  471. D3DHAL_CONTEXTCREATEDATA_DUMMY ContextCreateData;
  472. // Private buffer information.
  473. PVOID pvBuffer;
  474. ULONG cjBuffer;
  475. } D3DNTHAL_CONTEXTCREATEI;
  476. //
  477. // D3D execute buffer batching declarations.
  478. //
  479. #define D3DEX_BATCH_SURFACE_MAX 4
  480. typedef struct _D3DEX_BATCH_HEADER
  481. {
  482. DWORD nSurfaces;
  483. DWORD pdds[D3DEX_BATCH_SURFACE_MAX];
  484. } D3DEX_BATCH_HEADER;
  485. #define D3DEX_BATCH_STATE 0
  486. #define D3DEX_BATCH_PRIMITIVE 1
  487. #define D3DEX_BATCH_PRIMITIVE_EXE 2