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.

631 lines
32 KiB

  1. /****************************************************************************/
  2. // ndddata.c
  3. //
  4. // RDP DD data
  5. //
  6. // Copyright (C) 1996-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #include <ndcgdata.h>
  9. #include <nddapi.h>
  10. #include <nshmapi.h>
  11. #include <aschapi.h>
  12. /****************************************************************************/
  13. /* Functions supported by our Display Driver. Each entry is of the form: */
  14. /* index - NT DDK defined index for the DDI function */
  15. /* function - pointer to our intercept function */
  16. /****************************************************************************/
  17. #ifdef DRAW_GDIPLUS
  18. #ifdef DRAW_NINEGRID
  19. DC_CONST_DATA_ARRAY(DRVFN, ddDriverFns, DD_NUM_DRIVER_INTERCEPTS,
  20. DC_STRUCT38(
  21. // Required display driver functions.
  22. DC_STRUCT2( INDEX_DrvEnablePDEV, (PFN)DrvEnablePDEV ),
  23. DC_STRUCT2( INDEX_DrvCompletePDEV, (PFN)DrvCompletePDEV ),
  24. DC_STRUCT2( INDEX_DrvDisablePDEV, (PFN)DrvDisablePDEV ),
  25. DC_STRUCT2( INDEX_DrvEnableSurface, (PFN)DrvEnableSurface ),
  26. DC_STRUCT2( INDEX_DrvDisableSurface, (PFN)DrvDisableSurface ),
  27. // Non-required display driver functions.
  28. DC_STRUCT2( INDEX_DrvAssertMode, (PFN)DrvAssertMode ),
  29. DC_STRUCT2( INDEX_DrvResetPDEV, (PFN)DrvResetPDEV ),
  30. DC_STRUCT2( INDEX_DrvDisableDriver, (PFN)DrvDisableDriver ),
  31. DC_STRUCT2( INDEX_DrvGetModes, (PFN)DrvGetModes ),
  32. DC_STRUCT2( INDEX_DrvCreateDeviceBitmap, (PFN)DrvCreateDeviceBitmap),
  33. DC_STRUCT2( INDEX_DrvDeleteDeviceBitmap, (PFN)DrvDeleteDeviceBitmap),
  34. // Mouse pointer related functions.
  35. DC_STRUCT2( INDEX_DrvMovePointer, (PFN)DrvMovePointer ),
  36. DC_STRUCT2( INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape ),
  37. // Ouput functions.
  38. DC_STRUCT2( INDEX_DrvCopyBits, (PFN)DrvCopyBits ),
  39. DC_STRUCT2( INDEX_DrvStrokePath, (PFN)DrvStrokePath ),
  40. DC_STRUCT2( INDEX_DrvTextOut, (PFN)DrvTextOut ),
  41. DC_STRUCT2( INDEX_DrvBitBlt, (PFN)DrvBitBlt ),
  42. DC_STRUCT2( INDEX_DrvLineTo, (PFN)DrvLineTo ),
  43. DC_STRUCT2( INDEX_DrvStretchBlt, (PFN)DrvStretchBlt ),
  44. DC_STRUCT2( INDEX_DrvFillPath, (PFN)DrvFillPath ),
  45. DC_STRUCT2( INDEX_DrvPaint, (PFN)DrvPaint ),
  46. DC_STRUCT2( INDEX_DrvSaveScreenBits, (PFN)DrvSaveScreenBits ),
  47. DC_STRUCT2( INDEX_DrvNineGrid, (PFN)DrvNineGrid ),
  48. DC_STRUCT2( INDEX_DrvDrawEscape, (PFN)DrvDrawEscape ),
  49. // Support functions.
  50. DC_STRUCT2( INDEX_DrvDestroyFont, (PFN)DrvDestroyFont ),
  51. DC_STRUCT2( INDEX_DrvSetPalette, (PFN)DrvSetPalette ),
  52. DC_STRUCT2( INDEX_DrvRealizeBrush, (PFN)DrvRealizeBrush ),
  53. DC_STRUCT2( INDEX_DrvEscape, (PFN)DrvEscape ),
  54. DC_STRUCT2( INDEX_DrvDitherColor, (PFN)DrvDitherColor ),
  55. // TS-specfic entry points.
  56. DC_STRUCT2( INDEX_DrvConnect, (PFN)DrvConnect ),
  57. DC_STRUCT2( INDEX_DrvDisconnect, (PFN)DrvDisconnect ),
  58. DC_STRUCT2( INDEX_DrvReconnect, (PFN)DrvReconnect ),
  59. DC_STRUCT2( INDEX_DrvShadowConnect, (PFN)DrvShadowConnect ),
  60. DC_STRUCT2( INDEX_DrvShadowDisconnect, (PFN)DrvShadowDisconnect ),
  61. DC_STRUCT2( INDEX_DrvMovePointerEx, (PFN)DrvMovePointerEx ),
  62. // For Direct Draw.
  63. DC_STRUCT2( INDEX_DrvGetDirectDrawInfo, (PFN) DrvGetDirectDrawInfo),
  64. DC_STRUCT2( INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw ),
  65. DC_STRUCT2( INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw)
  66. )
  67. );
  68. #else
  69. DC_CONST_DATA_ARRAY(DRVFN, ddDriverFns, DD_NUM_DRIVER_INTERCEPTS,
  70. DC_STRUCT37(
  71. // Required display driver functions.
  72. DC_STRUCT2( INDEX_DrvEnablePDEV, (PFN)DrvEnablePDEV ),
  73. DC_STRUCT2( INDEX_DrvCompletePDEV, (PFN)DrvCompletePDEV ),
  74. DC_STRUCT2( INDEX_DrvDisablePDEV, (PFN)DrvDisablePDEV ),
  75. DC_STRUCT2( INDEX_DrvEnableSurface, (PFN)DrvEnableSurface ),
  76. DC_STRUCT2( INDEX_DrvDisableSurface, (PFN)DrvDisableSurface ),
  77. // Non-required display driver functions.
  78. DC_STRUCT2( INDEX_DrvAssertMode, (PFN)DrvAssertMode ),
  79. DC_STRUCT2( INDEX_DrvResetPDEV, (PFN)DrvResetPDEV ),
  80. DC_STRUCT2( INDEX_DrvDisableDriver, (PFN)DrvDisableDriver ),
  81. DC_STRUCT2( INDEX_DrvGetModes, (PFN)DrvGetModes ),
  82. DC_STRUCT2( INDEX_DrvCreateDeviceBitmap, (PFN)DrvCreateDeviceBitmap),
  83. DC_STRUCT2( INDEX_DrvDeleteDeviceBitmap, (PFN)DrvDeleteDeviceBitmap),
  84. // Mouse pointer related functions.
  85. DC_STRUCT2( INDEX_DrvMovePointer, (PFN)DrvMovePointer ),
  86. DC_STRUCT2( INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape ),
  87. // Ouput functions.
  88. DC_STRUCT2( INDEX_DrvCopyBits, (PFN)DrvCopyBits ),
  89. DC_STRUCT2( INDEX_DrvStrokePath, (PFN)DrvStrokePath ),
  90. DC_STRUCT2( INDEX_DrvTextOut, (PFN)DrvTextOut ),
  91. DC_STRUCT2( INDEX_DrvBitBlt, (PFN)DrvBitBlt ),
  92. DC_STRUCT2( INDEX_DrvLineTo, (PFN)DrvLineTo ),
  93. DC_STRUCT2( INDEX_DrvStretchBlt, (PFN)DrvStretchBlt ),
  94. DC_STRUCT2( INDEX_DrvFillPath, (PFN)DrvFillPath ),
  95. DC_STRUCT2( INDEX_DrvPaint, (PFN)DrvPaint ),
  96. DC_STRUCT2( INDEX_DrvSaveScreenBits, (PFN)DrvSaveScreenBits ),
  97. DC_STRUCT2( INDEX_DrvDrawEscape, (PFN)DrvDrawEscape ),
  98. // Support functions.
  99. DC_STRUCT2( INDEX_DrvDestroyFont, (PFN)DrvDestroyFont ),
  100. DC_STRUCT2( INDEX_DrvSetPalette, (PFN)DrvSetPalette ),
  101. DC_STRUCT2( INDEX_DrvRealizeBrush, (PFN)DrvRealizeBrush ),
  102. DC_STRUCT2( INDEX_DrvEscape, (PFN)DrvEscape ),
  103. DC_STRUCT2( INDEX_DrvDitherColor, (PFN)DrvDitherColor ),
  104. // TS-specfic entry points.
  105. DC_STRUCT2( INDEX_DrvConnect, (PFN)DrvConnect ),
  106. DC_STRUCT2( INDEX_DrvDisconnect, (PFN)DrvDisconnect ),
  107. DC_STRUCT2( INDEX_DrvReconnect, (PFN)DrvReconnect ),
  108. DC_STRUCT2( INDEX_DrvShadowConnect, (PFN)DrvShadowConnect ),
  109. DC_STRUCT2( INDEX_DrvShadowDisconnect, (PFN)DrvShadowDisconnect ),
  110. DC_STRUCT2( INDEX_DrvMovePointerEx, (PFN)DrvMovePointerEx ),
  111. // For Direct Draw.
  112. DC_STRUCT2( INDEX_DrvGetDirectDrawInfo, (PFN) DrvGetDirectDrawInfo),
  113. DC_STRUCT2( INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw ),
  114. DC_STRUCT2( INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw)
  115. )
  116. );
  117. #endif // DRAW_NINEGRID
  118. #else // DRAW_GDIPLUS
  119. #ifdef DRAW_NINEGRID
  120. DC_CONST_DATA_ARRAY(DRVFN, ddDriverFns, DD_NUM_DRIVER_INTERCEPTS,
  121. DC_STRUCT37(
  122. // Required display driver functions.
  123. DC_STRUCT2( INDEX_DrvEnablePDEV, (PFN)DrvEnablePDEV ),
  124. DC_STRUCT2( INDEX_DrvCompletePDEV, (PFN)DrvCompletePDEV ),
  125. DC_STRUCT2( INDEX_DrvDisablePDEV, (PFN)DrvDisablePDEV ),
  126. DC_STRUCT2( INDEX_DrvEnableSurface, (PFN)DrvEnableSurface ),
  127. DC_STRUCT2( INDEX_DrvDisableSurface, (PFN)DrvDisableSurface ),
  128. // Non-required display driver functions.
  129. DC_STRUCT2( INDEX_DrvAssertMode, (PFN)DrvAssertMode ),
  130. DC_STRUCT2( INDEX_DrvResetPDEV, (PFN)DrvResetPDEV ),
  131. DC_STRUCT2( INDEX_DrvDisableDriver, (PFN)DrvDisableDriver ),
  132. DC_STRUCT2( INDEX_DrvGetModes, (PFN)DrvGetModes ),
  133. DC_STRUCT2( INDEX_DrvCreateDeviceBitmap, (PFN)DrvCreateDeviceBitmap),
  134. DC_STRUCT2( INDEX_DrvDeleteDeviceBitmap, (PFN)DrvDeleteDeviceBitmap),
  135. // Mouse pointer related functions.
  136. DC_STRUCT2( INDEX_DrvMovePointer, (PFN)DrvMovePointer ),
  137. DC_STRUCT2( INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape ),
  138. // Ouput functions.
  139. DC_STRUCT2( INDEX_DrvCopyBits, (PFN)DrvCopyBits ),
  140. DC_STRUCT2( INDEX_DrvStrokePath, (PFN)DrvStrokePath ),
  141. DC_STRUCT2( INDEX_DrvTextOut, (PFN)DrvTextOut ),
  142. DC_STRUCT2( INDEX_DrvBitBlt, (PFN)DrvBitBlt ),
  143. DC_STRUCT2( INDEX_DrvLineTo, (PFN)DrvLineTo ),
  144. DC_STRUCT2( INDEX_DrvStretchBlt, (PFN)DrvStretchBlt ),
  145. DC_STRUCT2( INDEX_DrvFillPath, (PFN)DrvFillPath ),
  146. DC_STRUCT2( INDEX_DrvPaint, (PFN)DrvPaint ),
  147. DC_STRUCT2( INDEX_DrvSaveScreenBits, (PFN)DrvSaveScreenBits ),
  148. DC_STRUCT2( INDEX_DrvNineGrid, (PFN)DrvNineGrid ),
  149. // Support functions.
  150. DC_STRUCT2( INDEX_DrvDestroyFont, (PFN)DrvDestroyFont ),
  151. DC_STRUCT2( INDEX_DrvSetPalette, (PFN)DrvSetPalette ),
  152. DC_STRUCT2( INDEX_DrvRealizeBrush, (PFN)DrvRealizeBrush ),
  153. DC_STRUCT2( INDEX_DrvEscape, (PFN)DrvEscape ),
  154. DC_STRUCT2( INDEX_DrvDitherColor, (PFN)DrvDitherColor ),
  155. // TS-specfic entry points.
  156. DC_STRUCT2( INDEX_DrvConnect, (PFN)DrvConnect ),
  157. DC_STRUCT2( INDEX_DrvDisconnect, (PFN)DrvDisconnect ),
  158. DC_STRUCT2( INDEX_DrvReconnect, (PFN)DrvReconnect ),
  159. DC_STRUCT2( INDEX_DrvShadowConnect, (PFN)DrvShadowConnect ),
  160. DC_STRUCT2( INDEX_DrvShadowDisconnect, (PFN)DrvShadowDisconnect ),
  161. DC_STRUCT2( INDEX_DrvMovePointerEx, (PFN)DrvMovePointerEx ),
  162. // For Direct Draw.
  163. DC_STRUCT2( INDEX_DrvGetDirectDrawInfo, (PFN) DrvGetDirectDrawInfo),
  164. DC_STRUCT2( INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw ),
  165. DC_STRUCT2( INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw)
  166. )
  167. );
  168. #else // DRAW_NINEGRID
  169. DC_CONST_DATA_ARRAY(DRVFN, ddDriverFns, DD_NUM_DRIVER_INTERCEPTS,
  170. DC_STRUCT36(
  171. // Required display driver functions.
  172. DC_STRUCT2( INDEX_DrvEnablePDEV, (PFN)DrvEnablePDEV ),
  173. DC_STRUCT2( INDEX_DrvCompletePDEV, (PFN)DrvCompletePDEV ),
  174. DC_STRUCT2( INDEX_DrvDisablePDEV, (PFN)DrvDisablePDEV ),
  175. DC_STRUCT2( INDEX_DrvEnableSurface, (PFN)DrvEnableSurface ),
  176. DC_STRUCT2( INDEX_DrvDisableSurface, (PFN)DrvDisableSurface ),
  177. // Non-required display driver functions.
  178. DC_STRUCT2( INDEX_DrvAssertMode, (PFN)DrvAssertMode ),
  179. DC_STRUCT2( INDEX_DrvResetPDEV, (PFN)DrvResetPDEV ),
  180. DC_STRUCT2( INDEX_DrvDisableDriver, (PFN)DrvDisableDriver ),
  181. DC_STRUCT2( INDEX_DrvGetModes, (PFN)DrvGetModes ),
  182. DC_STRUCT2( INDEX_DrvCreateDeviceBitmap, (PFN)DrvCreateDeviceBitmap),
  183. DC_STRUCT2( INDEX_DrvDeleteDeviceBitmap, (PFN)DrvDeleteDeviceBitmap),
  184. // Mouse pointer related functions.
  185. DC_STRUCT2( INDEX_DrvMovePointer, (PFN)DrvMovePointer ),
  186. DC_STRUCT2( INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape ),
  187. // Ouput functions.
  188. DC_STRUCT2( INDEX_DrvCopyBits, (PFN)DrvCopyBits ),
  189. DC_STRUCT2( INDEX_DrvStrokePath, (PFN)DrvStrokePath ),
  190. DC_STRUCT2( INDEX_DrvTextOut, (PFN)DrvTextOut ),
  191. DC_STRUCT2( INDEX_DrvBitBlt, (PFN)DrvBitBlt ),
  192. DC_STRUCT2( INDEX_DrvLineTo, (PFN)DrvLineTo ),
  193. DC_STRUCT2( INDEX_DrvStretchBlt, (PFN)DrvStretchBlt ),
  194. DC_STRUCT2( INDEX_DrvFillPath, (PFN)DrvFillPath ),
  195. DC_STRUCT2( INDEX_DrvPaint, (PFN)DrvPaint ),
  196. DC_STRUCT2( INDEX_DrvSaveScreenBits, (PFN)DrvSaveScreenBits ),
  197. // Support functions.
  198. DC_STRUCT2( INDEX_DrvDestroyFont, (PFN)DrvDestroyFont ),
  199. DC_STRUCT2( INDEX_DrvSetPalette, (PFN)DrvSetPalette ),
  200. DC_STRUCT2( INDEX_DrvRealizeBrush, (PFN)DrvRealizeBrush ),
  201. DC_STRUCT2( INDEX_DrvEscape, (PFN)DrvEscape ),
  202. DC_STRUCT2( INDEX_DrvDitherColor, (PFN)DrvDitherColor ),
  203. // TS-specfic entry points.
  204. DC_STRUCT2( INDEX_DrvConnect, (PFN)DrvConnect ),
  205. DC_STRUCT2( INDEX_DrvDisconnect, (PFN)DrvDisconnect ),
  206. DC_STRUCT2( INDEX_DrvReconnect, (PFN)DrvReconnect ),
  207. DC_STRUCT2( INDEX_DrvShadowConnect, (PFN)DrvShadowConnect ),
  208. DC_STRUCT2( INDEX_DrvShadowDisconnect, (PFN)DrvShadowDisconnect ),
  209. DC_STRUCT2( INDEX_DrvMovePointerEx, (PFN)DrvMovePointerEx ),
  210. // For Direct Draw.
  211. DC_STRUCT2( INDEX_DrvGetDirectDrawInfo, (PFN) DrvGetDirectDrawInfo),
  212. DC_STRUCT2( INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw ),
  213. DC_STRUCT2( INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw)
  214. )
  215. );
  216. #endif // DRAW_NINEGRID
  217. #endif // DRAW_GDIPLUS
  218. /****************************************************************************/
  219. /* Global Table defining the 20 Windows default colours. For 256 colour */
  220. /* palettes the first 10 must be put at the beginning of the palette and */
  221. /* the last 10 at the end of the palette. */
  222. /****************************************************************************/
  223. DC_CONST_DATA_ARRAY(PALETTEENTRY, ddDefaultPalette, 20,
  224. DC_STRUCT20(
  225. DC_STRUCT4( 0, 0, 0, 0 ), /* 0 */
  226. DC_STRUCT4( 0x80,0, 0, 0 ), /* 1 */
  227. DC_STRUCT4( 0, 0x80,0, 0 ), /* 2 */
  228. DC_STRUCT4( 0x80,0x80,0, 0 ), /* 3 */
  229. DC_STRUCT4( 0, 0, 0x80,0 ), /* 4 */
  230. DC_STRUCT4( 0x80,0, 0x80,0 ), /* 5 */
  231. DC_STRUCT4( 0, 0x80,0x80,0 ), /* 6 */
  232. DC_STRUCT4( 0xC0,0xC0,0xC0,0 ), /* 7 */
  233. DC_STRUCT4( 192, 220, 192, 0 ), /* 8 */
  234. DC_STRUCT4( 166, 202, 240, 0 ), /* 9 */
  235. DC_STRUCT4( 255, 251, 240, 0 ), /* 10 */
  236. DC_STRUCT4( 160, 160, 164, 0 ), /* 11 */
  237. DC_STRUCT4( 0x80,0x80,0x80,0 ), /* 12 */
  238. DC_STRUCT4( 0xFF,0, 0 ,0 ), /* 13 */
  239. DC_STRUCT4( 0, 0xFF,0 ,0 ), /* 14 */
  240. DC_STRUCT4( 0xFF,0xFF,0 ,0 ), /* 15 */
  241. DC_STRUCT4( 0 ,0, 0xFF,0 ), /* 16 */
  242. DC_STRUCT4( 0xFF,0, 0xFF,0 ), /* 17 */
  243. DC_STRUCT4( 0, 0xFF,0xFF,0 ), /* 18 */
  244. DC_STRUCT4( 0xFF,0xFF,0xFF,0 ) /* 19 */
  245. ));
  246. /****************************************************************************/
  247. /* Global Table defining the 16 Windows default VGA colours. */
  248. /****************************************************************************/
  249. DC_CONST_DATA_ARRAY(PALETTEENTRY, ddDefaultVgaPalette, 16,
  250. DC_STRUCT16(
  251. DC_STRUCT4( 0, 0, 0, 0 ), /* 0 */
  252. DC_STRUCT4( 0x80,0, 0, 0 ), /* 1 */
  253. DC_STRUCT4( 0, 0x80,0, 0 ), /* 2 */
  254. DC_STRUCT4( 0x80,0x80,0, 0 ), /* 3 */
  255. DC_STRUCT4( 0, 0, 0x80,0 ), /* 4 */
  256. DC_STRUCT4( 0x80,0, 0x80,0 ), /* 5 */
  257. DC_STRUCT4( 0, 0x80,0x80,0 ), /* 6 */
  258. DC_STRUCT4( 0x80,0x80,0x80,0 ), /* 7 */
  259. DC_STRUCT4( 0xC0,0xC0,0xC0,0 ), /* 8 */
  260. DC_STRUCT4( 0xFF,0, 0, 0 ), /* 9 */
  261. DC_STRUCT4( 0, 0xFF,0, 0 ), /* 10 */
  262. DC_STRUCT4( 0xFF,0xFF,0, 0 ), /* 11 */
  263. DC_STRUCT4( 0, 0, 0xFF,0 ), /* 12 */
  264. DC_STRUCT4( 0xFF,0, 0xFF,0 ), /* 13 */
  265. DC_STRUCT4( 0, 0xFF,0xFF,0 ), /* 14 */
  266. DC_STRUCT4( 0xFF,0xFF,0xFF,0 ) /* 15 */
  267. ));
  268. /****************************************************************************/
  269. /* ddDefaultGdi */
  270. /* */
  271. /* This contains the default GDIINFO fields that are passed back to GDI */
  272. /* during DrvEnablePDEV. */
  273. /* */
  274. /* NOTE: This structure defaults to values for an 8bpp palette device. */
  275. /* Some fields are overwritten for different colour depths. */
  276. /* */
  277. /* It is expected that DDML ignores a lot of these parameters and */
  278. /* uses the values from the primary driver instead */
  279. /****************************************************************************/
  280. DC_CONST_DATA(GDIINFO, ddDefaultGdi,
  281. DC_STRUCT35(
  282. GDI_DRIVER_VERSION,
  283. DT_RASDISPLAY, /* ulTechnology */
  284. 320, /* ulHorzSize (display width: mm) */
  285. 240, /* ulVertSize (display height: mm) */
  286. 0, /* ulHorzRes (filled in later) */
  287. 0, /* ulVertRes (filled in later) */
  288. 0, /* cBitsPixel (filled in later) */
  289. 0, /* cPlanes (filled in later) */
  290. 20, /* ulNumColors (palette managed) */
  291. 0, /* flRaster (DDI reserved field) */
  292. 0, /* ulLogPixelsX (filled in later) */
  293. 0, /* ulLogPixelsY (filled in later) */
  294. TC_RA_ABLE, /* flTextCaps - If we had wanted console windows*/
  295. /* to scroll by repainting the entire window, */
  296. /* instead of doing a screen-to-screen blt, we */
  297. /* would have set TC_SCROLLBLT (yes, the flag */
  298. /* is backwards). */
  299. 0, /* ulDACRed (filled in later) */
  300. 0, /* ulDACGreen (filled in later) */
  301. 0, /* ulDACBlue (filled in later) */
  302. 0x24, /* ulAspectX */
  303. 0x24, /* ulAspectY */
  304. 0x33, /* ulAspectXY (one-to-one aspect ratio) */
  305. 1, /* xStyleStep */
  306. 1, /* yStyleStep */
  307. 3, /* denStyleStep -- Styles have a one-to-one */
  308. /* aspect ratio, and every dot is 3 pixels long */
  309. DC_STRUCT2( 0, 0 ), /* ptlPhysOffset */
  310. DC_STRUCT2( 0, 0 ), /* szlPhysSize */
  311. 256, /* ulNumPalReg */
  312. DC_STRUCT16( /* ciDevice */
  313. DC_STRUCT3( 6700, 3300, 0 ), /* Red */
  314. DC_STRUCT3( 2100, 7100, 0 ), /* Green */
  315. DC_STRUCT3( 1400, 800, 0 ), /* Blue */
  316. DC_STRUCT3( 1750, 3950, 0 ), /* Cyan */
  317. DC_STRUCT3( 4050, 2050, 0 ), /* Magenta */
  318. DC_STRUCT3( 4400, 5200, 0 ), /* Yellow */
  319. DC_STRUCT3( 3127, 3290, 0 ), /* AlignmentWhite */
  320. 20000, /* RedGamma */
  321. 20000, /* GreenGamma */
  322. 20000, /* BlueGamma */
  323. 0, 0, 0, 0, 0, 0 /* No dye correction for raster displays */
  324. ),
  325. 0, /* ulDevicePelsDPI (for printers only) */
  326. PRIMARY_ORDER_CBA, /* ulPrimaryOrder */
  327. HT_PATSIZE_4x4_M, /* ulHTPatternSize */
  328. HT_FORMAT_8BPP, /* ulHTOutputFormat */
  329. HT_FLAG_ADDITIVE_PRIMS, /* flHTFlags */
  330. 0, /* ulVRefresh */
  331. 1, /* ulBltAlignment */
  332. 800, /* ulPanningHorzRes */
  333. 600 /* ulPanningVertRes */
  334. /* */
  335. /* NOTE: */
  336. /* NT 5 has added these fields post SP-3, if we care */
  337. /* */
  338. /* 0, /* xPanningAlignment */
  339. /* 0, /* yPanningAlignment */
  340. /* */
  341. ));
  342. /****************************************************************************/
  343. /* ddDefaultDevInfo */
  344. /* */
  345. /* This contains the default DEVINFO fields that are passed back to GDI */
  346. /* during DrvEnablePDEV. */
  347. /* */
  348. /* NOTE: This structure defaults to values for an 8bpp palette device. */
  349. /* Some fields are overwritten for different colour depths. */
  350. /****************************************************************************/
  351. #ifdef DRAW_NINEGRID
  352. DC_CONST_DATA(DEVINFO, ddDefaultDevInfo,
  353. DC_STRUCT10(
  354. DC_STRUCT1(
  355. GCAPS_OPAQUERECT |
  356. GCAPS_PALMANAGED |
  357. GCAPS_COLOR_DITHER |
  358. GCAPS_MONO_DITHER |
  359. GCAPS_ALTERNATEFILL |
  360. GCAPS_WINDINGFILL
  361. ), /* NOTE: Only enable ASYNCMOVE if your code */
  362. /* and hardware can handle DrvMovePointer */
  363. /* calls at any time, even while another */
  364. /* thread is in the middle of a drawing */
  365. /* call such as DrvBitBlt. */
  366. /* flGraphicsFlags */
  367. DC_STRUCT14(
  368. 16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
  369. CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
  370. VARIABLE_PITCH | FF_DONTCARE,L"System"),
  371. /* lfDefaultFont */
  372. DC_STRUCT14(
  373. 12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
  374. CLIP_STROKE_PRECIS,PROOF_QUALITY,
  375. VARIABLE_PITCH | FF_DONTCARE,L"MS Sans Serif"),
  376. /* lfAnsiVarFont */
  377. DC_STRUCT14(
  378. 12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
  379. CLIP_STROKE_PRECIS,PROOF_QUALITY,
  380. FIXED_PITCH | FF_DONTCARE, L"Courier"),
  381. /* lfAnsiFixFont */
  382. 0, /* cFonts */
  383. BMF_8BPP, /* iDitherFormat */
  384. 8, /* cxDither */
  385. 8, /* cyDither */
  386. 0, /* hpalDefault (filled in later) */
  387. GCAPS2_REMOTEDRIVER /* this is to advertise as remote driver */
  388. ) );
  389. #else
  390. DC_CONST_DATA(DEVINFO, ddDefaultDevInfo,
  391. DC_STRUCT9(
  392. DC_STRUCT1(
  393. GCAPS_OPAQUERECT |
  394. GCAPS_PALMANAGED |
  395. GCAPS_COLOR_DITHER |
  396. GCAPS_MONO_DITHER |
  397. GCAPS_ALTERNATEFILL |
  398. GCAPS_WINDINGFILL
  399. ), /* NOTE: Only enable ASYNCMOVE if your code */
  400. /* and hardware can handle DrvMovePointer */
  401. /* calls at any time, even while another */
  402. /* thread is in the middle of a drawing */
  403. /* call such as DrvBitBlt. */
  404. /* flGraphicsFlags */
  405. DC_STRUCT14(
  406. 16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
  407. CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
  408. VARIABLE_PITCH | FF_DONTCARE,L"System"),
  409. /* lfDefaultFont */
  410. DC_STRUCT14(
  411. 12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
  412. CLIP_STROKE_PRECIS,PROOF_QUALITY,
  413. VARIABLE_PITCH | FF_DONTCARE,L"MS Sans Serif"),
  414. /* lfAnsiVarFont */
  415. DC_STRUCT14(
  416. 12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
  417. CLIP_STROKE_PRECIS,PROOF_QUALITY,
  418. FIXED_PITCH | FF_DONTCARE, L"Courier"),
  419. /* lfAnsiFixFont */
  420. 0, /* cFonts */
  421. BMF_8BPP, /* iDitherFormat */
  422. 8, /* cxDither */
  423. 8, /* cyDither */
  424. 0 /* hpalDefault (filled in later) */
  425. ) );
  426. #endif
  427. // Flag for DDInit to set when it initializes correctly.
  428. DC_DATA(BOOL, ddInitialised, FALSE);
  429. // Flag to tell DrvEnableSurface that it's time to initialize.
  430. DC_DATA(BOOL, ddInitPending, FALSE);
  431. // Connection and reconnection flags. ddConnected is used to alter the
  432. // behavior of the DD depending on whether we've been connected according to
  433. // Win32K. Both are useful for debugging.
  434. DC_DATA(BOOL, ddConnected, FALSE);
  435. DC_DATA(BOOL, ddReconnected, FALSE);
  436. // Flag to specify whether we're connected to a console.
  437. DC_DATA(BOOL, ddConsole, FALSE);
  438. // Temporary flag to aid in limiting the number of shadows per session to two
  439. // It should go away when n-way shadowing is supported.
  440. // TODO: Remove this when no longer needed.
  441. DC_DATA(BOOL, ddIgnoreShadowDisconnect, FALSE);
  442. // Pointer to the Shared Memory.
  443. DC_DATA(PSHM_SHARED_MEMORY, pddShm, NULL);
  444. // Handle to timer object for signalling the WD.
  445. DC_DATA(PKTIMER, pddWdTimer, NULL);
  446. // Handle to the WD channel - provided on DrvConnect.
  447. DC_DATA(HANDLE, ddWdHandle, NULL);
  448. // TSWDs - for diagnostic purposes.
  449. DC_DATA(PVOID, pddTSWd, NULL);
  450. DC_DATA(PVOID, pddTSWdShadow, NULL);
  451. // Size of the current session's desktop.
  452. DC_DATA(INT32, ddDesktopHeight, 0);
  453. DC_DATA(INT32, ddDesktopWidth, 0);
  454. // The cursor stamp the last time we IOCtl'd into the WD.
  455. DC_DATA(UINT32, ddLastSentCursorStamp, 0);
  456. // Current scheduler mode.
  457. DC_DATA(UINT32, ddSchCurrentMode, SCH_MODE_ASLEEP);
  458. DC_DATA(BOOL, ddSchInputKickMode, FALSE);
  459. // Frame Buffer.
  460. DC_DATA(BYTE *, pddFrameBuf, NULL);
  461. DC_DATA(INT32, ddFrameBufX, 0);
  462. DC_DATA(INT32, ddFrameBufY, 0);
  463. DC_DATA(INT32, ddFrameBufBpp, 0);
  464. DC_DATA(UINT32, ddFrameIFormat, 0);
  465. // Section object for the frame buffer
  466. DC_DATA(HANDLE, ddSectionObject, NULL);
  467. // Record rectangle passed by DdLock
  468. DC_DATA(INT32, ddLockAreaLeft, 0);
  469. DC_DATA(INT32, ddLockAreaRight, 0);
  470. DC_DATA(INT32, ddLockAreaTop, 0);
  471. DC_DATA(INT32, ddLockAreaBottom, 0);
  472. // Flag to record if DdLock/DdUnlock is called in pair
  473. DC_DATA(BOOL, ddLocked, FALSE);
  474. // Performance counters
  475. DC_DATA(PTHINWIRECACHE, pddCacheStats, NULL);
  476. #ifdef DC_COUNTERS
  477. DC_DATA(PPROTOCOLSTATUS, pddProtStats, NULL);
  478. #endif
  479. #ifdef DC_DEBUG
  480. #include "dbg_fncall_hist.h"
  481. // NT BUG 539912 - track how many sections are allocated and how many are
  482. // deleted
  483. // This is a signed value to track possible excess deletion
  484. DC_DATA(INT32, dbg_ddSectionAllocs, 0);
  485. DC_DATA(BYTE, dbg_ddFnCallHistoryIndex, 0);
  486. DC_DATA(BYTE, dbg_ddFnCallHistoryIndexMAX, DBG_DD_FNCALL_HIST_MAX);
  487. DC_DATA_ARRAY(DBG_DD_FUNCALL_HISTORY, dbg_ddFnCallHistory, DBG_DD_FNCALL_HIST_MAX, 0);
  488. #endif // DC_DEBUG
  489. /****************************************************************************/
  490. /* Flag to tell debugger extensions whether this is a debug build */
  491. /****************************************************************************/
  492. #ifdef DC_DEBUG
  493. DC_DATA(BOOL, ddDebug, TRUE);
  494. #else
  495. DC_DATA(BOOL, ddDebug, FALSE);
  496. #endif
  497. #ifdef DC_DEBUG
  498. /****************************************************************************/
  499. /* Trace data (explicitly initialized in DrvEnableDriver) */
  500. /****************************************************************************/
  501. DC_DATA(unsigned, ddTrcType, 0);
  502. DC_DATA(BOOL, ddTrcToWD, 0);
  503. /****************************************************************************/
  504. /* State data for debugging */
  505. /****************************************************************************/
  506. #define DD_SET_STATE(a) ddState = a
  507. #define DD_UPD_STATE(a) ddState |= a
  508. #define DD_CLR_STATE(a) ddState &= ~a
  509. #define DD_ENABLE_DRIVER 0x00000001
  510. #define DD_CONNECT 0x00000002
  511. #define DD_RECONNECT_IN 0x00000004
  512. #define DD_RECONNECT_OUT 0x00000008
  513. #define DD_ENABLE_PDEV 0x00000010
  514. #define DD_ENABLE_PDEV_ERR 0x00000020
  515. #define DD_COMPLETE_PDEV 0x00000040
  516. #define DD_ENABLE_SURFACE_IN 0x00000080
  517. #define DD_ENABLE_SURFACE_OUT 0x00000100
  518. #define DD_ENABLE_SURFACE_ERR 0x00000200
  519. #define DD_INIT_IN 0x00000400
  520. #define DD_INIT_OUT 0x00000800
  521. #define DD_INIT_FAIL1 0x00001000
  522. #define DD_INIT_FAIL2 0x00002000
  523. #define DD_INIT_OK1 0x00004000
  524. #define DD_INIT_OK_ALL 0x00008000
  525. #define DD_INIT_IOCTL_IN 0x00010000
  526. #define DD_INIT_IOCTL_OUT 0x00020000
  527. #define DD_INIT_SHM_OUT 0x00040000
  528. #define DD_INIT_CONNECT 0x00080000
  529. #define DD_REINIT 0x00100000
  530. #define DD_DISCONNECT_IN 0x00200000
  531. #define DD_DISCONNECT_OUT 0x00400000
  532. #define DD_DISCONNECT_ERR 0x00800000
  533. #define DD_TIMEROBJ 0x01000000
  534. #define DD_WAS_DISCONNECTED 0x02000000
  535. #define DD_SHADOW_SETUP 0x04000000
  536. #define DD_SHADOW_FAIL 0x08000000
  537. #define DD_BITBLT 0x80000000
  538. DC_DATA(unsigned, ddState, 0);
  539. // Trace string.
  540. DC_DATA_ARRAY(char, ddTraceString, TRC_BUFFER_SIZE, 0);
  541. #else
  542. #define DD_SET_STATE(a)
  543. #define DD_UPD_STATE(a)
  544. #define DD_CLR_STATE(a)
  545. #endif