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.

77 lines
3.4 KiB

  1. #ifndef __FONT_VALIDATION_STATUS_CODES_H
  2. #define __FONT_VALIDATION_STATUS_CODES_H
  3. //
  4. // Detailed status codes for function CheckInfWithStatusA().
  5. // These codes were added after the initial creation of the T1 installer library.
  6. // CheckInfA() returns TRUE/FALSE. However, a FALSE return value was
  7. // not sufficiently descriptive for a user interface to respond appropriately.
  8. // The function CheckInfWithStatusA() was added to provide detailed status info.
  9. // No new return points were added to T1 installer functions. These codes merely
  10. // replace the original TRUE/FALSE return values.
  11. //
  12. // These codes are also used in the font folder font validation functions.
  13. //
  14. // The code is designed to return information that identifies:
  15. // a) What happened.
  16. // b) What file the status applies to (if applicable).
  17. //
  18. //
  19. // bit-> 15 7 0
  20. // +-+----------------+-----------------+
  21. // |S| Status Code | File Type Code |
  22. // +-+----------------+-----------------+
  23. // |
  24. // +--- Severity bit.
  25. //
  26. // 1 = Error. A true error like file i/o, mem alloc etc.
  27. // 0 = No error. But status may indicate invalid font file.
  28. //
  29. // >>>>>>> NOTE <<<<<<<<
  30. //
  31. // This file contains codes that are generated by the
  32. // T1 installer function CheckType1A and by related font folder functions.
  33. // Since both the T1 installer and the font folder must understand
  34. // these codes, the font folder must include this file. I apologize for
  35. // this added coupling between the T1 installer and the font folder but
  36. // it is necessary for detailed status reporting [brianau].
  37. //
  38. #define FVS_FILE_UNK 0x00 // File unknown or "doesn't matter".
  39. #define FVS_FILE_PFM 0x01 // PFM file
  40. #define FVS_FILE_PFB 0x02 // PFB file
  41. #define FVS_FILE_AFM 0x03 // AFM file
  42. #define FVS_FILE_INF 0x04 // INF file
  43. #define FVS_FILE_TTF 0x05 // TTF file
  44. #define FVS_FILE_FOT 0x06 // FOT file
  45. //
  46. // Status codes.
  47. //
  48. #define FVS_SUCCESS 0x00 // No problem!
  49. #define FVS_INVALID_FONTFILE 0x01 // Invalid font file or file name.
  50. #define FVS_BAD_VERSION 0x02 // File version not supported.
  51. #define FVS_FILE_BUILD_ERR 0x03 // Error building a font file.
  52. #define FVS_FILE_EXISTS 0x04 // File already exists.
  53. #define FVS_FILE_OPEN_ERR 0x05 // Couldn't find/open existing file.
  54. //
  55. // These codes indicate true system errors. Note use of high bit
  56. // to indicate severity.
  57. //
  58. #define FVS_FILE_CREATE_ERR 0x80 // Couldn't create new file.
  59. #define FVS_FILE_IO_ERR 0x81 // General file I/O error.
  60. #define FVS_INVALID_ARG 0x82 // Invalid arg passed to function.
  61. #define FVS_EXCEPTION 0x83 // Exception caught.
  62. #define FVS_INSUFFICIENT_BUF 0x84 // Destination buf too small.
  63. #define FVS_MEM_ALLOC_ERR 0x85 // Error allocating memory.
  64. #define FVS_INVALID_STATUS 0x86 // For ensuring status was set.
  65. //
  66. // Macros for creating and parsing status codes.
  67. //
  68. #define FVS_MAKE_CODE(c,f) ((WORD)(((BYTE)(c) << 8) | (BYTE)(f))) // Build code
  69. #define FVS_STATUS(c) (((c) >> 8) & 0x00FF) // Get status part
  70. #define FVS_FILE(c) ((c) & 0x00FF) // Get file part
  71. #define FVS_ISERROR(c) (((c) & 0x8000) != 0) // Severity bit == 1 ?
  72. #endif