Source code of Windows XP (NT5)
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.

317 lines
13 KiB

  1. /*==============================================================================
  2. This file includes the BUFFER typedef and standard meta-data values.
  3. 23-Feb-93 RajeevD Moved from ifaxos.h
  4. 17-Jul-93 KGallo Added STORED_BUF_DATA metadata type for buffers containing
  5. the stored info for another buffer.
  6. 28-Sep-93 ArulM Added RES_ ENCODE_ WIDTH_ and LENGTH_ typedefs
  7. ==============================================================================*/
  8. #ifndef _INC_BUFFERS
  9. #define _INC_BUFFERS
  10. //----------------------------- BUFFERS -------------------------
  11. /****
  12. @doc EXTERNAL IFAXOS DATATYPES
  13. @types BUFFER | The Buffer structure defines the buffer header
  14. structures which processes manipulate.
  15. @field WORD | fReadOnly | Specifies whether the buffer
  16. is readonly or not. It is the applications responsibility to
  17. check this flag and not violate it. <f IFBufMakeWritable> should
  18. be used if a process needs to write on a buffer which is
  19. marked readonly. This field should not be modified by the
  20. process itself.
  21. @field LPBYTE | lpbBegBuf | A far ptr pointing to the physical
  22. start of the buffer. This ptr has meaning only in the calling
  23. process's address space and should not be stored for any
  24. reason. It should not be modified either.
  25. @field WORD | wLengthBuf | Physical length of the buffer. Should
  26. not be modified by the process. Should be used in conjunction
  27. with <e BUFFER.lpbBegBuf> to know the physical boundaries of the buffer.
  28. @field DWORD | dwMetaData | Indicates the kind of data stored in
  29. the buffer. See <t STD_DATA_TYPES> for all the possible values
  30. of this field.
  31. @field LPBYTE | lpbBegData | Far ptr to the start of valid data in the
  32. buffer. The process is responsible for maintaining the integrity
  33. of this as it consumes or produces data in the buffer. The ptr should
  34. not be passed to any other process as it will not be valid. At buffer
  35. allocation time this field is initialized to point to the physical
  36. beginning of the buffer.
  37. @field LPBYTE | lpbCurPtr | One of the fields of a union containing
  38. lpbfNext and dwTemp as its other members.
  39. A general purpose far ptr which can be
  40. used to mark an interesting place in the buffer. Should be used as
  41. a temporary variable while processing the buffer. Should not be directly
  42. passed to any other process. Initialized
  43. to point to the beginning of the buffer at allocation time.
  44. Remember that this is a UNION !!
  45. @field LPBUFFER | lpbfNext | One of the fields of a union containing
  46. lpbCurPtr and dwTemp as its other members. This should be used
  47. when a module wants to internally link a list of buffers together.
  48. Remember that this is a UNION !!
  49. @field DWORD | dwTemp | One of the fields of a union containing
  50. lpbfNext and lpbCurPtr as its other members. This should be used when
  51. the module wants to store some random information in the header.
  52. Remember that this is a UNION !!
  53. @field WORD | wLengthData | Gives the length of valid contiguous data
  54. present in the buffer starting at <e BUFFER.lpbBegData>. The process is
  55. responsible for maintaining the integrity of this. Initialized to
  56. zero at allocation time.
  57. @comm There are other reserved fields in the structure which have not been
  58. mentioned here.
  59. @tagname _BUFFER
  60. @xref <f IFBufAlloc>
  61. ****/
  62. typedef struct _BUFFER
  63. {
  64. // Private portion
  65. struct _BUFFERDATA FAR *lpbdBufData;
  66. struct _BUFFER FAR *lpbfNextBuf;
  67. WORD wResFlags;
  68. // Read Only portion
  69. WORD fReadOnly; // Is the buffer readonly ??
  70. LPBYTE lpbBegBuf; // Physical start of buffer
  71. WORD wLengthBuf; // Length of buffer
  72. // Read write public portion
  73. WORD wLengthData; // length of valid data
  74. DWORD dwMetaData; // Used to store metadata information
  75. LPBYTE lpbBegData; // Ptr to start of data
  76. union
  77. {
  78. struct _BUFFER FAR* lpbfNext; // for linking buffers
  79. LPBYTE lpbCurPtr; // for local current position use
  80. DWORD dwTemp; // for general use
  81. };
  82. #ifdef VALIDATE
  83. // Dont touch this !!
  84. WORD sentinel; // debug sentinel
  85. #endif
  86. // C++ Extensions
  87. #ifdef __cplusplus
  88. LPBYTE EndBuf (void) FAR {return lpbBegBuf + wLengthBuf; }
  89. LPBYTE EndData (void) FAR {return lpbBegData + wLengthData;}
  90. void Reset (void) FAR {lpbBegData = lpbBegBuf; wLengthData = 0;}
  91. #endif // __cplusplus
  92. } BUFFER, FAR *LPBUFFER , FAR * FAR * LPLPBUFFER ;
  93. /********
  94. @doc EXTERNAL IFAXOS DATATYPES SRVRDLL OEMNSF
  95. @type DWORD | STD_DATA_TYPES | Standard data types used for
  96. specifying the format of data in the system.
  97. @emem MH_DATA | Modified Huffman (T.4 1-dimensional).
  98. @emem MR_DATA | Modified READ (T.4 2-dimensional).
  99. @emem MMR_DATA| Modified Modified READ (T.6).
  100. @emem LRAW_DATA | Raw bitmap data, Least Significant Bit to the left.
  101. @emem HRAW_DATA | Raw Bitmap data, Most Significant Bit to the left.
  102. @emem DCX_DATA | Industry standard DCX specification (collection of PCX pages).
  103. @emem ENCRYPTED_DATA | Data encrypted - original format unspecified.
  104. @emem SIGNED_DATA | Data along with a digital signature.
  105. @emem BINFILE_DATA | Arbitrary binary data.
  106. @emem STORED_BUF_DATA | Contains a BUFFER header & data.
  107. @emem DCP_TEMPLATE_DATA | Digital Cover Page template data.
  108. @emem DCP_DATA | Digital Cover Page processed template data.
  109. @emem SPOOL_DATA | Spool data type - same as MMR for now.
  110. @emem PRINTMODE_DATA | Printer Mode structure.
  111. @emem ASCII_DATA | Ascii text.
  112. @emem OLE_DATA | Ole object.
  113. @emem OLE_PICTURE | Ole Rendering Data.
  114. @emem END_OF_PAGE | End of page marker.
  115. @emem END_OF_JOB | End of job marker.
  116. @emem CUSTOM_METADATA_TYPE | Beyond this value custom data types can be
  117. defined.
  118. @comm This should be used to specify data type of any data stream in the
  119. system - from BUFFERS to Linearized Messages. All data types which
  120. need to be used in bit fields (i.e. the Format Resolution) must have
  121. a value which is a power of 2. Other data types which do not need to used
  122. in a bit field context may be assigned the other values.
  123. ********/
  124. #define MH_DATA 0x00000001L
  125. #define MR_DATA 0x00000002L
  126. #define MMR_DATA 0x00000004L
  127. #define LRAW_DATA 0x00000008L
  128. #define HRAW_DATA 0x00000010L
  129. #define DCX_DATA 0x00000020L
  130. #define ENCRYPTED_DATA 0x00000040L
  131. #define BINFILE_DATA 0x00000080L
  132. #define DCP_TEMPLATE_DATA 0x00000100L
  133. #define ASCII_DATA 0x00000200L
  134. #define RAMBO_DATA 0x00000400L
  135. #define LINEARIZED_DATA 0x00000800L
  136. #define DCP_DATA 0x00001000L
  137. #define PCL_DATA 0x00002000L
  138. #define ADDR_BOOK_DATA 0x00004000L
  139. #define OLE_BIT_DATA 0x00008000L // So we can use fmtres on OLE_DATA
  140. #define OLE_BIT_PICTURE 0x00010000L // So we can use fntres on OLE_BIT_PICTURE
  141. // Make spool data be MMR
  142. #define SPOOL_DATA MMR_DATA
  143. // Standard Non-Bit Valued MetaData values
  144. #define NULL_DATA 0x00000000L
  145. #define SIGNED_DATA 0x00000003L
  146. #define STORED_BUF_DATA 0x00000005L
  147. #define PRINTMODE_DATA 0x00000006L
  148. #define OLE_DATA 0x0000001EL // DONT CHANGE THIS VALUE - Needs to be Snowball Compatible
  149. #define OLE_PICTURE 0x0000001FL // DONT CHANGE THIS VALUE - Needs to be Snowball Compatible
  150. #define END_OF_PAGE 0x00000021L
  151. #define END_OF_JOB 0x00000022L
  152. #define PARADEV_DATA 0x00000031L // parallel device data
  153. #define PARADEV_EOF 0x00000032L // parallel device end of file
  154. #define ISVIEWATT(e) (((e) == MMR_DATA) || ((e) == RAMBO_DATA))
  155. #define ISOLEATT(e) (((e) == OLE_DATA) || ((e) == OLE_PICTURE))
  156. #define ISPAGEDATT(e) (((e)==MMR_DATA) || ((e)==MR_DATA) || \
  157. ((e)==MH_DATA)|| ((e)==LRAW_DATA)|| ((e)==HRAW_DATA))
  158. // Allow for 24 standard bit valued MetaData values
  159. #define CUSTOM_METADATA_TYPE 0x00800001L
  160. /********
  161. @doc EXTERNAL IFAXOS DATATYPES SRVRDLL OEMNSF
  162. @type DWORD | STD_RESOLUTIONS | Standard Page Resolutions
  163. @emem AWRES_UNUSED | Resolution is unused or irrelevant
  164. @emem AWRES_UNKNOWN | Resolution is unknown
  165. @emem AWRES_CUSTOM | Custom resolution
  166. @emem AWRES_mm080_038 | 8 lines/mm x 3.85 lines/mm
  167. @emem AWRES_mm080_077 | 8 lines/mm x 7.7 lines/mm
  168. @emem AWRES_mm080_154 | 8 lines/mm x 15.4 lines/mm
  169. @emem AWRES_mm160_154 | 16 lines/mm x 15.4 lines/mm
  170. @emem AWRES_200_100 | 200 dpi x 100 dpi
  171. @emem AWRES_200_200 | 200 dpi x 200 dpi
  172. @emem AWRES_200_400 | 200 dpi x 400 dpi
  173. @emem AWRES_300_300 | 300 dpi x 300 dpi
  174. @emem AWRES_400_400 | 400 dpi x 400 dpi
  175. ********/
  176. #define AWRES_UNUSED 0xFFFFFFFFL
  177. #define AWRES_UNKNOWN 0x00000000L
  178. #define AWRES_CUSTOM 0x00000001L
  179. #define AWRES_mm080_038 0x00000002L
  180. #define AWRES_mm080_077 0x00000004L
  181. #define AWRES_mm080_154 0x00000008L
  182. #define AWRES_mm160_154 0x00000010L
  183. #define AWRES_200_100 0x00000020L
  184. #define AWRES_200_200 0x00000040L
  185. #define AWRES_200_400 0x00000080L
  186. #define AWRES_300_300 0x00000100L
  187. #define AWRES_400_400 0x00000200L
  188. #define AWRES_600_600 0x00000400L
  189. #define AWRES_600_300 0x00000800L
  190. // Keep old names for a while
  191. #define AWRES_NORMAL AWRES_mm080_038
  192. #define AWRES_FINE AWRES_mm080_077
  193. #define AWRES_SUPER AWRES_mm080_154
  194. #define AWRES_SUPER_SUPER AWRES_mm160_154
  195. #define AWRES_SUPER_FINE AWRES_SUPER_SUPER
  196. /********
  197. @doc EXTERNAL IFAXOS DATATYPES SRVRDLL
  198. @type DWORD | STD_PAGE_LENLIMITS | Standard Page Length Limits
  199. @emem AWLENLIMIT_UNUSED | Page Length Limit unused
  200. @emem AWLENLIMIT_STD | Page Length Limit defined by Standard Paper Size
  201. @emem AWLENLIMIT_UNLIMITED | unlimited page length
  202. ********/
  203. #define AWLENLIMIT_UNUSED 0xFFFFFFFFL
  204. #define AWLENLIMIT_STD 0x00000001L
  205. #define AWLENLIMIT_UNLIMITED 0x00000002L
  206. /********
  207. @doc EXTERNAL IFAXOS DATATYPES SRVRDLL
  208. @typee STD_PAGE_SIZES | Standard Page Sizes
  209. @emem AWPAPER_UNUSED | Paper size is unused
  210. @emem AWPAPER_UNKNOWN | Unknown size
  211. @emem AWPAPER_CUSTOM | Custom Paper size
  212. @emem AWPAPER_A3_PORTRAIT | A3 Portrait
  213. @emem AWPAPER_A3_LANDSCAPE | A3 landscape
  214. @emem AWPAPER_B4_PORTRAIT | B4 portrait
  215. @emem AWPAPER_B4_LANDSCAPE | B4 landscape
  216. @emem AWPAPER_A4_PORTRAIT | A4 portrait
  217. @emem AWPAPER_A4_LANDSCAPE | A4 landscape
  218. @emem AWPAPER_B5_PORTRAIT | B5 portrait
  219. @emem AWPAPER_B5_LANDSCAPE | B5 landscape
  220. @emem AWPAPER_A5_PORTRAIT | A5 portrait
  221. @emem AWPAPER_A5_LANDSCAPE | A5 landscape
  222. @emem AWPAPER_A6_PORTRAIT | A6 portrait
  223. @emem AWPAPER_A6_LANDSCAPE | A6 landscape
  224. @emem AWPAPER_LETTER_PORTRAIT | Letter portrait
  225. @emem AWPAPER_LETTER_LANDSCAPE | Letter landscape
  226. @emem AWPAPER_LEGAL_PORTRAIT | Legal portrait
  227. @emem AWPAPER_LEGAL_LANDSCAPE | Legal landscape
  228. @emem AWPAPER_WIN31_DEFAULT | ????
  229. @comm Page width in pixels must be exactly correct for MH/MR/MMR
  230. decoding and to interoperate with Group-3 fax machines.
  231. The table in the example below gives the bits/bytes required at each width
  232. and resolution combination
  233. @ex Table for Page Width vs Resolution |
  234. A4 B4 A3 A5 A6
  235. 200dpi / 8li/mm 1728/216 2048/256 2432/304 1216/152 864/108
  236. 300 2592/324 3072/384 3648/456 1824/228 1296/162
  237. 400dpi / 16li/mm 3456/432 4096/512 4864/608 2432/304 1728/216
  238. ********/
  239. #define AWPAPER_UNUSED 0xFFFFFFFFL
  240. #define AWPAPER_UNKNOWN 0x00000000L
  241. #define AWPAPER_CUSTOM 0x00000001L
  242. #define AWPAPER_A3_PORTRAIT 0x00000002L
  243. #define AWPAPER_A3_LANDSCAPE 0x00000004L
  244. #define AWPAPER_B4_PORTRAIT 0x00000008L
  245. #define AWPAPER_B4_LANDSCAPE 0x00000010L
  246. #define AWPAPER_A4_PORTRAIT 0x00000020L
  247. #define AWPAPER_A4_LANDSCAPE 0x00000040L
  248. #define AWPAPER_B5_PORTRAIT 0x00000080L
  249. #define AWPAPER_B5_LANDSCAPE 0x00000100L
  250. #define AWPAPER_A5_PORTRAIT 0x00000200L
  251. #define AWPAPER_A5_LANDSCAPE 0x00000400L
  252. #define AWPAPER_A6_PORTRAIT 0x00000800L
  253. #define AWPAPER_A6_LANDSCAPE 0x00001000L
  254. #define AWPAPER_LETTER_PORTRAIT 0x00002000L
  255. #define AWPAPER_LETTER_LANDSCAPE 0x00004000L
  256. #define AWPAPER_LEGAL_PORTRAIT 0x00008000L
  257. #define AWPAPER_LEGAL_LANDSCAPE 0x00010000L
  258. #define AWPAPER_WIN31_DEFAULT 0x00020000L
  259. #endif // _INC_BUFFERS