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.

143 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. oldsfiff.h
  5. Abstract:
  6. Data structures used for reading the NT 4.0 font installer file format.
  7. Typically used by drivers during upgrade from NT 4.0 to 5.0.
  8. EnabldPDEV() time - at the time of writing! Subject to change as the
  9. DDI/GDI change.
  10. Environment:
  11. Windows NT Unidrv driver
  12. Revision History:
  13. 12/02/96 -ganeshp-
  14. Created
  15. dd-mm-yy -author-
  16. description
  17. --*/
  18. /*
  19. * The following structure is returned from the FIOpenRead() function,
  20. * and contains the basic information needed to access the data in the
  21. * file once it is memory mapped.
  22. */
  23. typedef struct
  24. {
  25. VOID *hFile; /* Font installer file, for downloaded part */
  26. BYTE *pbBase; /* Base address of data as mapped */
  27. void *pvFix; /* Fixed part at start of file */
  28. ULONG ulFixSize; /* Bytes in fixed data record */
  29. ULONG ulVarOff; /* File offset of data, relative file start */
  30. ULONG ulVarSize; /* Bytes in variable part */
  31. } FI_MEM;
  32. /*
  33. * Definitions used in the font file. This is the file which holds
  34. * information about cartridge and download fonts. The file format
  35. * is quite basic: a header for verification; then an array of
  36. * records, each with a header. These records contain FONTMAP
  37. * information. Cartridges have an array of these, one for each
  38. * font. Finally, the tail of the file contains extra data, as
  39. * required. For download fonts, this would be the download data.
  40. *
  41. */
  42. /*
  43. * The file header. One of these is located at the beginning of the file.
  44. * The ulVarData field is relative to the beginning of the file. This
  45. * makes it easier to regenerate the file when fonts are deleted.
  46. */
  47. typedef struct
  48. {
  49. ULONG ulID; /* ID info - see value below */
  50. ULONG ulVersion; /* Version information - see below */
  51. ULONG ulFixData; /* Start of FF_REC_HEADER array */
  52. ULONG ulFixSize; /* Number of bytes in fixed section */
  53. ULONG ulRecCount; /* Number of records in fixed part */
  54. ULONG ulVarData; /* Start of variable data, rel to 0 */
  55. ULONG ulVarSize; /* Numbier of bytes in variable portion */
  56. } FF_HEADER;
  57. /*
  58. * Values for the ID and Version fields.
  59. */
  60. #define FF_ID 0x6c666e66 /* "fnfl" - fOnTfIlE */
  61. #define FF_VERSION 1 /* Start at the bottom */
  62. /*
  63. * Each entry in the file starts with the following header. Typically
  64. * there will be one of these for a softfont, and one per cartridge.
  65. * In the case of a cartridge, there will be an array of these, within
  66. * the master entry. Each sub-entry will be for one specific font.
  67. *
  68. * Note that there is a dummy entry at the end. This contains a 0
  69. * in the ulSize field - it is to mark the last one, and makes it
  70. * easier to manipulate the file.
  71. */
  72. typedef struct
  73. {
  74. ULONG ulRID; /* Record ID */
  75. ULONG ulNextOff; /* Offset from here to next record: 0 == end */
  76. ULONG ulSize; /* Bytes in this record */
  77. ULONG ulVarOff; /* Offset from start of variable data */
  78. ULONG ulVarSize; /* Number of bytes in variable part */
  79. } FF_REC_HEADER;
  80. #define FR_ID 0x63657266 /* "frec" - fONT recORD */
  81. /*
  82. * Define the file extensions used. The first is the name of the
  83. * font installer file; the others are temporaries used during update
  84. * of the (possibly) existing file.
  85. */
  86. #define FILE_FONTS L"fi_" /* "Existing" single file */
  87. #define TFILE_FIX L"fiX" /* Fixed part of file */
  88. #define TFILE_VAR L"fiV" /* Variable (optional) portion */
  89. #define FREEMODULE(hmodule) UnmapViewOfFile((PVOID) (hmodule))
  90. /*
  91. * Upgrade related Function Declarations.
  92. */
  93. INT
  94. IFIOpenRead(
  95. FI_MEM *pFIMem,
  96. PWSTR pwstrName
  97. );
  98. BOOL
  99. BFINextRead(
  100. FI_MEM *pFIMem
  101. );
  102. INT
  103. IFIRewind(
  104. FI_MEM *pFIMem
  105. );
  106. BOOL
  107. BFICloseRead(
  108. FI_MEM *pFIMem
  109. );
  110. PVOID MapFile(
  111. PWSTR pwstr
  112. );