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.

158 lines
5.4 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: mapfile.h
  3. *
  4. * Created: 26-Oct-1990 18:07:56
  5. * Author: Bodin Dresevic [BodinD]
  6. *
  7. * Copyright (c) 1990-1999 Microsoft Corporation
  8. *
  9. \**************************************************************************/
  10. // warning the first two fields of FILEVIEW and FONTFILE view must be
  11. // the same so that they can be used in common routines
  12. typedef struct _FILEVIEW {
  13. LARGE_INTEGER LastWriteTime; // time stamp
  14. PVOID pvKView; // for kernel mode font access
  15. PVOID pvViewFD; // font driver process view of file
  16. ULONG cjView; // size of font file view in bytes
  17. void *pSection; // kernel mode pointer to the section object
  18. BOOL bLastUpdated; // Add this for the bug #383101
  19. } FILEVIEW, *PFILEVIEW;
  20. typedef struct _FONTFILEVIEW {
  21. FILEVIEW fv;
  22. LPWSTR pwszPath; // path of the file
  23. SIZE_T ulRegionSize; // used by ZwFreeVirtualMemory
  24. ULONG cKRefCount; // kernel mode load count
  25. ULONG cRefCountFD; // font driver load count
  26. PVOID SpoolerBase; // base of spooler's view of spooler section
  27. W32PID SpoolerPid; // spooler pid
  28. } FONTFILEVIEW, *PFONTFILEVIEW;
  29. #define FONTFILEVIEW_bRemote(p) (((FONTFILEVIEW*)(p))->pwszPath==0)
  30. //moved from "engine.h"
  31. typedef struct tagDOWNLOADFONTHEADER
  32. {
  33. ULONG Type1ID; // if non-zero then this is a remote Type1 font
  34. ULONG NumFiles;
  35. ULONG FileOffsets[1];
  36. }DOWNLOADFONTHEADER,*PDOWNLOADFONTHEADER;
  37. // file mapping
  38. BOOL bMapFile(
  39. PWSTR pwszFileName,
  40. PFILEVIEW pfvw,
  41. INT iFileSize,
  42. BOOL *pbIsFAT
  43. );
  44. VOID vUnmapFile( PFILEVIEW pfvw );
  45. INT cComputeGlyphSet(
  46. WCHAR *pwc, // input buffer with a sorted array of cChar supported WCHAR's
  47. BYTE *pj, // input buffer with original ansi values
  48. INT cChar,
  49. INT cRuns, // if nonzero, the same as return value
  50. FD_GLYPHSET *pgset // output buffer to be filled with cRanges runs
  51. );
  52. INT cUnicodeRangesSupported(
  53. INT cp, // code page, not used for now, the default system code page is used
  54. INT iFirstChar, // first ansi char supported
  55. INT cChar, // # of ansi chars supported, cChar = iLastChar + 1 - iFirstChar
  56. WCHAR *pwc, // input buffer with a sorted array of cChar supported WCHAR's
  57. BYTE *pj
  58. );
  59. // size of glyphset with runs and glyph handles appended at the bottom
  60. #define SZ_GLYPHSET(cRuns, cGlyphs) \
  61. (offsetof(FD_GLYPHSET,awcrun) \
  62. + sizeof(WCRUN)*(cRuns) \
  63. + sizeof(HGLYPH)*(cGlyphs))
  64. //
  65. // WINBUG #83140 2-7-2000 bhouse Investgate removal of vToUNICODEN macro
  66. // Old Comment:
  67. // - bogus macro that we need to remove.
  68. //
  69. #define vToUNICODEN( pwszDst, cwch, pszSrc, cch ) \
  70. { \
  71. EngMultiByteToUnicodeN((LPWSTR)(pwszDst),(ULONG)((cwch)*sizeof(WCHAR)), \
  72. (PULONG)NULL,(PSZ)(pszSrc),(ULONG)(cch)); \
  73. (pwszDst)[(cwch)-1] = 0; \
  74. }
  75. typedef struct _CP_GLYPHSET {
  76. UINT uiRefCount; // Number of references to this FD_GLYPHSET
  77. UINT uiFirstChar; // First char supported
  78. UINT uiLastChar; // Last char supported
  79. BYTE jCharset; // charset
  80. struct _CP_GLYPHSET *pcpNext; // Next element in list
  81. FD_GLYPHSET gset; // The actual glyphset
  82. } CP_GLYPHSET;
  83. CP_GLYPHSET
  84. *pcpComputeGlyphset(
  85. CP_GLYPHSET **pcpHead,
  86. UINT uiFirst,
  87. UINT uiLast,
  88. BYTE jCharSet
  89. );
  90. VOID
  91. vUnloadGlyphset(
  92. CP_GLYPHSET **pcpHead,
  93. CP_GLYPHSET *pcpTarget
  94. );
  95. // needed in font substitutions
  96. // FACE_CHARSET structure represents either value name or the value data
  97. // of an entry in the font substitution section of "win.ini".
  98. // this flag describes one of the old style entries where char set is not
  99. // specified.
  100. #define FJ_NOTSPECIFIED 1
  101. // this flag indicates that the charset is not one of those that the
  102. // system knows about. Could be garbage or application defined charset.
  103. #define FJ_GARBAGECHARSET 2
  104. typedef struct _FACE_CHARSET {
  105. WCHAR awch[LF_FACESIZE];
  106. BYTE jCharSet;
  107. BYTE fjFlags;
  108. } FACE_CHARSET;
  109. VOID vCheckCharSet(FACE_CHARSET *pfcs, const WCHAR * pwsz); // in mapfile.c
  110. #define IS_DBCS_CHARSET(CharSet) (((CharSet) == DBCS_CHARSET) ? TRUE : FALSE)
  111. #define IS_ANY_DBCS_CHARSET( CharSet ) \
  112. ( ((CharSet) == SHIFTJIS_CHARSET) ? TRUE : \
  113. ((CharSet) == HANGEUL_CHARSET) ? TRUE : \
  114. ((CharSet) == CHINESEBIG5_CHARSET) ? TRUE : \
  115. ((CharSet) == GB2312_CHARSET) ? TRUE : FALSE )
  116. #define IS_ANY_DBCS_CODEPAGE( CodePage ) (((CodePage) == 932) ? TRUE : \
  117. ((CodePage) == 949) ? TRUE : \
  118. ((CodePage) == 950) ? TRUE : \
  119. ((CodePage) == 936) ? TRUE : FALSE )