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.

278 lines
8.5 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: fontcs.h
  3. *
  4. * Copyright (c) 1997-1999 Microsoft Corporation
  5. \**************************************************************************/
  6. #define FONT_SERVER_BUFFER_SIZE 0xFFF00
  7. typedef double Align;
  8. #define HEAP_RESERVE 0x100000
  9. #define HEAP_COMMIT 0x10000
  10. #define HEAP_FREE 0x1000
  11. #define ROUNDUP(x,y) ((y)*(((x)+(y)-1)/(y)))
  12. #define SBRK_ERR (char*)(-1)
  13. typedef union _HEADER {
  14. struct {
  15. DWORD Tag;
  16. union _HEADER *pNext;
  17. unsigned cUnits;
  18. unsigned cUnused;
  19. };
  20. Align x;
  21. } HEADER;
  22. typedef union _HEAP_OBJECT {
  23. struct {
  24. unsigned FreeAlign;
  25. unsigned CommitAlign;
  26. char *pLinearBase;
  27. unsigned iFree;
  28. unsigned iUncommitted;
  29. unsigned iUnreserved;
  30. HEADER *pFree; // pointer to free HEADER block
  31. HEADER AllocBase; // base HEADER structure for allocation
  32. };
  33. Align x;
  34. } HEAP_OBJECT;
  35. typedef enum _DRVPROCID {
  36. IdEnableDriver = 0,
  37. IdEnablePDEV = 1,
  38. IdDisablePDEV = 2,
  39. IdCompletePDEV = 3,
  40. IdQueryFont = 4,
  41. IdQueryFontTree = 5,
  42. IdQueryFontData = 6,
  43. IdDestroyFont = 7,
  44. IdQueryFontCaps = 8,
  45. IdLoadFontFile = 9,
  46. IdUnloadFontFile = 10,
  47. IdQueryFontFile = 11,
  48. IdQueryAdvanceWidths = 12,
  49. IdFree = 13,
  50. IdQueryTrueTypeTable = 14,
  51. IdQueryTrueTypeOutline = 15,
  52. IdGetTrueTypeFile = 16,
  53. IdEscape = 17
  54. } DRVPROCID;
  55. typedef enum _DRIVER_ID {
  56. BogusDriverId = 0,
  57. TrueTypeDriverId = 1,
  58. ATMDriverId = 2
  59. } DRIVER_ID;
  60. typedef union _PROXYMSG {
  61. struct {
  62. DRIVER_ID DriverId; // 1=TrueType,2=ATM,...
  63. DRVPROCID ProcId;
  64. unsigned cjThis; // includes header
  65. struct {
  66. int bVerbose : 1; // for debugging
  67. int bException: 1;
  68. } Flags;
  69. union {
  70. struct {
  71. BOOL ReturnValue ;
  72. ULONG iEngineVersion;
  73. ULONG cj ;
  74. DRVENABLEDATA *pded ;
  75. } EnableDriver_;
  76. struct {
  77. DHPDEV ReturnValue ;
  78. DEVMODEW *pdm ;
  79. LPWSTR pwszLogAddress;
  80. ULONG cPat ;
  81. HSURF *phsurfPatterns;
  82. ULONG cjCaps ;
  83. ULONG *pGdiInfo ;
  84. ULONG cjDevInfo ;
  85. DEVINFO *pdi ;
  86. HDEV hdev ;
  87. LPWSTR pwszDeviceName;
  88. HANDLE hDriver ;
  89. } EnablePDEV_;
  90. struct {
  91. DHPDEV dhpdev;
  92. } DisablePDEV_;
  93. struct {
  94. DHPDEV dhpdev;
  95. HDEV hdev ;
  96. } CompletePDEV_;
  97. struct {
  98. IFIMETRICS *ReturnValue;
  99. DHPDEV dhpdev ;
  100. ULONG iFile ;
  101. ULONG iFace ;
  102. ULONG *pid ;
  103. } QueryFont_;
  104. struct {
  105. PVOID ReturnValue ;
  106. DHPDEV dhpdev ;
  107. ULONG iFile ;
  108. ULONG iFace ;
  109. ULONG iMode ;
  110. ULONG *pid ;
  111. } QueryFontTree_;
  112. struct {
  113. LONG ReturnValue;
  114. DHPDEV dhpdev ;
  115. FONTOBJ *pfo ;
  116. ULONG iMode ;
  117. HGLYPH hg ;
  118. GLYPHDATA *pgd ;
  119. PVOID pv ;
  120. ULONG cjSize ;
  121. } QueryFontData_;
  122. struct {
  123. FONTOBJ *pfo;
  124. } DestroyFont_;
  125. struct {
  126. LONG ReturnValue;
  127. ULONG culCaps ;
  128. ULONG *pulCaps ;
  129. } QueryFontCaps_;
  130. struct {
  131. ULONG ReturnValue;
  132. ULONG cFiles ;
  133. ULONG *piFile ;
  134. PVOID *ppvView ;
  135. ULONG *pcjView ;
  136. DESIGNVECTOR *pdv ;
  137. ULONG ulLangID ;
  138. } LoadFontFile_;
  139. struct {
  140. BOOL ReturnValue;
  141. ULONG iFile ;
  142. } UnloadFontFile_;
  143. struct {
  144. LONG ReturnValue;
  145. ULONG iFile ;
  146. ULONG ulMode ;
  147. ULONG cjBuf ;
  148. ULONG *pulBuf ;
  149. } QueryFontFile_;
  150. struct {
  151. BOOL ReturnValue;
  152. DHPDEV dhpdev ;
  153. FONTOBJ *pfo ;
  154. ULONG iMode ;
  155. HGLYPH *phg ;
  156. PVOID pvWidths ;
  157. ULONG cGlyphs ;
  158. } QueryAdvanceWidths_;
  159. struct {
  160. PVOID pv;
  161. ULONG id;
  162. } Free_;
  163. struct {
  164. LONG ReturnValue;
  165. ULONG iFile ;
  166. ULONG ulFont ;
  167. ULONG ulTag ;
  168. PTRDIFF dpStart ;
  169. ULONG cjBuf ;
  170. BYTE *pjBuf ;
  171. BYTE **ppjTable ;
  172. ULONG *pcjTable ;
  173. } QueryTrueTypeTable_;
  174. struct {
  175. LONG ReturnValue ;
  176. DHPDEV dhpdev ;
  177. FONTOBJ *pfo ;
  178. HGLYPH hglyph ;
  179. BOOL bMetricsOnly;
  180. GLYPHDATA *pgldt ;
  181. ULONG cjBuf ;
  182. TTPOLYGONHEADER *ppoly ;
  183. } QueryTrueTypeOutline_;
  184. struct {
  185. PVOID ReturnValue;
  186. ULONG iFile ;
  187. ULONG *pcj ;
  188. } GetTrueTypeFile_;
  189. struct {
  190. ULONG ReturnValue;
  191. SURFOBJ *pso ;
  192. ULONG iEsc ;
  193. ULONG cjIn ;
  194. PVOID pvIn ;
  195. ULONG cjOut ;
  196. PVOID pvOut ;
  197. } Escape_;
  198. };
  199. ULONG LastError;
  200. USHORT OemCodePage;
  201. USHORT AnsiCodePage;
  202. PVOID pToBeFreed;
  203. ULONG idToBeFreed;
  204. unsigned cjScratch;
  205. char *pScratch;
  206. };
  207. char InitialIdentifier[32];
  208. double x; // forces double alignment of the entire PROXYMSG
  209. } PROXYMSG;
  210. typedef struct _FXOBJ {
  211. FONTOBJ fo;
  212. XFORML xform;
  213. ULONG i;
  214. } FXOBJ;
  215. //
  216. // The STATE structure describes the state of the CLIENT SERVER mechanism
  217. //
  218. typedef struct _STATE {
  219. unsigned SizeOfBuffer; // size of user mode buffer = pMsg->cjThis
  220. DRIVER_ID DriverId; // Identifies specific user mode driver
  221. PROXYMSG *pMsg; // pointer to message buffer
  222. struct {
  223. unsigned DontCallServer : 1;
  224. } flags;
  225. } STATE;
  226. #define PSTATE(p) ((STATE*)(p)->pvConsumer)
  227. #define UMFD_TAG 'dfmu'
  228. typedef enum _PATH_PROC_TYPE {
  229. isMoveTo = 0
  230. , isPolyLineTo = 1
  231. , isPolyBezierTo = 2
  232. , isCloseFigure = 3
  233. } PATH_PROC_TYPE;
  234. typedef union _PATH_RECORD {
  235. struct {
  236. union _PATH_RECORD *pNext;
  237. PATH_PROC_TYPE Type;
  238. ULONG Count;
  239. };
  240. double x;
  241. } PATH_RECORD;
  242. //
  243. // POINTFIX* POINTER_TO_FIRST_POINT(PATH_RECORD*)
  244. //
  245. // Returns a pointer to the first POINTFIX structure immediately
  246. // following the PATH_RECORD structure
  247. //
  248. #define POINTER_TO_FIRST_POINT(p) ((POINTFIX*)((PATH_RECORD*)(p)+1))
  249. typedef union _PATH_HEADER {
  250. struct {
  251. PATHOBJ Object;
  252. PROXYMSG *pMsg;
  253. unsigned BytesRemaining; // bytes available for allocation
  254. PATH_RECORD *pLast; // pointer to last allocated record
  255. PATH_RECORD *pNext; // pointer to next available address
  256. };
  257. double x;
  258. } PATH_HEADER;