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.

335 lines
12 KiB

  1. /****************************************************************************/
  2. // asbcapi.h
  3. //
  4. // Send Bitmap Cache API header.
  5. //
  6. // Copyright(c) Microsoft, PictureTel 1992-1996
  7. // (C) 1997-2000 Microsoft Corp.
  8. /****************************************************************************/
  9. #ifndef _H_ASBCAPI
  10. #define _H_ASBCAPI
  11. #include <aoaapi.h>
  12. #include <achapi.h>
  13. /****************************************************************************/
  14. /* sbcEnabled flags */
  15. /****************************************************************************/
  16. #define SBC_NO_CACHE_ENABLED (0 << 0)
  17. #define SBC_BITMAP_CACHE_ENABLED (1 << 0)
  18. #define SBC_GLYPH_CACHE_ENABLED (1 << 1)
  19. #define SBC_BRUSH_CACHE_ENABLED (1 << 2)
  20. #define SBC_OFFSCREEN_CACHE_ENABLED (1 << 3)
  21. #ifdef DRAW_NINEGRID
  22. #define SBC_DRAWNINEGRID_CACHE_ENABLED (1 << 4)
  23. #endif
  24. #ifdef DRAW_GDIPLUS
  25. #define SBC_DRAWGDIPLUS_CACHE_ENABLED (1 << 5)
  26. #endif
  27. /****************************************************************************/
  28. /* Bitmap cache */
  29. /****************************************************************************/
  30. #define SBC_PROTOCOL_BPP 8
  31. #define SBC_NUM_8BPP_COLORS 256
  32. #define SBC_CACHE_0_DIMENSION 16
  33. #define SBC_CACHE_0_DIMENSION_SHIFT 4
  34. // Cache IDs have a protocol-implicit cell size, starting from 256 and
  35. // increasing in factors of 4.
  36. #ifdef DC_HICOLOR
  37. #define SBC_CellSizeFromCacheID(_id) \
  38. ((TS_BITMAPCACHE_0_CELL_SIZE << (2 * (_id))) \
  39. * ((sbcClientBitsPerPel + 7) / 8))
  40. #else
  41. #define SBC_CellSizeFromCacheID(_id) \
  42. (TS_BITMAPCACHE_0_CELL_SIZE << (2 * (_id)))
  43. #endif
  44. /****************************************************************************/
  45. /* Glyph cache */
  46. /****************************************************************************/
  47. #define SBC_NUM_GLYPH_CACHES 10
  48. #define CAPS_GLYPH_SUPPORT_NONE 0
  49. #define CAPS_GLYPH_SUPPORT_PARTIAL 1
  50. #define CAPS_GLYPH_SUPPORT_FULL 2
  51. #define CAPS_GLYPH_SUPPORT_ENCODE 3
  52. // Color table cache entries. Note the size of this cache is by consensus with
  53. // the client -- we do not currently actually negotiate the color cache
  54. // capabilities in TS_COLORTABLECACHE_CAPABILITYSET.
  55. #define SBC_NUM_COLOR_TABLE_CACHE_ENTRIES 6
  56. /****************************************************************************/
  57. /* Define the maximum server cache sizes. */
  58. /* */
  59. /* These values are negotiated down with the client to determine the actual */
  60. /* cache sizes used. */
  61. /****************************************************************************/
  62. #define SBC_GL_CACHE1_MAX_CELL_SIZE 2048
  63. #define SBC_GL_CACHE2_MAX_CELL_SIZE 2048
  64. #define SBC_GL_CACHE3_MAX_CELL_SIZE 2048
  65. #define SBC_GL_CACHE4_MAX_CELL_SIZE 2048
  66. #define SBC_GL_CACHE5_MAX_CELL_SIZE 2048
  67. #define SBC_GL_CACHE6_MAX_CELL_SIZE 2048
  68. #define SBC_GL_CACHE7_MAX_CELL_SIZE 2048
  69. #define SBC_GL_CACHE8_MAX_CELL_SIZE 2048
  70. #define SBC_GL_CACHE9_MAX_CELL_SIZE 2048
  71. #define SBC_GL_CACHE10_MAX_CELL_SIZE 2048
  72. #define SBC_GL_MAX_CACHE_ENTRIES 254
  73. /****************************************************************************/
  74. /* Fragment cache */
  75. /****************************************************************************/
  76. #define SBC_NUM_FRAG_CACHES 1
  77. /****************************************************************************/
  78. /* Define the maximum server cache sizes. */
  79. /* */
  80. /* These values are negotiated down with the client to determine the actual */
  81. /* cache sizes used. */
  82. /****************************************************************************/
  83. #define SBC_FG_CACHE_MAX_CELL_SIZE 256
  84. #define SBC_FG_CACHE_MAX_ENTRIES 256
  85. /****************************************************************************/
  86. // Reg keys and flags for disabling caches.
  87. /****************************************************************************/
  88. #define SBC_INI_CACHING_DISABLED L"Caching Disabled"
  89. #define SBC_DEFAULT_CACHING_DISABLED 0
  90. #define SBC_DISABLE_BITMAP_CACHE 0x01
  91. #define SBC_DISABLE_BRUSH_CACHE 0x02
  92. #define SBC_DISABLE_GLYPH_CACHE 0x04
  93. #define SBC_DISABLE_OFFSCREEN_CACHE 0x08
  94. #ifdef DRAW_NINEGRID
  95. #define SBC_DISABLE_DRAWNINEGRID_CACHE 0x10
  96. #endif
  97. #ifdef DRAW_GDIPLUS
  98. #define SBC_DISABLE_DRAWGDIPLUS_CACHE 0x20
  99. #endif
  100. /****************************************************************************/
  101. // Structure: SBC_BITMAP_CACHE_INFO
  102. //
  103. // Description: Information stored for each bitmap cache.
  104. /****************************************************************************/
  105. typedef struct tagSBC_BITMAP_CACHE_INFO
  106. {
  107. CHCACHEHANDLE cacheHandle;
  108. CHCACHEHANDLE waitingListHandle;
  109. // flag indicates if the cache needs to be cleared
  110. unsigned fClearCache;
  111. TS_BITMAPCACHE_CELL_CACHE_INFO Info;
  112. // Work tile bitmap information - surface handle, pointer to the bitmap
  113. // bits.
  114. HSURF hWorkBitmap;
  115. BYTE *pWorkBitmapBits;
  116. #ifdef DC_DEBUG
  117. // Pointer to extra info array for each entry. Used to detect key
  118. // generation algorithm collisions.
  119. BYTE *pExtraEntryInfo;
  120. #endif
  121. } SBC_BITMAP_CACHE_INFO, *PSBC_BITMAP_CACHE_INFO;
  122. /****************************************************************************/
  123. /* Structure: SBC_GLYPH_CACHE_INFO */
  124. /* */
  125. /* Description: Information stored for each glyph cache. */
  126. /****************************************************************************/
  127. typedef struct tagSBC_GLYPH_CACHE_INFO
  128. {
  129. CHCACHEHANDLE cacheHandle;
  130. unsigned cbCellSize;
  131. unsigned cbUseCount;
  132. } SBC_GLYPH_CACHE_INFO, *PSBC_GLYPH_CACHE_INFO;
  133. /****************************************************************************/
  134. /* Structure: SBC_FRAG_CACHE_INFO */
  135. /* */
  136. /* Description: Information stored for each frag cache. */
  137. /****************************************************************************/
  138. typedef struct tagSBC_FRAG_CACHE_INFO
  139. {
  140. CHCACHEHANDLE cacheHandle;
  141. unsigned cbCellSize;
  142. } SBC_FRAG_CACHE_INFO, *PSBC_FRAG_CACHE_INFO;
  143. /****************************************************************************/
  144. /* Structure: SBC_BRUSH_CACHE_INFO */
  145. /* */
  146. /* Description: Information stored for each brush cache. */
  147. /****************************************************************************/
  148. typedef struct tagSBC_BRUSH_CACHE_INFO
  149. {
  150. CHCACHEHANDLE cacheHandle;
  151. } SBC_BRUSH_CACHE_INFO, *PSBC_BRUSH_CACHE_INFO;
  152. /****************************************************************************/
  153. // SBC_OFFSCREEN_BITMAP_CACHE_INFO
  154. //
  155. // Description: Information stored for the offscreen bitmap cache
  156. /****************************************************************************/
  157. typedef struct tagSBC_OFFSCREEN_BITMAP_CACHE_INFO
  158. {
  159. unsigned supportLevel;
  160. unsigned cacheSize;
  161. unsigned cacheEntries;
  162. } SBC_OFFSCREEN_BITMAP_CACHE_INFO, *PSBC_OFFSCREEN_BITMAP_CACHE_INFO;
  163. #ifdef DRAW_NINEGRID
  164. /****************************************************************************/
  165. // SBC_DRAWNINEGRID_BITMAP_CACHE_INFO
  166. //
  167. // Description: Information stored for the drawninegrid bitmap cache
  168. /****************************************************************************/
  169. typedef struct tagSBC_DRAWNINEGRID_BITMAP_CACHE_INFO
  170. {
  171. unsigned supportLevel;
  172. unsigned cacheSize;
  173. unsigned cacheEntries;
  174. } SBC_DRAWNINEGRID_BITMAP_CACHE_INFO, *PSBC_DRAWNINEGRID_BITMAP_CACHE_INFO;
  175. #endif
  176. #ifdef DRAW_GDIPLUS
  177. /****************************************************************************/
  178. // SBC_DRAWGDIPLUS_INFO
  179. //
  180. // Description: Information stored for the drawgdiplus
  181. /****************************************************************************/
  182. typedef struct tagSBC_DRAWGDIPLUS_INFO
  183. {
  184. unsigned supportLevel;
  185. unsigned GdipVersion;
  186. unsigned GdipCacheLevel;
  187. TS_GDIPLUS_CACHE_ENTRIES GdipCacheEntries;
  188. TS_GDIPLUS_CACHE_CHUNK_SIZE GdipCacheChunkSize;
  189. TS_GDIPLUS_IMAGE_CACHE_PROPERTIES GdipImageCacheProperties;
  190. } SBC_DRAWGDIPLUS_INFO, *PSBC_DRAWGDIPLUS_INFO;
  191. #endif
  192. /****************************************************************************/
  193. /* Structure: SBC_CACHE_SIZE */
  194. /* */
  195. /* Description: */
  196. /****************************************************************************/
  197. typedef struct tagSBC_CACHE_SIZE
  198. {
  199. unsigned cEntries;
  200. unsigned cbCellSize;
  201. } SBC_CACHE_SIZE, *PSBC_CACHE_SIZE;
  202. /****************************************************************************/
  203. // Structure: SBC_NEGOTIATED_CAPABILITIES
  204. //
  205. // Description:
  206. /****************************************************************************/
  207. typedef struct tagSBC_NEGOTIATED_CAPABILITIES
  208. {
  209. SBC_CACHE_SIZE glyphCacheSize[SBC_NUM_GLYPH_CACHES];
  210. SBC_CACHE_SIZE fragCacheSize[SBC_NUM_FRAG_CACHES];
  211. UINT16 GlyphSupportLevel;
  212. UINT32 brushSupportLevel;
  213. } SBC_NEGOTIATED_CAPABILITIES, *PSBC_NEGOTIATED_CAPABILITIES;
  214. /****************************************************************************/
  215. // SBC_BITMAP_CACHE_KEY_INFO
  216. //
  217. // Cache information required to hold either persistent bitmap cache keys
  218. // sent from the client or to transition from a disconnect of a temporary
  219. // login display driver instance to a reconnect to an existing display driver
  220. // session.
  221. /****************************************************************************/
  222. typedef struct
  223. {
  224. UINT32 Key1, Key2;
  225. unsigned CacheIndex;
  226. } SBC_MRU_KEY, *PSBC_MRU_KEY;
  227. typedef struct
  228. {
  229. unsigned TotalKeys;
  230. unsigned NumKeys[TS_BITMAPCACHE_MAX_CELL_CACHES];
  231. unsigned KeyStart[TS_BITMAPCACHE_MAX_CELL_CACHES];
  232. unsigned pad;
  233. SBC_MRU_KEY Keys[1];
  234. } SBC_BITMAP_CACHE_KEY_INFO, *PSBC_BITMAP_CACHE_KEY_INFO;
  235. /****************************************************************************/
  236. // Structure: SBC_SHARED_DATA
  237. //
  238. // Description: SBC data shared between DD and WD.
  239. /****************************************************************************/
  240. typedef struct tagSBC_SHARED_DATA
  241. {
  242. unsigned bUseRev2CacheBitmapOrder : 1;
  243. unsigned fCachingEnabled : 1;
  244. unsigned fClearCache : 1;
  245. unsigned newCapsData : 1;
  246. unsigned syncRequired : 1;
  247. unsigned fDisableOffscreen : 1;
  248. #ifdef DRAW_NINEGRID
  249. unsigned fDisableDrawNineGrid : 1;
  250. #endif
  251. unsigned fAllowCacheWaitingList : 1;
  252. unsigned NumBitmapCaches;
  253. #ifdef DRAW_GDIPLUS
  254. unsigned fDisableDrawGdiplus: 1;
  255. #endif
  256. CHCACHEHANDLE hFastPathCache;
  257. SBC_BITMAP_CACHE_INFO bitmapCacheInfo[TS_BITMAPCACHE_MAX_CELL_CACHES];
  258. SBC_GLYPH_CACHE_INFO glyphCacheInfo[SBC_NUM_GLYPH_CACHES];
  259. SBC_FRAG_CACHE_INFO fragCacheInfo[SBC_NUM_FRAG_CACHES];
  260. SBC_OFFSCREEN_BITMAP_CACHE_INFO offscreenCacheInfo;
  261. #ifdef DRAW_NINEGRID
  262. SBC_DRAWNINEGRID_BITMAP_CACHE_INFO drawNineGridCacheInfo;
  263. #endif
  264. #ifdef DRAW_GDIPLUS
  265. SBC_DRAWGDIPLUS_INFO drawGdiplusInfo;
  266. #endif
  267. SBC_NEGOTIATED_CAPABILITIES caps;
  268. #ifdef DC_HICOLOR
  269. unsigned clientBitsPerPel;
  270. #endif
  271. } SBC_SHARED_DATA, *PSBC_SHARED_DATA;
  272. #ifdef DC_DEBUG
  273. /****************************************************************************/
  274. // SBC_BITMAP_CACHE_EXTRA_INFO
  275. //
  276. // Information stored parallel to CH cache nodes for SBC bitmap caches.
  277. /****************************************************************************/
  278. typedef struct
  279. {
  280. unsigned DataSize;
  281. } SBC_BITMAP_CACHE_EXTRA_INFO;
  282. #endif
  283. #endif /* _H_ASBCAPI */