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.

107 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. tiffstub.h
  5. Abstract:
  6. Miminal set of declarations for dealing with TIFF files. We need this in the
  7. monitor because a fax print job may consist of several TIFF files concatenated
  8. together. We must patch it up into a single valid TIFF before passing it to
  9. the fax service.
  10. Environment:
  11. Windows XP fax print monitor
  12. Revision History:
  13. 02/25/96 -davidx-
  14. Created it.
  15. dd-mm-yy -author-
  16. description
  17. --*/
  18. #ifndef _TIFFSTUB_H_
  19. #define _TIFFSTUB_H_
  20. //
  21. // Constants for various TIFF data types
  22. //
  23. #define TIFFTYPE_BYTE 1
  24. #define TIFFTYPE_ASCII 2
  25. #define TIFFTYPE_SHORT 3
  26. #define TIFFTYPE_LONG 4
  27. #define TIFFTYPE_RATIONAL 5
  28. #define TIFFTYPE_SBYTE 6
  29. #define TIFFTYPE_UNDEFINED 7
  30. #define TIFFTYPE_SSHORT 8
  31. #define TIFFTYPE_SLONG 9
  32. #define TIFFTYPE_SRATIONAL 10
  33. #define TIFFTYPE_FLOAT 11
  34. #define TIFFTYPE_DOUBLE 12
  35. //
  36. // Constants for TIFF tags which we're interested in
  37. //
  38. #define TIFFTAG_STRIPOFFSETS 273
  39. #define TIFFTAG_STRIPBYTECOUNTS 279
  40. //
  41. // Data structure for representing a single IFD entry
  42. //
  43. typedef struct {
  44. WORD tag; // field tag
  45. WORD type; // field type
  46. DWORD count; // number of values
  47. DWORD value; // value or value offset
  48. } IFDENTRY;
  49. typedef IFDENTRY UNALIGNED *PIFDENTRY_UNALIGNED;
  50. //
  51. // Data structure for representing an IFD
  52. //
  53. typedef struct {
  54. WORD wEntries;
  55. IFDENTRY ifdEntries[1];
  56. } IFD;
  57. typedef IFD UNALIGNED *PIFD_UNALIGNED;
  58. //
  59. // Determine whether we're at the beginning of a TIFF file
  60. //
  61. #define ValidTiffFileHeader(p) \
  62. (((LPSTR) (p))[0] == 'I' && ((LPSTR) (p))[1] == 'I' && \
  63. ((PBYTE) (p))[2] == 42 && ((PBYTE) (p))[3] == 0)
  64. //
  65. // Read a DWORD value from an unaligned address
  66. //
  67. #define ReadUnalignedDWord(p) *((DWORD UNALIGNED *) (p))
  68. //
  69. // Write a DWORD value to an unaligned address
  70. //
  71. #define WriteUnalignedDWord(p, value) (*((DWORD UNALIGNED *) (p)) = (value))
  72. #endif // !_TIFFSTUB_H_