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.

361 lines
12 KiB

  1. /* Copyright Microsoft Corp 1994 */
  2. /* awCapInf.h
  3. *
  4. * definitions for Capabilites Interface for modems
  5. *
  6. *
  7. */
  8. #ifndef awCapInf_h_include
  9. #define awCapInf_h_include
  10. #include <windows.h>
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. // The convinence of defining bit masks
  15. #define AWCAP_SETBIT(x) 1<<x
  16. // enum enumCapabilities
  17. enum enumCapabilities {
  18. // Standard Capabilities
  19. eCapStd_MessageVer,
  20. eCapStd_fBinaryData,
  21. eCapStd_fInboundRouting,
  22. eCapStd_SecurityVer,
  23. eCapStd_CompressVer,
  24. eCapStd_OperatingSysVer,
  25. eCapStd_PreambleVer,
  26. eCapStd_InteractiveVer,
  27. eCapStd_DataSpeed,
  28. eCapStd_DataLink,
  29. // Image Capabilites
  30. eCapImg_PagePixWid,
  31. eCapImg_RBAver,
  32. eCapImg_CoverAttachVer,
  33. eCapImg_AddressBookAttachVer,
  34. eCapImg_GDIMetaVer,
  35. eCapImg_HighResolutions,
  36. eCapImg_OtherEncoding,
  37. eCapImg_PageSizesSupported,
  38. eCapImg_OtherPageSizesSupported,
  39. // Polling Capability Group
  40. eCapPol_fLowSpeedPoll,
  41. eCapPol_fHighSpeedPoll,
  42. eCapPol_fPollByNameAvail,
  43. eCapPol_fPollByRecipAvail,
  44. eCapPol_fPollByFileName,
  45. eCapPol_fAppCapAvail,
  46. eCapPol_fNoShortTurn,
  47. eCapPol_MsgRelayVer,
  48. eCapPol_ExtCapsCRC,
  49. // General Information Group
  50. eCapInfo_MachineId,
  51. // FAX Capablities
  52. eCapFax_fPublicPoll,
  53. eCapFax_AwRes,
  54. eCapFax_Encoding,
  55. eCapFax_PageWidth,
  56. eCapFax_PageLength
  57. };
  58. // enum enumCapStd_eMessageVer
  59. enum enumCapStd_eMessageVer {
  60. eMessageVer_NoLinearizeMsg = 0,
  61. eMessageVer_LinearizeVer1 = 1,
  62. eMessageVer_MaxValue = 7 // Largest Value in enum
  63. };
  64. // enum enumCapStd_eSecurityVer
  65. enum enumCapStd_eSecurityVer {
  66. eSecurityVer_NoSecurity = 0,
  67. eSecurityVer_SecurityV1 = 1,
  68. eSecurityVer_MaxValue = 7 // Largest Value in enum
  69. };
  70. // enum enumCapStd_eCompressVer
  71. enum enumCapStd_eCompressVer {
  72. eCompressVer_NoCompession = 0,
  73. eCompressVer_CompressV1 = 1,
  74. eCompressVer_MaxValue = 3 // Largest Value in enum
  75. };
  76. // enum enumCapStd_eOperatingSysVer
  77. enum enumCapStd_eOperatingSysVer {
  78. eOperatingSysVer_EFAX = 0,
  79. eOperatingSysVer_IFAX = 1,
  80. eOperatingSysVer_IPRINT = 2,
  81. eOperatingSysVer_IPHONE = 3,
  82. eOperatingSysVer_MaxValue = 7 // Largest Value in enum
  83. };
  84. // enum enumCapStd_eInteractiveVer
  85. enum enumCapStd_eInteractiveVer {
  86. eInteractiveVer_NotSupported = 0,
  87. eInteractiveVer_InteractiveV1 = 1,
  88. eInteractiveVer_MaxValue = 7 // Largest Value in enum
  89. };
  90. // enum enumCapStd_eDataSpeed
  91. enum enumCapStd_eDataSpeed {
  92. eDataSpeed_NoDataModem = 0,
  93. eDataSpeed_V_22bis = 1, // 2400
  94. eDataSpeed_V_32 = 2, // 9600
  95. eDataSpeed_V_32bis = 3, // 14400
  96. eDataSpeed_V_32ter = 4, // 19200
  97. eDataSpeed_Reserved0 = 5, //
  98. eDataSpeed_V_fast = 6, //
  99. eDataSpeed_Reserved1 = 7, //
  100. eDataSpeed_MaxValue = 7 // Largest Value in enum
  101. };
  102. // enum enumCapStd_eDataLink
  103. enum enumCapStd_eDataLink {
  104. eDataLink_NoDataLink = 0,
  105. eDataLink_MNP = 1, // V.42 Annex A
  106. eDataLink_V_42 = 2, // V.42 LAPM & MNP
  107. eDataLink_V_42bis = 3, // V.42bis compression
  108. eDataLink_MaxValue = 3 // Largest Value in enum
  109. };
  110. // enum enumCapImg_eCoverAttachVer
  111. enum enumCapImg_eCoverAttachVer {
  112. eCoverAttachVer_NoSupported = 0,
  113. eCoverAttachVer_Version1 = 1,
  114. eCoverAttachVer_MaxValue = 3 // Largest Value in enum
  115. };
  116. // enum enumCapImg_eGDIMetaVer
  117. enum enumCapImg_eGDIMetaVer {
  118. eGDIMetaVer_NotSupported = 0,
  119. eGDIMetaVer_MaxValue = 3 // Largest Value in enum
  120. };
  121. // enum enumCapImg_eHighResolutions
  122. enum enumCapImg_eHighResolutions {
  123. eHighResolutions_NotSupported = 0,
  124. eHighResolutions_MaxValue = 0 // Largest Value in num
  125. };
  126. // enum enumCapImg_eOtherEncoding
  127. enum enumCapImg_eOtherEncoding {
  128. eOtherEncoding_NotSupported = 0,
  129. eOtherEncoding_MaxValue = 0 // Largest Value in enum
  130. };
  131. enum enumCapFax_eAwres {
  132. eAwres_UNKNOWN = 0,
  133. eAwres_CUSTOM = AWCAP_SETBIT(0),
  134. eAwres_mm080_038 = AWCAP_SETBIT(1),
  135. eAwres_mm080_077 = AWCAP_SETBIT(2),
  136. eAwres_mm080_154 = AWCAP_SETBIT(3),
  137. eAwres_mm160_154 = AWCAP_SETBIT(4),
  138. eAwres_200_100 = AWCAP_SETBIT(5),
  139. eAwres_200_200 = AWCAP_SETBIT(6),
  140. eAwres_200_400 = AWCAP_SETBIT(7),
  141. eAwres_300_300 = AWCAP_SETBIT(8),
  142. eAwres_400_400 = AWCAP_SETBIT(9),
  143. eAwres_600_600 = AWCAP_SETBIT(10),
  144. eAwres_MaxValue = AWCAP_SETBIT(10) // Largest Value in enum
  145. };
  146. // enum enumCapFax_eEncoding
  147. enum enumCapFax_eEncoding { // Bit Values
  148. eEncoding_NotSupported = 0,
  149. eEncoding_MH = AWCAP_SETBIT(0),
  150. eEncoding_MR = AWCAP_SETBIT(1),
  151. eEncoding_MMR = AWCAP_SETBIT(2),
  152. eEncoding_MaxValue = AWCAP_SETBIT(2) // Largest Value in enum
  153. };
  154. // enum enumCapFax_ePageWidth
  155. enum enumCapFax_ePageWidth { // Bit Values
  156. ePageWidth_A4 = 0,
  157. ePageWidth_B4 = AWCAP_SETBIT(0),
  158. ePageWidth_A3 = AWCAP_SETBIT(1),
  159. ePageWidth_A5 = AWCAP_SETBIT(2), /* 1216 pixels */
  160. ePageWidth_A6 = AWCAP_SETBIT(3), /* 864 pixels */
  161. ePageWidth_A5_1728 = AWCAP_SETBIT(4), /* 1216 pixels */
  162. ePageWidth_A6_1728 = AWCAP_SETBIT(5) /* 864 pixels */
  163. };
  164. // enum enumCapFax_ePageLength
  165. enum enumCapFax_ePageLength { // Bit Values
  166. ePageLength_A4 = 0,
  167. ePageLength_B4 = 1,
  168. ePageLength_Unlimited = 2,
  169. ePageLength_MaxValue = 2
  170. };
  171. #define CAP_DEFAULT_MESSAGE_VER eMessageVer_NoLinearizeMsg
  172. #define CAP_DEFAULT_SECURITY_VER eSecurityVer_NoSecurity
  173. #define CAP_DEFAULT_COMPRESS_VER eCompressVer_NoCompession
  174. #define CAP_DEFAULT_OS_VER eOperatingSysVer_EFAX
  175. #define CAP_DEFAULT_INTERACTIVE_VER eInteractiveVer_NotSupported
  176. #define CAP_DEFAULT_DATA_SPEED eDataSpeed_NoDataModem
  177. #define CAP_DEFAULT_DATA_LINK eDataLink_NoDataLink
  178. #define CAP_DEFAULT_COVER_ATTACH_VER eCoverAttachVer_NoSupported
  179. #define CAP_DEFAULT_GDI_META_VER eGDIMetaVer_NotSupported
  180. #define CAP_DEFAULT_HIGH_RESOLUTIONS eHighResolutions_NotSupported
  181. #define CAP_DEFAULT_OTHER_ENCODING eOtherEncoding_NotSupported
  182. #define CAP_DEFAULT_FPUBLICPOL efPublicPoll_NotSupported
  183. #define CAP_DEFAULT_RES eAwres_mm080_038
  184. #define CAP_DEFAULT_ENCODING eEncoding_MH
  185. #define CAP_DEFAULT_PAGEWIDTH ePageWidth_A4
  186. #define CAP_DEFAULT_PAGELENGTH ePageLength_A4
  187. #define CAP_DEFAULT_RAMBO_VER 0 // no enum for these yet...
  188. #define CAP_DEFAULT_MSG_RELAY_VER 0
  189. #define CAP_DEFAULT_POLL_EXT_CAPS_CRC 0
  190. #define CAP_DEFAULT_PAGE_SIZES 0
  191. /* UpdateCapabilitiesEntry()
  192. *Parameters:
  193. * lpPhoneNumber Pointer to Normalized phone number with country and
  194. * city code added to local number. For example
  195. * 1-206-936-8502.
  196. * cbRawFrames Number of bytes contained pointed to by lpRawFrames.
  197. * lpRawFrames Pointer to buffer containing raw bytes by At Work Modem
  198. * Transport for Capabilities exchange.
  199. *Returns:
  200. * 0 = Success entry previously existed
  201. * 1 = Success entry was created
  202. * 1 = Failure lpPhoneNumber contained invalid characters
  203. */
  204. extern int EXPORT_DLL WINAPI UpdateCapabilitiesEntry(
  205. PSZ lpPhoneNumber,
  206. DWORD cbRawFrames,
  207. PUCHAR lpRawFrames);
  208. /* GetCapabilitiesEntry()
  209. *Parameters:
  210. * lpPhoneNumber Pointer to Normalized phone number with country and city
  211. * code added to local number. For example 1-206-936-8502.
  212. * cbRawFrames Number of bytes contained pointed to by lpRawFrames.
  213. * cbRawFramesRtn Number of bytes returned in lpRawFrames.
  214. * lpRawFrames Pointer to buffer containing raw bytes by At Work Modem
  215. * Transport for Capabilities exchange.
  216. *Returns:
  217. * ERROR_SUCCESS Success entry found and returned.
  218. * ERROR_BAD_ARGUMENTS Failure lpPhoneNumber contained invalid characters
  219. * or lpRawFrames is NULL
  220. * ERROR_MORE_DATA Failure cbRawFrames to small, actual number of bytes
  221. * available in cbRawFramesRtn.
  222. */
  223. extern int EXPORT_DLL WINAPI GetCapabilitiesEntry(
  224. PSZ lpPhoneNumber,
  225. LPDWORD lpcbRawFrames,
  226. PUCHAR lpRawFrames,
  227. PBOOL pfRtnDefault
  228. );
  229. /* DeleteCapabilitiesEntry()
  230. *Parameters:
  231. * lpPhoneNumber Pointer to Normalized phone number with country and city
  232. * code added to local number. For example 1-206-936-8502.
  233. *Returns:
  234. * 0 = Success entry found and deleted.
  235. * 1 = Failure lpPhoneNumber contained invalid characters
  236. * 2 = Failure lpPhoneNumber was not found.
  237. */
  238. extern int EXPORT_DLL WINAPI DeleteCapabilitiesEntry(
  239. PSZ lpPhoneNumber
  240. );
  241. /* EnumCapabilitiesOpen
  242. *
  243. * Open a session for enumeration of the Capabilities database
  244. *Parameters:
  245. * lphDataBase LP to handle for subsuquenct calls to the Enum
  246. * API's
  247. *Returns:
  248. * ERROR_SUCCESS -- Call succeded otherwise an error occured
  249. * and the database handle is not valid
  250. * error otherwise
  251. */
  252. int EXPORT_DLL WINAPI EnumCapabilitiesOpen(
  253. LPDWORD lphDataBase
  254. );
  255. /* EnumCapabilitiesClose
  256. *
  257. * Close a session for enumeratin of the Capabilities database
  258. *Parameters:
  259. * hDataBase handle from call to EnumCapabilitiesOpen
  260. *Returns:
  261. * ERROR_SUCCESS -- always returns
  262. */
  263. int WINAPI EnumCapabilitiesClose(
  264. DWORD hDataBase
  265. );
  266. /* EnumCapabablitesEntry()
  267. * Used to return a list of phone numbers known by the capabilities
  268. * interface. The caller passes a buffer to store a list of zero
  269. * terminated ASCII strings. If the buffer is too small the buffer
  270. * is filled up to cbPhoneNumberList and lpcbPhoneNumberList is
  271. * returned with the number of bytes required to retrieve the compete
  272. * list. So the ideal calling sequence is to call the function twice
  273. * , once with cbPhoneNumberList with a value of zero and
  274. * lpcbPhoneNumberList is returned with the size of the correct buffer.
  275. * A second call is then made with the proper buffer sized and
  276. * cbPhoneNumberList correctly set. However, the size of the buffer
  277. * necessary may change from the first call to second because of
  278. * parallel activity, so padding the buffer after the first call as
  279. * well as a timely calling sequence will minimize the possibility of
  280. * a failure.
  281. *
  282. *Parameters:
  283. * hDataBase handle from call to EnumCapabilitiesOpen
  284. * lpPhoneNumber Pointer to buffer where list of zero terminated phone
  285. * numbers is stored.
  286. * lpcbPhoneNumber Size of the buffer that lpPhoneNumberList points to.
  287. * lpLastWrite Pointer to FILETIME structure to store last Write Time
  288. *
  289. *Returns:
  290. * ErrorSuccess
  291. * Error otherwise
  292. */
  293. extern int EXPORT_DLL WINAPI EnumCapabilitiesEntry(
  294. DWORD hDataBase,
  295. PSZ lpPhoneNumber,
  296. LPLONG lpcbPhoneNumber,
  297. PFILETIME lpLastWrite
  298. );
  299. /* GetCapabilitiesValue()
  300. * Returns the integer value of the capability extracted from the
  301. * lpRawFrames.
  302. *
  303. * Parameters:
  304. * eCapabilities Enumeration value of enumCapabilities. One capability
  305. * that caller is attempting to discover.
  306. * lpValue pointer to where parsed capabilities is returned. Only
  307. * valid if function returns success.
  308. * lpcbValue On Call size of lpValue, on return # bytes returned.
  309. * lpRawFrames Pointer to buffer containing raw bytes by At Work Modem
  310. * Transport for Capabilities exchange.
  311. * cbRawFrames Size of lpRawFrames data.
  312. *Returns:
  313. * ERROR_SUCCESS = Capability found and value returned in lpValue.
  314. * != ERROR_SUCCESS= Failure eCapabilities was not found in the raw frames.
  315. */
  316. int EXPORT_DLL WINAPI GetCapabilitiesValue(
  317. enum enumCapabilities eCapabilities,
  318. PVOID lpValue,
  319. PDWORD lpcbValue,
  320. PVOID lpRawFrames,
  321. DWORD cbRawFrames
  322. );
  323. #ifdef __cplusplus
  324. } // extern "C"
  325. #endif
  326. #endif // awCapInf_h_include