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.

4183 lines
128 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winfax.h
  5. Abstract:
  6. This module contains the WIN32 FAX APIs.
  7. --*/
  8. #ifndef _FAXAPIP_
  9. #define _FAXAPIP_
  10. #ifndef MIDL_PASS
  11. #include <tapi.h>
  12. #endif
  13. #if !defined(_WINFAX_)
  14. #define WINFAXAPI DECLSPEC_IMPORT
  15. #else
  16. #define WINFAXAPI
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. //
  22. // FAX ERROR CODES
  23. //
  24. #define FAX_ERR_START 7001L // First fax specific error code
  25. #define FAX_ERR_SRV_OUTOFMEMORY 7001L
  26. #define FAX_ERR_GROUP_NOT_FOUND 7002L
  27. #define FAX_ERR_BAD_GROUP_CONFIGURATION 7003L
  28. #define FAX_ERR_GROUP_IN_USE 7004L
  29. #define FAX_ERR_RULE_NOT_FOUND 7005L
  30. #define FAX_ERR_NOT_NTFS 7006L
  31. #define FAX_ERR_DIRECTORY_IN_USE 7007L
  32. #define FAX_ERR_FILE_ACCESS_DENIED 7008L
  33. #define FAX_ERR_MESSAGE_NOT_FOUND 7009L
  34. #define FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED 7010L
  35. #define FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU 7011L
  36. #define FAX_ERR_VERSION_MISMATCH 7012L // Fax client/server versions mismtach
  37. #define FAX_ERR_END 7012L // Last fax specific error code
  38. //
  39. // MessageId: FAX_E_SRV_OUTOFMEMORY
  40. //
  41. // MessageText:
  42. //
  43. // The fax server failed to allocate memory.
  44. //
  45. #define FAX_E_SRV_OUTOFMEMORY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_SRV_OUTOFMEMORY)
  46. //
  47. // MessageId: FAX_E_GROUP_NOT_FOUND
  48. //
  49. // MessageText:
  50. //
  51. // The fax server failed to locate an outbound routing group by name.
  52. //
  53. #define FAX_E_GROUP_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_GROUP_NOT_FOUND)
  54. //
  55. // MessageId: FAX_E_BAD_GROUP_CONFIGURATION
  56. //
  57. // MessageText:
  58. //
  59. // The fax server encountered an outbound routing group with bad configuration.
  60. //
  61. #define FAX_E_BAD_GROUP_CONFIGURATION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_BAD_GROUP_CONFIGURATION)
  62. //
  63. // MessageId: FAX_E_GROUP_IN_USE
  64. //
  65. // MessageText:
  66. //
  67. // The fax server cannot remove an outbound routing group because it is in use by one or more outbound routing rules.
  68. //
  69. #define FAX_E_GROUP_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_GROUP_IN_USE)
  70. //
  71. // MessageId: FAX_E_RULE_NOT_FOUND
  72. //
  73. // MessageText:
  74. //
  75. // The fax server failed to locate an outbound routing rule by country code and area code.
  76. //
  77. #define FAX_E_RULE_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_RULE_NOT_FOUND)
  78. //
  79. // MessageId: FAX_E_NOT_NTFS
  80. //
  81. // MessageText:
  82. //
  83. // The fax server cannot set an archive folder to a non-NTFS partition.
  84. //
  85. #define FAX_E_NOT_NTFS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_NOT_NTFS)
  86. //
  87. // MessageId: FAX_E_DIRECTORY_IN_USE
  88. //
  89. // MessageText:
  90. //
  91. // The fax server cannot use the same folder for both the inbox and the sent-items archives.
  92. //
  93. #define FAX_E_DIRECTORY_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_DIRECTORY_IN_USE)
  94. //
  95. // MessageId: FAX_E_FILE_ACCESS_DENIED
  96. //
  97. // MessageText:
  98. //
  99. // The fax server cannot access the specified file or folder.
  100. //
  101. #define FAX_E_FILE_ACCESS_DENIED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_FILE_ACCESS_DENIED)
  102. //
  103. // MessageId: FAX_E_MESSAGE_NOT_FOUND
  104. //
  105. // MessageText:
  106. //
  107. // The fax server cannot find the job or message by its ID.
  108. //
  109. #define FAX_E_MESSAGE_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_MESSAGE_NOT_FOUND)
  110. //
  111. // MessageId: FAX_E_DEVICE_NUM_LIMIT_EXCEEDED
  112. //
  113. // MessageText:
  114. //
  115. // The fax server cannot complete the operation because the number of active fax devices allowed for this version of Windows was exceeded.
  116. //
  117. #define FAX_E_DEVICE_NUM_LIMIT_EXCEEDED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED)
  118. //
  119. // MessageId: FAX_E_NOT_SUPPORTED_ON_THIS_SKU
  120. //
  121. // MessageText:
  122. //
  123. // The fax server cannot complete the operation because it is not supported for this version of Windows.
  124. //
  125. #define FAX_E_NOT_SUPPORTED_ON_THIS_SKU MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU)
  126. //
  127. // MessageId: FAX_E_VERSION_MISMATCH
  128. //
  129. // MessageText:
  130. //
  131. // The fax server API version does not support the requested operation.
  132. //
  133. #define FAX_E_VERSION_MISMATCH MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_VERSION_MISMATCH)
  134. typedef enum
  135. {
  136. FAXLOG_LEVEL_NONE = 0,
  137. FAXLOG_LEVEL_MIN,
  138. FAXLOG_LEVEL_MED,
  139. FAXLOG_LEVEL_MAX
  140. } FAX_ENUM_LOG_LEVELS;
  141. typedef enum
  142. {
  143. FAXLOG_CATEGORY_INIT = 1, // Initialization / shutdown
  144. FAXLOG_CATEGORY_OUTBOUND, // Outbound messages
  145. FAXLOG_CATEGORY_INBOUND, // Inbound messages
  146. FAXLOG_CATEGORY_UNKNOWN // Unknown category (all others)
  147. } FAX_ENUM_LOG_CATEGORIES;
  148. typedef struct _FAX_LOG_CATEGORYA
  149. {
  150. LPCSTR Name; // logging category name
  151. DWORD Category; // logging category number
  152. DWORD Level; // logging level for the category
  153. } FAX_LOG_CATEGORYA, *PFAX_LOG_CATEGORYA;
  154. typedef struct _FAX_LOG_CATEGORYW
  155. {
  156. LPCWSTR Name; // logging category name
  157. DWORD Category; // logging category number
  158. DWORD Level; // logging level for the category
  159. } FAX_LOG_CATEGORYW, *PFAX_LOG_CATEGORYW;
  160. #ifdef UNICODE
  161. typedef FAX_LOG_CATEGORYW FAX_LOG_CATEGORY;
  162. typedef PFAX_LOG_CATEGORYW PFAX_LOG_CATEGORY;
  163. #else
  164. typedef FAX_LOG_CATEGORYA FAX_LOG_CATEGORY;
  165. typedef PFAX_LOG_CATEGORYA PFAX_LOG_CATEGORY;
  166. #endif // UNICODE
  167. typedef struct _FAX_TIME
  168. {
  169. WORD Hour;
  170. WORD Minute;
  171. } FAX_TIME, *PFAX_TIME;
  172. typedef struct _FAX_CONFIGURATIONA
  173. {
  174. DWORD SizeOfStruct; // size of this structure
  175. DWORD Retries; // number of retries for fax send
  176. DWORD RetryDelay; // number of minutes between retries
  177. DWORD DirtyDays; // number of days to keep an unsent job in the queue
  178. BOOL Branding; // fsp should brand outgoing faxes
  179. BOOL UseDeviceTsid; // server uses device tsid only
  180. BOOL ServerCp; // clients must use cover pages on the server
  181. BOOL PauseServerQueue; // is the server queue paused?
  182. FAX_TIME StartCheapTime; // start of discount rate period
  183. FAX_TIME StopCheapTime; // end of discount rate period
  184. BOOL ArchiveOutgoingFaxes; // whether outgoing faxes should be archived
  185. LPCSTR ArchiveDirectory; // archive directory for outgoing faxes
  186. LPCSTR Reserved; // Reserved; must be NULL
  187. } FAX_CONFIGURATIONA, *PFAX_CONFIGURATIONA;
  188. typedef struct _FAX_CONFIGURATIONW
  189. {
  190. DWORD SizeOfStruct; // size of this structure
  191. DWORD Retries; // number of retries for fax send
  192. DWORD RetryDelay; // number of minutes between retries
  193. DWORD DirtyDays; // number of days to keep an unsent job in the queue
  194. BOOL Branding; // fsp should brand outgoing faxes
  195. BOOL UseDeviceTsid; // server uses device tsid only
  196. BOOL ServerCp; // clients must use cover pages on the server
  197. BOOL PauseServerQueue; // is the server queue paused?
  198. FAX_TIME StartCheapTime; // start of discount rate period
  199. FAX_TIME StopCheapTime; // end of discount rate period
  200. BOOL ArchiveOutgoingFaxes; // whether outgoing faxes should be archived
  201. LPCWSTR ArchiveDirectory; // archive directory for outgoing faxes
  202. LPCWSTR Reserved; // Reserved; must be NULL
  203. } FAX_CONFIGURATIONW, *PFAX_CONFIGURATIONW;
  204. #ifdef UNICODE
  205. typedef FAX_CONFIGURATIONW FAX_CONFIGURATION;
  206. typedef PFAX_CONFIGURATIONW PFAX_CONFIGURATION;
  207. #else
  208. typedef FAX_CONFIGURATIONA FAX_CONFIGURATION;
  209. typedef PFAX_CONFIGURATIONA PFAX_CONFIGURATION;
  210. #endif // UNICODE
  211. //
  212. // FaxSetJob() command codes
  213. //
  214. typedef enum
  215. {
  216. JC_UNKNOWN = 0,
  217. JC_DELETE,
  218. JC_PAUSE,
  219. JC_RESUME
  220. } FAX_ENUM_JOB_COMMANDS;
  221. #define JC_RESTART JC_RESUME
  222. //
  223. // job type defines
  224. //
  225. //
  226. // NOTICE: JT_* and JS_* are different from the Win2K public constants.
  227. // If you use WinFax.h and/or the Win2K COM interfaces, you get the Win2K constants.
  228. // If you use fxsapip.h, you get the Whistler constants.
  229. //
  230. // NEVER MIX THEM !!!
  231. //
  232. typedef enum
  233. {
  234. JT_UNKNOWN = 0x0001, // Fax type is not determined yet
  235. JT_SEND = 0x0002, // Outgoing fax message
  236. JT_RECEIVE = 0x0004, // Incoming fax message
  237. JT_ROUTING = 0x0008, // Incoming message - being routed
  238. JT_FAIL_RECEIVE = 0x0010, // Fail receive job (legacy support only)
  239. JT_BROADCAST = 0x0020 // Outgoing broadcast message
  240. } FAX_ENUM_JOB_TYPES;
  241. //
  242. // job status defines
  243. //
  244. #define JS_PENDING 0x00000001
  245. #define JS_INPROGRESS 0x00000002
  246. #define JS_DELETING 0x00000004
  247. #define JS_FAILED 0x00000008
  248. #define JS_PAUSED 0x00000010
  249. #define JS_NOLINE 0x00000020
  250. #define JS_RETRYING 0x00000040
  251. #define JS_RETRIES_EXCEEDED 0x00000080
  252. typedef struct _FAX_DEVICE_STATUSA
  253. {
  254. DWORD SizeOfStruct; // size of this structure
  255. LPCSTR CallerId; // caller id string
  256. LPCSTR Csid; // station identifier
  257. DWORD CurrentPage; // current page
  258. DWORD DeviceId; // permanent line id
  259. LPCSTR DeviceName; // device name
  260. LPCSTR DocumentName; // document name
  261. DWORD JobType; // send or receive?
  262. LPCSTR PhoneNumber; // sending phone number
  263. LPCSTR RoutingString; // routing information
  264. LPCSTR SenderName; // sender name
  265. LPCSTR RecipientName; // recipient name
  266. DWORD Size; // size in bytes of the document
  267. FILETIME StartTime; // starting time of the fax send/receive
  268. DWORD Status; // current status of the device, see FPS_??? masks
  269. LPCSTR StatusString; // status string if the Status field is zero. this may be NULL.
  270. FILETIME SubmittedTime; // time the document was submitted
  271. DWORD TotalPages; // total number of pages in this job
  272. LPCSTR Tsid; // transmitting station identifier
  273. LPCSTR UserName; // user that submitted the active job
  274. } FAX_DEVICE_STATUSA, *PFAX_DEVICE_STATUSA;
  275. typedef struct _FAX_DEVICE_STATUSW
  276. {
  277. DWORD SizeOfStruct; // size of this structure
  278. LPCWSTR CallerId; // caller id string
  279. LPCWSTR Csid; // station identifier
  280. DWORD CurrentPage; // current page
  281. DWORD DeviceId; // permanent line id
  282. LPCWSTR DeviceName; // device name
  283. LPCWSTR DocumentName; // document name
  284. DWORD JobType; // send or receive?
  285. LPCWSTR PhoneNumber; // sending phone number
  286. LPCWSTR RoutingString; // routing information
  287. LPCWSTR SenderName; // sender name
  288. LPCWSTR RecipientName; // recipient name
  289. DWORD Size; // size in bytes of the document
  290. FILETIME StartTime; // starting time of the fax send/receive
  291. DWORD Status; // current status of the device, see FPS_??? masks
  292. LPCWSTR StatusString; // status string if the Status field is zero. this may be NULL.
  293. FILETIME SubmittedTime; // time the document was submitted
  294. DWORD TotalPages; // total number of pages in this job
  295. LPCWSTR Tsid; // transmitting station identifier
  296. LPCWSTR UserName; // user that submitted the active job
  297. } FAX_DEVICE_STATUSW, *PFAX_DEVICE_STATUSW;
  298. #ifdef UNICODE
  299. typedef FAX_DEVICE_STATUSW FAX_DEVICE_STATUS;
  300. typedef PFAX_DEVICE_STATUSW PFAX_DEVICE_STATUS;
  301. #else
  302. typedef FAX_DEVICE_STATUSA FAX_DEVICE_STATUS;
  303. typedef PFAX_DEVICE_STATUSA PFAX_DEVICE_STATUS;
  304. #endif // UNICODE
  305. typedef struct _FAX_JOB_ENTRYA
  306. {
  307. DWORD SizeOfStruct; // size of this structure
  308. DWORD JobId; // fax job id
  309. LPCSTR UserName; // user who submitted the job
  310. DWORD JobType; // job type, see JT defines
  311. DWORD QueueStatus; // job queue status, see JS defines
  312. DWORD Status; // current status of the device, see FPS_??? masks
  313. DWORD Size; // size in bytes of the document
  314. DWORD PageCount; // total page count
  315. LPCSTR RecipientNumber; // recipient fax number
  316. LPCSTR RecipientName; // recipient name
  317. LPCSTR Tsid; // transmitter's id
  318. LPCSTR SenderName; // sender name
  319. LPCSTR SenderCompany; // sender company
  320. LPCSTR SenderDept; // sender department
  321. LPCSTR BillingCode; // billing code
  322. DWORD ScheduleAction; // when to schedule the fax, see JSA defines
  323. SYSTEMTIME ScheduleTime; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  324. DWORD DeliveryReportType; // delivery report type, see DRT defines
  325. LPCSTR DeliveryReportAddress; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  326. LPCSTR DocumentName; // document name
  327. } FAX_JOB_ENTRYA, *PFAX_JOB_ENTRYA;
  328. typedef struct _FAX_JOB_ENTRYW
  329. {
  330. DWORD SizeOfStruct; // size of this structure
  331. DWORD JobId; // fax job id
  332. LPCWSTR UserName; // user who submitted the job
  333. DWORD JobType; // job type, see JT defines
  334. DWORD QueueStatus; // job queue status, see JS defines
  335. DWORD Status; // current status of the device, see FPS_??? masks
  336. DWORD Size; // size in bytes of the document
  337. DWORD PageCount; // total page count
  338. LPCWSTR RecipientNumber; // recipient fax number
  339. LPCWSTR RecipientName; // recipient name
  340. LPCWSTR Tsid; // transmitter's id
  341. LPCWSTR SenderName; // sender name
  342. LPCWSTR SenderCompany; // sender company
  343. LPCWSTR SenderDept; // sender department
  344. LPCWSTR BillingCode; // billing code
  345. DWORD ScheduleAction; // when to schedule the fax, see JSA defines
  346. SYSTEMTIME ScheduleTime; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  347. DWORD DeliveryReportType; // delivery report type, see DRT defines
  348. LPCWSTR DeliveryReportAddress; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  349. LPCWSTR DocumentName; // document name
  350. } FAX_JOB_ENTRYW, *PFAX_JOB_ENTRYW;
  351. #ifdef UNICODE
  352. typedef FAX_JOB_ENTRYW FAX_JOB_ENTRY;
  353. typedef PFAX_JOB_ENTRYW PFAX_JOB_ENTRY;
  354. #else
  355. typedef FAX_JOB_ENTRYA FAX_JOB_ENTRY;
  356. typedef PFAX_JOB_ENTRYA PFAX_JOB_ENTRY;
  357. #endif // UNICODE
  358. //
  359. // fax port state masks
  360. //
  361. // if you change these defines the be sure to
  362. // change the resources in the fax service.
  363. //
  364. #define FPS_DIALING 0x20000001
  365. #define FPS_SENDING 0x20000002
  366. #define FPS_RECEIVING 0x20000004
  367. #define FPS_COMPLETED 0x20000008
  368. #define FPS_HANDLED 0x20000010
  369. #define FPS_UNAVAILABLE 0x20000020
  370. #define FPS_BUSY 0x20000040
  371. #define FPS_NO_ANSWER 0x20000080
  372. #define FPS_BAD_ADDRESS 0x20000100
  373. #define FPS_NO_DIAL_TONE 0x20000200
  374. #define FPS_DISCONNECTED 0x20000400
  375. #define FPS_FATAL_ERROR 0x20000800
  376. #define FPS_NOT_FAX_CALL 0x20001000
  377. #define FPS_CALL_DELAYED 0x20002000
  378. #define FPS_CALL_BLACKLISTED 0x20004000
  379. #define FPS_INITIALIZING 0x20008000
  380. #define FPS_OFFLINE 0x20010000
  381. #define FPS_RINGING 0x20020000
  382. #define FPS_AVAILABLE 0x20100000
  383. #define FPS_ABORTING 0x20200000
  384. #define FPS_ROUTING 0x20400000
  385. #define FPS_ANSWERED 0x20800000
  386. //
  387. // fax port capability mask
  388. //
  389. #define FPF_RECEIVE 0x00000001 // Automatically receive faxes
  390. #define FPF_SEND 0x00000002
  391. #define FPF_VIRTUAL 0x00000004
  392. typedef struct _FAX_PORT_INFOA
  393. {
  394. DWORD SizeOfStruct; // size of this structure
  395. DWORD DeviceId; // Device ID
  396. DWORD State; // State of the device
  397. DWORD Flags; // Device specific flags
  398. DWORD Rings; // Number of rings before answer
  399. DWORD Priority; // Device priority
  400. LPCSTR DeviceName; // Device name
  401. LPCSTR Tsid; // Device Tsid
  402. LPCSTR Csid; // Device Csid
  403. } FAX_PORT_INFOA, *PFAX_PORT_INFOA;
  404. typedef struct _FAX_PORT_INFOW
  405. {
  406. DWORD SizeOfStruct; // size of this structure
  407. DWORD DeviceId; // Device ID
  408. DWORD State; // State of the device
  409. DWORD Flags; // Device specific flags
  410. DWORD Rings; // Number of rings before answer
  411. DWORD Priority; // Device priority
  412. LPCWSTR DeviceName; // Device name
  413. LPCWSTR Tsid; // Device Tsid
  414. LPCWSTR Csid; // Device Csid
  415. } FAX_PORT_INFOW, *PFAX_PORT_INFOW;
  416. #ifdef UNICODE
  417. typedef FAX_PORT_INFOW FAX_PORT_INFO;
  418. typedef PFAX_PORT_INFOW PFAX_PORT_INFO;
  419. #else
  420. typedef FAX_PORT_INFOA FAX_PORT_INFO;
  421. typedef PFAX_PORT_INFOA PFAX_PORT_INFO;
  422. #endif // UNICODE
  423. typedef struct _FAX_ROUTING_METHODA
  424. {
  425. DWORD SizeOfStruct; // size of this structure
  426. DWORD DeviceId; // device identifier
  427. BOOL Enabled; // is this method enabled for this device?
  428. LPCSTR DeviceName; // device name
  429. LPCSTR Guid; // guid that identifies this routing method
  430. LPCSTR FriendlyName; // friendly name for this method
  431. LPCSTR FunctionName; // exported function name that identifies this method
  432. LPCSTR ExtensionImageName; // module (dll) name that implements this method
  433. LPCSTR ExtensionFriendlyName; // displayable string that identifies the extension
  434. } FAX_ROUTING_METHODA, *PFAX_ROUTING_METHODA;
  435. typedef struct _FAX_ROUTING_METHODW
  436. {
  437. DWORD SizeOfStruct; // size of this structure
  438. DWORD DeviceId; // device identifier
  439. BOOL Enabled; // is this method enabled for this device?
  440. LPCWSTR DeviceName; // device name
  441. LPCWSTR Guid; // guid that identifies this routing method
  442. LPCWSTR FriendlyName; // friendly name for this method
  443. LPCWSTR FunctionName; // exported function name that identifies this method
  444. LPCWSTR ExtensionImageName; // module (dll) name that implements this method
  445. LPCWSTR ExtensionFriendlyName; // displayable string that identifies the extension
  446. } FAX_ROUTING_METHODW, *PFAX_ROUTING_METHODW;
  447. #ifdef UNICODE
  448. typedef FAX_ROUTING_METHODW FAX_ROUTING_METHOD;
  449. typedef PFAX_ROUTING_METHODW PFAX_ROUTING_METHOD;
  450. #else
  451. typedef FAX_ROUTING_METHODA FAX_ROUTING_METHOD;
  452. typedef PFAX_ROUTING_METHODA PFAX_ROUTING_METHOD;
  453. #endif // UNICODE
  454. typedef struct _FAX_GLOBAL_ROUTING_INFOA
  455. {
  456. DWORD SizeOfStruct; // size of this structure
  457. DWORD Priority; // priority of this device
  458. LPCSTR Guid; // guid that identifies this routing method
  459. LPCSTR FriendlyName; // friendly name for this method
  460. LPCSTR FunctionName; // exported function name that identifies this method
  461. LPCSTR ExtensionImageName; // module (dll) name that implements this method
  462. LPCSTR ExtensionFriendlyName; // displayable string that identifies the extension
  463. } FAX_GLOBAL_ROUTING_INFOA, *PFAX_GLOBAL_ROUTING_INFOA;
  464. typedef struct _FAX_GLOBAL_ROUTING_INFOW
  465. {
  466. DWORD SizeOfStruct; // size of this structure
  467. DWORD Priority; // priority of this device
  468. LPCWSTR Guid; // guid that identifies this routing method
  469. LPCWSTR FriendlyName; // friendly name for this method
  470. LPCWSTR FunctionName; // exported function name that identifies this method
  471. LPCWSTR ExtensionImageName; // module (dll) name that implements this method
  472. LPCWSTR ExtensionFriendlyName; // displayable string that identifies the extension
  473. } FAX_GLOBAL_ROUTING_INFOW, *PFAX_GLOBAL_ROUTING_INFOW;
  474. #ifdef UNICODE
  475. typedef FAX_GLOBAL_ROUTING_INFOW FAX_GLOBAL_ROUTING_INFO;
  476. typedef PFAX_GLOBAL_ROUTING_INFOW PFAX_GLOBAL_ROUTING_INFO;
  477. #else
  478. typedef FAX_GLOBAL_ROUTING_INFOA FAX_GLOBAL_ROUTING_INFO;
  479. typedef PFAX_GLOBAL_ROUTING_INFOA PFAX_GLOBAL_ROUTING_INFO;
  480. #endif // UNICODE
  481. typedef struct _FAX_COVERPAGE_INFOA
  482. {
  483. DWORD SizeOfStruct; // Size of this structure
  484. //
  485. // general
  486. //
  487. LPCSTR CoverPageName; // coverpage document name
  488. BOOL UseServerCoverPage; // coverpage exists on the fax server
  489. //
  490. // Recipient information
  491. //
  492. LPCSTR RecName; //
  493. LPCSTR RecFaxNumber; //
  494. LPCSTR RecCompany; //
  495. LPCSTR RecStreetAddress; //
  496. LPCSTR RecCity; //
  497. LPCSTR RecState; //
  498. LPCSTR RecZip; //
  499. LPCSTR RecCountry; //
  500. LPCSTR RecTitle; //
  501. LPCSTR RecDepartment; //
  502. LPCSTR RecOfficeLocation; //
  503. LPCSTR RecHomePhone; //
  504. LPCSTR RecOfficePhone; //
  505. //
  506. // Sender information
  507. //
  508. LPCSTR SdrName; //
  509. LPCSTR SdrFaxNumber; //
  510. LPCSTR SdrCompany; //
  511. LPCSTR SdrAddress; //
  512. LPCSTR SdrTitle; //
  513. LPCSTR SdrDepartment; //
  514. LPCSTR SdrOfficeLocation; //
  515. LPCSTR SdrHomePhone; //
  516. LPCSTR SdrOfficePhone; //
  517. //
  518. // Misc information
  519. //
  520. LPCSTR Note; //
  521. LPCSTR Subject; //
  522. SYSTEMTIME TimeSent; // Time the fax was sent
  523. DWORD PageCount; // Number of pages
  524. } FAX_COVERPAGE_INFOA, *PFAX_COVERPAGE_INFOA;
  525. typedef struct _FAX_COVERPAGE_INFOW
  526. {
  527. DWORD SizeOfStruct; // Size of this structure
  528. //
  529. // general
  530. //
  531. LPCWSTR CoverPageName; // coverpage document name
  532. BOOL UseServerCoverPage; // coverpage exists on the fax server
  533. //
  534. // Recipient information
  535. //
  536. LPCWSTR RecName; //
  537. LPCWSTR RecFaxNumber; //
  538. LPCWSTR RecCompany; //
  539. LPCWSTR RecStreetAddress; //
  540. LPCWSTR RecCity; //
  541. LPCWSTR RecState; //
  542. LPCWSTR RecZip; //
  543. LPCWSTR RecCountry; //
  544. LPCWSTR RecTitle; //
  545. LPCWSTR RecDepartment; //
  546. LPCWSTR RecOfficeLocation; //
  547. LPCWSTR RecHomePhone; //
  548. LPCWSTR RecOfficePhone; //
  549. //
  550. // Sender information
  551. //
  552. LPCWSTR SdrName; //
  553. LPCWSTR SdrFaxNumber; //
  554. LPCWSTR SdrCompany; //
  555. LPCWSTR SdrAddress; //
  556. LPCWSTR SdrTitle; //
  557. LPCWSTR SdrDepartment; //
  558. LPCWSTR SdrOfficeLocation; //
  559. LPCWSTR SdrHomePhone; //
  560. LPCWSTR SdrOfficePhone; //
  561. //
  562. // Misc information
  563. //
  564. LPCWSTR Note; //
  565. LPCWSTR Subject; //
  566. SYSTEMTIME TimeSent; // Time the fax was sent
  567. DWORD PageCount; // Number of pages
  568. } FAX_COVERPAGE_INFOW, *PFAX_COVERPAGE_INFOW;
  569. #ifdef UNICODE
  570. typedef FAX_COVERPAGE_INFOW FAX_COVERPAGE_INFO;
  571. typedef PFAX_COVERPAGE_INFOW PFAX_COVERPAGE_INFO;
  572. #else
  573. typedef FAX_COVERPAGE_INFOA FAX_COVERPAGE_INFO;
  574. typedef PFAX_COVERPAGE_INFOA PFAX_COVERPAGE_INFO;
  575. #endif // UNICODE
  576. typedef enum
  577. {
  578. JSA_NOW = 0, // Send now
  579. JSA_SPECIFIC_TIME, // Send at specific time
  580. JSA_DISCOUNT_PERIOD // Send at server configured discount period
  581. } FAX_ENUM_JOB_SEND_ATTRIBUTES;
  582. typedef enum
  583. {
  584. DRT_NONE = 0x0000, // Do not send receipt
  585. DRT_EMAIL = 0x0001, // Send receipt by email (SMTP)
  586. DRT_UNUSED = 0x0002, // Reserved
  587. DRT_MSGBOX = 0x0004, // Send receipt by a message box
  588. DRT_GRP_PARENT = 0x0008, // Send a single receipt for a broadcast job
  589. DRT_ATTACH_FAX = 0x0010 // Attach the fax tiff file to the receipt
  590. } FAX_ENUM_DELIVERY_REPORT_TYPES;
  591. #define DRT_ALL (DRT_EMAIL | DRT_MSGBOX) // All possible delivery report types
  592. #define DRT_MODIFIERS (DRT_GRP_PARENT | DRT_ATTACH_FAX) // All state modifiers
  593. //
  594. // the reserved fields are private data used
  595. // by the fax monitor and winfax.
  596. //
  597. //
  598. // Reserved[0] == 0xffffffff
  599. // Reserved[1] == Print job id
  600. //
  601. // Reserved[0] == 0xfffffffe start of a broadcast job
  602. //
  603. typedef struct _FAX_JOB_PARAMA
  604. {
  605. DWORD SizeOfStruct; // size of this structure
  606. LPCSTR RecipientNumber; // recipient fax number
  607. LPCSTR RecipientName; // recipient name
  608. LPCSTR Tsid; // transmitter's id
  609. LPCSTR SenderName; // sender name
  610. LPCSTR SenderCompany; // sender company
  611. LPCSTR SenderDept; // sender department
  612. LPCSTR BillingCode; // billing code
  613. DWORD ScheduleAction; // when to schedule the fax, see JSA defines
  614. SYSTEMTIME ScheduleTime; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  615. DWORD DeliveryReportType; // delivery report type, see DRT defines
  616. LPCSTR DeliveryReportAddress; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  617. LPCSTR DocumentName; // document name (optional)
  618. HCALL CallHandle; // optional call handle
  619. DWORD_PTR Reserved[3]; // reserved for ms use only
  620. } FAX_JOB_PARAMA, *PFAX_JOB_PARAMA;
  621. typedef struct _FAX_JOB_PARAMW
  622. {
  623. DWORD SizeOfStruct; // size of this structure
  624. LPCWSTR RecipientNumber; // recipient fax number
  625. LPCWSTR RecipientName; // recipient name
  626. LPCWSTR Tsid; // transmitter's id
  627. LPCWSTR SenderName; // sender name
  628. LPCWSTR SenderCompany; // sender company
  629. LPCWSTR SenderDept; // sender department
  630. LPCWSTR BillingCode; // billing code
  631. DWORD ScheduleAction; // when to schedule the fax, see JSA defines
  632. SYSTEMTIME ScheduleTime; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  633. DWORD DeliveryReportType; // delivery report type, see DRT defines
  634. LPCWSTR DeliveryReportAddress; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  635. LPCWSTR DocumentName; // document name (optional)
  636. HCALL CallHandle; // optional call handle
  637. DWORD_PTR Reserved[3]; // reserved for ms use only
  638. } FAX_JOB_PARAMW, *PFAX_JOB_PARAMW;
  639. #ifdef UNICODE
  640. typedef FAX_JOB_PARAMW FAX_JOB_PARAM;
  641. typedef PFAX_JOB_PARAMW PFAX_JOB_PARAM;
  642. #else
  643. typedef FAX_JOB_PARAMA FAX_JOB_PARAM;
  644. typedef PFAX_JOB_PARAMA PFAX_JOB_PARAM;
  645. #endif // UNICODE
  646. //
  647. // Event Ids
  648. //
  649. // FEI_NEVENTS is the number of events
  650. //
  651. #define FEI_DIALING 0x00000001
  652. #define FEI_SENDING 0x00000002
  653. #define FEI_RECEIVING 0x00000003
  654. #define FEI_COMPLETED 0x00000004
  655. #define FEI_BUSY 0x00000005
  656. #define FEI_NO_ANSWER 0x00000006
  657. #define FEI_BAD_ADDRESS 0x00000007
  658. #define FEI_NO_DIAL_TONE 0x00000008
  659. #define FEI_DISCONNECTED 0x00000009
  660. #define FEI_FATAL_ERROR 0x0000000a
  661. #define FEI_NOT_FAX_CALL 0x0000000b
  662. #define FEI_CALL_DELAYED 0x0000000c
  663. #define FEI_CALL_BLACKLISTED 0x0000000d
  664. #define FEI_RINGING 0x0000000e
  665. #define FEI_ABORTING 0x0000000f
  666. #define FEI_ROUTING 0x00000010
  667. #define FEI_MODEM_POWERED_ON 0x00000011
  668. #define FEI_MODEM_POWERED_OFF 0x00000012
  669. #define FEI_IDLE 0x00000013
  670. #define FEI_FAXSVC_ENDED 0x00000014
  671. #define FEI_ANSWERED 0x00000015
  672. #define FEI_JOB_QUEUED 0x00000016
  673. #define FEI_DELETED 0x00000017
  674. #define FEI_INITIALIZING 0x00000018
  675. #define FEI_LINE_UNAVAILABLE 0x00000019
  676. #define FEI_HANDLED 0x0000001a
  677. #define FEI_FAXSVC_STARTED 0x0000001b
  678. #define FEI_NEVENTS FEI_FAXSVC_STARTED
  679. typedef struct _FAX_EVENTA
  680. {
  681. DWORD SizeOfStruct; // Size of this structure
  682. FILETIME TimeStamp; // Timestamp for when the event was generated
  683. DWORD DeviceId; // Permanent line id
  684. DWORD EventId; // Current event id
  685. DWORD JobId; // Fax Job Id, 0xffffffff indicates inactive job
  686. } FAX_EVENTA, *PFAX_EVENTA;
  687. typedef struct _FAX_EVENTW
  688. {
  689. DWORD SizeOfStruct; // Size of this structure
  690. FILETIME TimeStamp; // Timestamp for when the event was generated
  691. DWORD DeviceId; // Permanent line id
  692. DWORD EventId; // Current event id
  693. DWORD JobId; // Fax Job Id, 0xffffffff indicates inactive job
  694. } FAX_EVENTW, *PFAX_EVENTW;
  695. #ifdef UNICODE
  696. typedef FAX_EVENTW FAX_EVENT;
  697. typedef PFAX_EVENTW PFAX_EVENT;
  698. #else
  699. typedef FAX_EVENTA FAX_EVENT;
  700. typedef PFAX_EVENTA PFAX_EVENT;
  701. #endif // UNICODE
  702. typedef struct _FAX_PRINT_INFOA
  703. {
  704. DWORD SizeOfStruct; // Size of this structure
  705. LPCSTR DocName; // Document name that appears in the spooler
  706. LPCSTR RecipientName; // Recipient name
  707. LPCSTR RecipientNumber; // Recipient fax number (non-canonical number)
  708. LPCSTR SenderName; // Sender name
  709. LPCSTR SenderCompany; // Sender company (optional)
  710. LPCSTR SenderDept; // Sender department
  711. LPCSTR SenderBillingCode; // Billing code
  712. LPCSTR Reserved; // Reserved; must be NULL
  713. LPCSTR DrEmailAddress; // E.Mail address for delivery report
  714. LPCSTR OutputFileName; // for print to file, resulting file name
  715. } FAX_PRINT_INFOA, *PFAX_PRINT_INFOA;
  716. typedef struct _FAX_PRINT_INFOW
  717. {
  718. DWORD SizeOfStruct; // Size of this structure
  719. LPCWSTR DocName; // Document name that appears in the spooler
  720. LPCWSTR RecipientName; // Recipient name
  721. LPCWSTR RecipientNumber; // Recipient fax number (non-canonical number)
  722. LPCWSTR SenderName; // Sender name
  723. LPCWSTR SenderCompany; // Sender company (optional)
  724. LPCWSTR SenderDept; // Sender department
  725. LPCWSTR SenderBillingCode; // Billing code
  726. LPCWSTR Reserved; // Reserved; must be NULL
  727. LPCWSTR DrEmailAddress; // E.Mail address for delivery report
  728. LPCWSTR OutputFileName; // for print to file, resulting file name
  729. } FAX_PRINT_INFOW, *PFAX_PRINT_INFOW;
  730. #ifdef UNICODE
  731. typedef FAX_PRINT_INFOW FAX_PRINT_INFO;
  732. typedef PFAX_PRINT_INFOW PFAX_PRINT_INFO;
  733. #else
  734. typedef FAX_PRINT_INFOA FAX_PRINT_INFO;
  735. typedef PFAX_PRINT_INFOA PFAX_PRINT_INFO;
  736. #endif // UNICODE
  737. typedef struct _FAX_CONTEXT_INFOA
  738. {
  739. DWORD SizeOfStruct; // Size of this structure
  740. HDC hDC; // Device Context
  741. CHAR ServerName[MAX_COMPUTERNAME_LENGTH+1]; // Server name
  742. } FAX_CONTEXT_INFOA, *PFAX_CONTEXT_INFOA;
  743. typedef struct _FAX_CONTEXT_INFOW
  744. {
  745. DWORD SizeOfStruct; // Size of this structure
  746. HDC hDC; // Device Context
  747. WCHAR ServerName[MAX_COMPUTERNAME_LENGTH+1]; // Server name
  748. } FAX_CONTEXT_INFOW, *PFAX_CONTEXT_INFOW;
  749. #ifdef UNICODE
  750. typedef FAX_CONTEXT_INFOW FAX_CONTEXT_INFO;
  751. typedef PFAX_CONTEXT_INFOW PFAX_CONTEXT_INFO;
  752. #else
  753. typedef FAX_CONTEXT_INFOA FAX_CONTEXT_INFO;
  754. typedef PFAX_CONTEXT_INFOA PFAX_CONTEXT_INFO;
  755. #endif // UNICODE
  756. //
  757. // prototypes
  758. //
  759. WINFAXAPI
  760. BOOL
  761. WINAPI
  762. FaxConnectFaxServerA(
  763. IN LPCSTR MachineName OPTIONAL,
  764. OUT LPHANDLE FaxHandle
  765. );
  766. WINFAXAPI
  767. BOOL
  768. WINAPI
  769. FaxConnectFaxServerW(
  770. IN LPCWSTR MachineName OPTIONAL,
  771. OUT LPHANDLE FaxHandle
  772. );
  773. #ifdef UNICODE
  774. #define FaxConnectFaxServer FaxConnectFaxServerW
  775. #else
  776. #define FaxConnectFaxServer FaxConnectFaxServerA
  777. #endif // !UNICODE
  778. typedef BOOL
  779. (WINAPI *PFAXCONNECTFAXSERVERA)(
  780. IN LPCSTR MachineName OPTIONAL,
  781. OUT LPHANDLE FaxHandle
  782. );
  783. typedef BOOL
  784. (WINAPI *PFAXCONNECTFAXSERVERW)(
  785. IN LPCWSTR MachineName OPTIONAL,
  786. OUT LPHANDLE FaxHandle
  787. );
  788. #ifdef UNICODE
  789. #define PFAXCONNECTFAXSERVER PFAXCONNECTFAXSERVERW
  790. #else
  791. #define PFAXCONNECTFAXSERVER PFAXCONNECTFAXSERVERA
  792. #endif // !UNICODE
  793. WINFAXAPI
  794. BOOL
  795. WINAPI
  796. FaxClose(
  797. IN HANDLE FaxHandle
  798. );
  799. typedef BOOL
  800. (WINAPI *PFAXCLOSE)(
  801. IN HANDLE FaxHandle
  802. );
  803. typedef enum
  804. {
  805. PORT_OPEN_QUERY = 1,
  806. PORT_OPEN_MODIFY
  807. } FAX_ENUM_PORT_OPEN_TYPE;
  808. WINFAXAPI
  809. BOOL
  810. WINAPI
  811. FaxOpenPort(
  812. IN HANDLE FaxHandle,
  813. IN DWORD DeviceId,
  814. IN DWORD Flags,
  815. OUT LPHANDLE FaxPortHandle
  816. );
  817. typedef BOOL
  818. (WINAPI *PFAXOPENPORT)(
  819. IN HANDLE FaxHandle,
  820. IN DWORD DeviceId,
  821. IN DWORD Flags,
  822. OUT LPHANDLE FaxPortHandle
  823. );
  824. WINFAXAPI
  825. BOOL
  826. WINAPI
  827. FaxCompleteJobParamsA(
  828. IN OUT PFAX_JOB_PARAMA *JobParams,
  829. IN OUT PFAX_COVERPAGE_INFOA *CoverpageInfo
  830. );
  831. WINFAXAPI
  832. BOOL
  833. WINAPI
  834. FaxCompleteJobParamsW(
  835. IN OUT PFAX_JOB_PARAMW *JobParams,
  836. IN OUT PFAX_COVERPAGE_INFOW *CoverpageInfo
  837. );
  838. #ifdef UNICODE
  839. #define FaxCompleteJobParams FaxCompleteJobParamsW
  840. #else
  841. #define FaxCompleteJobParams FaxCompleteJobParamsA
  842. #endif // !UNICODE
  843. typedef BOOL
  844. (WINAPI *PFAXCOMPLETEJOBPARAMSA)(
  845. IN OUT PFAX_JOB_PARAMA *JobParams,
  846. IN OUT PFAX_COVERPAGE_INFOA *CoverpageInfo
  847. );
  848. typedef BOOL
  849. (WINAPI *PFAXCOMPLETEJOBPARAMSW)(
  850. IN OUT PFAX_JOB_PARAMW *JobParams,
  851. IN OUT PFAX_COVERPAGE_INFOW *CoverpageInfo
  852. );
  853. #ifdef UNICODE
  854. #define PFAXCOMPLETEJOBPARAMS PFAXCOMPLETEJOBPARAMSW
  855. #else
  856. #define PFAXCOMPLETEJOBPARAMS PFAXCOMPLETEJOBPARAMSA
  857. #endif // !UNICODE
  858. WINFAXAPI
  859. BOOL
  860. WINAPI
  861. FaxSendDocumentA(
  862. IN HANDLE FaxHandle,
  863. IN LPCSTR FileName,
  864. IN PFAX_JOB_PARAMA JobParams,
  865. IN const FAX_COVERPAGE_INFOA *CoverpageInfo, OPTIONAL
  866. OUT LPDWORD FaxJobId OPTIONAL
  867. );
  868. WINFAXAPI
  869. BOOL
  870. WINAPI
  871. FaxSendDocumentW(
  872. IN HANDLE FaxHandle,
  873. IN LPCWSTR FileName,
  874. IN PFAX_JOB_PARAMW JobParams,
  875. IN const FAX_COVERPAGE_INFOW *CoverpageInfo, OPTIONAL
  876. OUT LPDWORD FaxJobId OPTIONAL
  877. );
  878. #ifdef UNICODE
  879. #define FaxSendDocument FaxSendDocumentW
  880. #else
  881. #define FaxSendDocument FaxSendDocumentA
  882. #endif // !UNICODE
  883. typedef BOOL
  884. (WINAPI *PFAXSENDDOCUMENTA)(
  885. IN HANDLE FaxHandle,
  886. IN LPCSTR FileName,
  887. IN PFAX_JOB_PARAMA JobParams,
  888. IN const FAX_COVERPAGE_INFOA *CoverpageInfo, OPTIONAL
  889. OUT LPDWORD FaxJobId OPTIONAL
  890. );
  891. typedef BOOL
  892. (WINAPI *PFAXSENDDOCUMENTW)(
  893. IN HANDLE FaxHandle,
  894. IN LPCWSTR FileName,
  895. IN PFAX_JOB_PARAMW JobParams,
  896. IN const FAX_COVERPAGE_INFOW *CoverpageInfo, OPTIONAL
  897. OUT LPDWORD FaxJobId OPTIONAL
  898. );
  899. #ifdef UNICODE
  900. #define PFAXSENDDOCUMENT PFAXSENDDOCUMENTW
  901. #else
  902. #define PFAXSENDDOCUMENT PFAXSENDDOCUMENTA
  903. #endif // !UNICODE
  904. typedef BOOL
  905. (CALLBACK *PFAX_RECIPIENT_CALLBACKA)(
  906. IN HANDLE FaxHandle,
  907. IN DWORD RecipientNumber,
  908. IN LPVOID Context,
  909. IN OUT PFAX_JOB_PARAMA JobParams,
  910. IN OUT PFAX_COVERPAGE_INFOA CoverpageInfo OPTIONAL
  911. );
  912. typedef BOOL
  913. (CALLBACK *PFAX_RECIPIENT_CALLBACKW)(
  914. IN HANDLE FaxHandle,
  915. IN DWORD RecipientNumber,
  916. IN LPVOID Context,
  917. IN OUT PFAX_JOB_PARAMW JobParams,
  918. IN OUT PFAX_COVERPAGE_INFOW CoverpageInfo OPTIONAL
  919. );
  920. #ifdef UNICODE
  921. #define PFAX_RECIPIENT_CALLBACK PFAX_RECIPIENT_CALLBACKW
  922. #else
  923. #define PFAX_RECIPIENT_CALLBACK PFAX_RECIPIENT_CALLBACKA
  924. #endif // !UNICODE
  925. WINFAXAPI
  926. BOOL
  927. WINAPI
  928. FaxSendDocumentForBroadcastA(
  929. IN HANDLE FaxHandle,
  930. IN LPCSTR FileName,
  931. OUT LPDWORD FaxJobId,
  932. IN PFAX_RECIPIENT_CALLBACKA FaxRecipientCallback,
  933. IN LPVOID Context
  934. );
  935. WINFAXAPI
  936. BOOL
  937. WINAPI
  938. FaxSendDocumentForBroadcastW(
  939. IN HANDLE FaxHandle,
  940. IN LPCWSTR FileName,
  941. OUT LPDWORD FaxJobId,
  942. IN PFAX_RECIPIENT_CALLBACKW FaxRecipientCallback,
  943. IN LPVOID Context
  944. );
  945. #ifdef UNICODE
  946. #define FaxSendDocumentForBroadcast FaxSendDocumentForBroadcastW
  947. #else
  948. #define FaxSendDocumentForBroadcast FaxSendDocumentForBroadcastA
  949. #endif // !UNICODE
  950. typedef BOOL
  951. (WINAPI *PFAXSENDDOCUMENTFORBROADCASTA)(
  952. IN HANDLE FaxHandle,
  953. IN LPCSTR FileName,
  954. OUT LPDWORD FaxJobId,
  955. IN PFAX_RECIPIENT_CALLBACKA FaxRecipientCallback,
  956. IN LPVOID Context
  957. );
  958. typedef BOOL
  959. (WINAPI *PFAXSENDDOCUMENTFORBROADCASTW)(
  960. IN HANDLE FaxHandle,
  961. IN LPCWSTR FileName,
  962. OUT LPDWORD FaxJobId,
  963. IN PFAX_RECIPIENT_CALLBACKW FaxRecipientCallback,
  964. IN LPVOID Context
  965. );
  966. #ifdef UNICODE
  967. #define PFAXSENDDOCUMENTFORBROADCAST PFAXSENDDOCUMENTFORBROADCASTW
  968. #else
  969. #define PFAXSENDDOCUMENTFORBROADCAST PFAXSENDDOCUMENTFORBROADCASTA
  970. #endif // !UNICODE
  971. WINFAXAPI
  972. BOOL
  973. WINAPI
  974. FaxSetJobA(
  975. IN HANDLE FaxHandle,
  976. IN DWORD JobId,
  977. IN DWORD Command,
  978. IN const FAX_JOB_ENTRYA *JobEntry
  979. );
  980. WINFAXAPI
  981. BOOL
  982. WINAPI
  983. FaxSetJobW(
  984. IN HANDLE FaxHandle,
  985. IN DWORD JobId,
  986. IN DWORD Command,
  987. IN const FAX_JOB_ENTRYW *JobEntry
  988. );
  989. #ifdef UNICODE
  990. #define FaxSetJob FaxSetJobW
  991. #else
  992. #define FaxSetJob FaxSetJobA
  993. #endif // !UNICODE
  994. typedef BOOL
  995. (WINAPI *PFAXSETJOBA)(
  996. IN HANDLE FaxHandle,
  997. IN DWORD JobId,
  998. IN DWORD Command,
  999. IN const FAX_JOB_ENTRYA *JobEntry
  1000. );
  1001. typedef BOOL
  1002. (WINAPI *PFAXSETJOBW)(
  1003. IN HANDLE FaxHandle,
  1004. IN DWORD JobId,
  1005. IN DWORD Command,
  1006. IN const FAX_JOB_ENTRYW *JobEntry
  1007. );
  1008. #ifdef UNICODE
  1009. #define PFAXSETJOB PFAXSETJOBW
  1010. #else
  1011. #define PFAXSETJOB PFAXSETJOBA
  1012. #endif // !UNICODE
  1013. WINFAXAPI
  1014. BOOL
  1015. WINAPI
  1016. FaxGetPageData(
  1017. IN HANDLE FaxHandle,
  1018. IN DWORD JobId,
  1019. OUT LPBYTE *Buffer,
  1020. OUT LPDWORD BufferSize,
  1021. OUT LPDWORD ImageWidth,
  1022. OUT LPDWORD ImageHeight
  1023. );
  1024. typedef BOOL
  1025. (WINAPI *PFAXGETPAGEDATA)(
  1026. IN HANDLE FaxHandle,
  1027. IN DWORD JobId,
  1028. OUT LPBYTE *Buffer,
  1029. OUT LPDWORD BufferSize,
  1030. OUT LPDWORD ImageWidth,
  1031. OUT LPDWORD ImageHeight
  1032. );
  1033. WINFAXAPI
  1034. BOOL
  1035. WINAPI
  1036. FaxGetDeviceStatusA(
  1037. IN HANDLE FaxPortHandle,
  1038. OUT PFAX_DEVICE_STATUSA *DeviceStatus
  1039. );
  1040. WINFAXAPI
  1041. BOOL
  1042. WINAPI
  1043. FaxGetDeviceStatusW(
  1044. IN HANDLE FaxPortHandle,
  1045. OUT PFAX_DEVICE_STATUSW *DeviceStatus
  1046. );
  1047. #ifdef UNICODE
  1048. #define FaxGetDeviceStatus FaxGetDeviceStatusW
  1049. #else
  1050. #define FaxGetDeviceStatus FaxGetDeviceStatusA
  1051. #endif // !UNICODE
  1052. typedef BOOL
  1053. (WINAPI *PFAXGETDEVICESTATUSA)(
  1054. IN HANDLE FaxPortHandle,
  1055. OUT PFAX_DEVICE_STATUSA *DeviceStatus
  1056. );
  1057. typedef BOOL
  1058. (WINAPI *PFAXGETDEVICESTATUSW)(
  1059. IN HANDLE FaxPortHandle,
  1060. OUT PFAX_DEVICE_STATUSW *DeviceStatus
  1061. );
  1062. #ifdef UNICODE
  1063. #define PFAXGETDEVICESTATUS PFAXGETDEVICESTATUSW
  1064. #else
  1065. #define PFAXGETDEVICESTATUS PFAXGETDEVICESTATUSA
  1066. #endif // !UNICODE
  1067. WINFAXAPI
  1068. BOOL
  1069. WINAPI
  1070. FaxAbort(
  1071. IN HANDLE FaxHandle,
  1072. IN DWORD JobId
  1073. );
  1074. typedef BOOL
  1075. (WINAPI *PFAXABORT)(
  1076. IN HANDLE FaxHandle,
  1077. IN DWORD JobId
  1078. );
  1079. WINFAXAPI
  1080. BOOL
  1081. WINAPI
  1082. FaxGetConfigurationA(
  1083. IN HANDLE FaxHandle,
  1084. OUT PFAX_CONFIGURATIONA *FaxConfig
  1085. );
  1086. WINFAXAPI
  1087. BOOL
  1088. WINAPI
  1089. FaxGetConfigurationW(
  1090. IN HANDLE FaxHandle,
  1091. OUT PFAX_CONFIGURATIONW *FaxConfig
  1092. );
  1093. #ifdef UNICODE
  1094. #define FaxGetConfiguration FaxGetConfigurationW
  1095. #else
  1096. #define FaxGetConfiguration FaxGetConfigurationA
  1097. #endif // !UNICODE
  1098. typedef BOOL
  1099. (WINAPI *PFAXGETCONFIGURATIONA)(
  1100. IN HANDLE FaxHandle,
  1101. OUT PFAX_CONFIGURATIONA *FaxConfig
  1102. );
  1103. typedef BOOL
  1104. (WINAPI *PFAXGETCONFIGURATIONW)(
  1105. IN HANDLE FaxHandle,
  1106. OUT PFAX_CONFIGURATIONW *FaxConfig
  1107. );
  1108. #ifdef UNICODE
  1109. #define PFAXGETCONFIGURATION PFAXGETCONFIGURATIONW
  1110. #else
  1111. #define PFAXGETCONFIGURATION PFAXGETCONFIGURATIONA
  1112. #endif // !UNICODE
  1113. WINFAXAPI
  1114. BOOL
  1115. WINAPI
  1116. FaxSetConfigurationA(
  1117. IN HANDLE FaxHandle,
  1118. IN const FAX_CONFIGURATIONA *FaxConfig
  1119. );
  1120. WINFAXAPI
  1121. BOOL
  1122. WINAPI
  1123. FaxSetConfigurationW(
  1124. IN HANDLE FaxHandle,
  1125. IN const FAX_CONFIGURATIONW *FaxConfig
  1126. );
  1127. #ifdef UNICODE
  1128. #define FaxSetConfiguration FaxSetConfigurationW
  1129. #else
  1130. #define FaxSetConfiguration FaxSetConfigurationA
  1131. #endif // !UNICODE
  1132. typedef BOOL
  1133. (WINAPI *PFAXSETCONFIGURATIONA)(
  1134. IN HANDLE FaxHandle,
  1135. IN const FAX_CONFIGURATIONA *FaxConfig
  1136. );
  1137. typedef BOOL
  1138. (WINAPI *PFAXSETCONFIGURATIONW)(
  1139. IN HANDLE FaxHandle,
  1140. IN const FAX_CONFIGURATIONW *FaxConfig
  1141. );
  1142. #ifdef UNICODE
  1143. #define PFAXSETCONFIGURATION PFAXSETCONFIGURATIONW
  1144. #else
  1145. #define PFAXSETCONFIGURATION PFAXSETCONFIGURATIONA
  1146. #endif // !UNICODE
  1147. WINFAXAPI
  1148. BOOL
  1149. WINAPI
  1150. FaxGetLoggingCategoriesA(
  1151. IN HANDLE FaxHandle,
  1152. OUT PFAX_LOG_CATEGORYA *Categories,
  1153. OUT LPDWORD NumberCategories
  1154. );
  1155. WINFAXAPI
  1156. BOOL
  1157. WINAPI
  1158. FaxGetLoggingCategoriesW(
  1159. IN HANDLE FaxHandle,
  1160. OUT PFAX_LOG_CATEGORYW *Categories,
  1161. OUT LPDWORD NumberCategories
  1162. );
  1163. #ifdef UNICODE
  1164. #define FaxGetLoggingCategories FaxGetLoggingCategoriesW
  1165. #else
  1166. #define FaxGetLoggingCategories FaxGetLoggingCategoriesA
  1167. #endif // !UNICODE
  1168. typedef BOOL
  1169. (WINAPI *PFAXGETLOGGINGCATEGORIESA)(
  1170. IN HANDLE FaxHandle,
  1171. OUT PFAX_LOG_CATEGORYA *Categories,
  1172. OUT LPDWORD NumberCategories
  1173. );
  1174. typedef BOOL
  1175. (WINAPI *PFAXGETLOGGINGCATEGORIESW)(
  1176. IN HANDLE FaxHandle,
  1177. OUT PFAX_LOG_CATEGORYW *Categories,
  1178. OUT LPDWORD NumberCategories
  1179. );
  1180. #ifdef UNICODE
  1181. #define PFAXGETLOGGINGCATEGORIES PFAXGETLOGGINGCATEGORIESW
  1182. #else
  1183. #define PFAXGETLOGGINGCATEGORIES PFAXGETLOGGINGCATEGORIESA
  1184. #endif // !UNICODE
  1185. WINFAXAPI
  1186. BOOL
  1187. WINAPI
  1188. FaxSetLoggingCategoriesA(
  1189. IN HANDLE FaxHandle,
  1190. IN const FAX_LOG_CATEGORYA *Categories,
  1191. IN DWORD NumberCategories
  1192. );
  1193. WINFAXAPI
  1194. BOOL
  1195. WINAPI
  1196. FaxSetLoggingCategoriesW(
  1197. IN HANDLE FaxHandle,
  1198. IN const FAX_LOG_CATEGORYW *Categories,
  1199. IN DWORD NumberCategories
  1200. );
  1201. #ifdef UNICODE
  1202. #define FaxSetLoggingCategories FaxSetLoggingCategoriesW
  1203. #else
  1204. #define FaxSetLoggingCategories FaxSetLoggingCategoriesA
  1205. #endif // !UNICODE
  1206. typedef BOOL
  1207. (WINAPI *PFAXSETLOGGINGCATEGORIESA)(
  1208. IN HANDLE FaxHandle,
  1209. IN const FAX_LOG_CATEGORYA *Categories,
  1210. IN DWORD NumberCategories
  1211. );
  1212. typedef BOOL
  1213. (WINAPI *PFAXSETLOGGINGCATEGORIESW)(
  1214. IN HANDLE FaxHandle,
  1215. IN const FAX_LOG_CATEGORYW *Categories,
  1216. IN DWORD NumberCategories
  1217. );
  1218. #ifdef UNICODE
  1219. #define PFAXSETLOGGINGCATEGORIES PFAXSETLOGGINGCATEGORIESW
  1220. #else
  1221. #define PFAXSETLOGGINGCATEGORIES PFAXSETLOGGINGCATEGORIESA
  1222. #endif // !UNICODE
  1223. WINFAXAPI
  1224. BOOL
  1225. WINAPI
  1226. FaxEnumPortsA(
  1227. IN HANDLE FaxHandle,
  1228. OUT PFAX_PORT_INFOA *PortInfo,
  1229. OUT LPDWORD PortsReturned
  1230. );
  1231. WINFAXAPI
  1232. BOOL
  1233. WINAPI
  1234. FaxEnumPortsW(
  1235. IN HANDLE FaxHandle,
  1236. OUT PFAX_PORT_INFOW *PortInfo,
  1237. OUT LPDWORD PortsReturned
  1238. );
  1239. #ifdef UNICODE
  1240. #define FaxEnumPorts FaxEnumPortsW
  1241. #else
  1242. #define FaxEnumPorts FaxEnumPortsA
  1243. #endif // !UNICODE
  1244. typedef BOOL
  1245. (WINAPI *PFAXENUMPORTSA)(
  1246. IN HANDLE FaxHandle,
  1247. OUT PFAX_PORT_INFOA *PortInfo,
  1248. OUT LPDWORD PortsReturned
  1249. );
  1250. typedef BOOL
  1251. (WINAPI *PFAXENUMPORTSW)(
  1252. IN HANDLE FaxHandle,
  1253. OUT PFAX_PORT_INFOW *PortInfo,
  1254. OUT LPDWORD PortsReturned
  1255. );
  1256. #ifdef UNICODE
  1257. #define PFAXENUMPORTS PFAXENUMPORTSW
  1258. #else
  1259. #define PFAXENUMPORTS PFAXENUMPORTSA
  1260. #endif // !UNICODE
  1261. WINFAXAPI
  1262. BOOL
  1263. WINAPI
  1264. FaxGetPortA(
  1265. IN HANDLE FaxPortHandle,
  1266. OUT PFAX_PORT_INFOA *PortInfo
  1267. );
  1268. WINFAXAPI
  1269. BOOL
  1270. WINAPI
  1271. FaxGetPortW(
  1272. IN HANDLE FaxPortHandle,
  1273. OUT PFAX_PORT_INFOW *PortInfo
  1274. );
  1275. #ifdef UNICODE
  1276. #define FaxGetPort FaxGetPortW
  1277. #else
  1278. #define FaxGetPort FaxGetPortA
  1279. #endif // !UNICODE
  1280. typedef BOOL
  1281. (WINAPI *PFAXGETPORTA)(
  1282. IN HANDLE FaxPortHandle,
  1283. OUT PFAX_PORT_INFOA *PortInfo
  1284. );
  1285. typedef BOOL
  1286. (WINAPI *PFAXGETPORTW)(
  1287. IN HANDLE FaxPortHandle,
  1288. OUT PFAX_PORT_INFOW *PortInfo
  1289. );
  1290. #ifdef UNICODE
  1291. #define PFAXGETPORT PFAXGETPORTW
  1292. #else
  1293. #define PFAXGETPORT PFAXGETPORTA
  1294. #endif // !UNICODE
  1295. WINFAXAPI
  1296. BOOL
  1297. WINAPI
  1298. FaxSetPortA(
  1299. IN HANDLE FaxPortHandle,
  1300. IN const FAX_PORT_INFOA *PortInfo
  1301. );
  1302. WINFAXAPI
  1303. BOOL
  1304. WINAPI
  1305. FaxSetPortW(
  1306. IN HANDLE FaxPortHandle,
  1307. IN const FAX_PORT_INFOW *PortInfo
  1308. );
  1309. #ifdef UNICODE
  1310. #define FaxSetPort FaxSetPortW
  1311. #else
  1312. #define FaxSetPort FaxSetPortA
  1313. #endif // !UNICODE
  1314. typedef BOOL
  1315. (WINAPI *PFAXSETPORTA)(
  1316. IN HANDLE FaxPortHandle,
  1317. IN const FAX_PORT_INFOA *PortInfo
  1318. );
  1319. typedef BOOL
  1320. (WINAPI *PFAXSETPORTW)(
  1321. IN HANDLE FaxPortHandle,
  1322. IN const FAX_PORT_INFOW *PortInfo
  1323. );
  1324. #ifdef UNICODE
  1325. #define PFAXSETPORT PFAXSETPORTW
  1326. #else
  1327. #define PFAXSETPORT PFAXSETPORTA
  1328. #endif // !UNICODE
  1329. WINFAXAPI
  1330. BOOL
  1331. WINAPI
  1332. FaxEnumRoutingMethodsA(
  1333. IN HANDLE FaxPortHandle,
  1334. OUT PFAX_ROUTING_METHODA *RoutingMethod,
  1335. OUT LPDWORD MethodsReturned
  1336. );
  1337. WINFAXAPI
  1338. BOOL
  1339. WINAPI
  1340. FaxEnumRoutingMethodsW(
  1341. IN HANDLE FaxPortHandle,
  1342. OUT PFAX_ROUTING_METHODW *RoutingMethod,
  1343. OUT LPDWORD MethodsReturned
  1344. );
  1345. #ifdef UNICODE
  1346. #define FaxEnumRoutingMethods FaxEnumRoutingMethodsW
  1347. #else
  1348. #define FaxEnumRoutingMethods FaxEnumRoutingMethodsA
  1349. #endif // !UNICODE
  1350. typedef BOOL
  1351. (WINAPI *PFAXENUMROUTINGMETHODSA)(
  1352. IN HANDLE FaxPortHandle,
  1353. OUT PFAX_ROUTING_METHODA *RoutingMethod,
  1354. OUT LPDWORD MethodsReturned
  1355. );
  1356. typedef BOOL
  1357. (WINAPI *PFAXENUMROUTINGMETHODSW)(
  1358. IN HANDLE FaxPortHandle,
  1359. OUT PFAX_ROUTING_METHODW *RoutingMethod,
  1360. OUT LPDWORD MethodsReturned
  1361. );
  1362. #ifdef UNICODE
  1363. #define PFAXENUMROUTINGMETHODS PFAXENUMROUTINGMETHODSW
  1364. #else
  1365. #define PFAXENUMROUTINGMETHODS PFAXENUMROUTINGMETHODSA
  1366. #endif // !UNICODE
  1367. WINFAXAPI
  1368. BOOL
  1369. WINAPI
  1370. FaxEnableRoutingMethodA(
  1371. IN HANDLE FaxPortHandle,
  1372. IN LPCSTR RoutingGuid,
  1373. IN BOOL Enabled
  1374. );
  1375. WINFAXAPI
  1376. BOOL
  1377. WINAPI
  1378. FaxEnableRoutingMethodW(
  1379. IN HANDLE FaxPortHandle,
  1380. IN LPCWSTR RoutingGuid,
  1381. IN BOOL Enabled
  1382. );
  1383. #ifdef UNICODE
  1384. #define FaxEnableRoutingMethod FaxEnableRoutingMethodW
  1385. #else
  1386. #define FaxEnableRoutingMethod FaxEnableRoutingMethodA
  1387. #endif // !UNICODE
  1388. typedef BOOL
  1389. (WINAPI *PFAXENABLEROUTINGMETHODA)(
  1390. IN HANDLE FaxPortHandle,
  1391. IN LPCSTR RoutingGuid,
  1392. IN BOOL Enabled
  1393. );
  1394. typedef BOOL
  1395. (WINAPI *PFAXENABLEROUTINGMETHODW)(
  1396. IN HANDLE FaxPortHandle,
  1397. IN LPCWSTR RoutingGuid,
  1398. IN BOOL Enabled
  1399. );
  1400. #ifdef UNICODE
  1401. #define PFAXENABLEROUTINGMETHOD PFAXENABLEROUTINGMETHODW
  1402. #else
  1403. #define PFAXENABLEROUTINGMETHOD PFAXENABLEROUTINGMETHODA
  1404. #endif // !UNICODE
  1405. WINFAXAPI
  1406. BOOL
  1407. WINAPI
  1408. FaxEnumGlobalRoutingInfoA(
  1409. IN HANDLE FaxHandle,
  1410. OUT PFAX_GLOBAL_ROUTING_INFOA *RoutingInfo,
  1411. OUT LPDWORD MethodsReturned
  1412. );
  1413. WINFAXAPI
  1414. BOOL
  1415. WINAPI
  1416. FaxEnumGlobalRoutingInfoW(
  1417. IN HANDLE FaxHandle,
  1418. OUT PFAX_GLOBAL_ROUTING_INFOW *RoutingInfo,
  1419. OUT LPDWORD MethodsReturned
  1420. );
  1421. #ifdef UNICODE
  1422. #define FaxEnumGlobalRoutingInfo FaxEnumGlobalRoutingInfoW
  1423. #else
  1424. #define FaxEnumGlobalRoutingInfo FaxEnumGlobalRoutingInfoA
  1425. #endif // !UNICODE
  1426. typedef BOOL
  1427. (WINAPI *PFAXENUMGLOBALROUTINGINFOA)(
  1428. IN HANDLE FaxHandle,
  1429. OUT PFAX_GLOBAL_ROUTING_INFOA *RoutingInfo,
  1430. OUT LPDWORD MethodsReturned
  1431. );
  1432. typedef BOOL
  1433. (WINAPI *PFAXENUMGLOBALROUTINGINFOW)(
  1434. IN HANDLE FaxHandle,
  1435. OUT PFAX_GLOBAL_ROUTING_INFOW *RoutingInfo,
  1436. OUT LPDWORD MethodsReturned
  1437. );
  1438. #ifdef UNICODE
  1439. #define PFAXENUMGLOBALROUTINGINFO PFAXENUMGLOBALROUTINGINFOW
  1440. #else
  1441. #define PFAXENUMGLOBALROUTINGINFO PFAXENUMGLOBALROUTINGINFOA
  1442. #endif // !UNICODE
  1443. WINFAXAPI
  1444. BOOL
  1445. WINAPI
  1446. FaxSetGlobalRoutingInfoA(
  1447. IN HANDLE FaxHandle,
  1448. IN const FAX_GLOBAL_ROUTING_INFOA *RoutingInfo
  1449. );
  1450. WINFAXAPI
  1451. BOOL
  1452. WINAPI
  1453. FaxSetGlobalRoutingInfoW(
  1454. IN HANDLE FaxHandle,
  1455. IN const FAX_GLOBAL_ROUTING_INFOW *RoutingInfo
  1456. );
  1457. #ifdef UNICODE
  1458. #define FaxSetGlobalRoutingInfo FaxSetGlobalRoutingInfoW
  1459. #else
  1460. #define FaxSetGlobalRoutingInfo FaxSetGlobalRoutingInfoA
  1461. #endif // !UNICODE
  1462. typedef BOOL
  1463. (WINAPI *PFAXSETGLOBALROUTINGINFOA)(
  1464. IN HANDLE FaxPortHandle,
  1465. IN const FAX_GLOBAL_ROUTING_INFOA *RoutingInfo
  1466. );
  1467. typedef BOOL
  1468. (WINAPI *PFAXSETGLOBALROUTINGINFOW)(
  1469. IN HANDLE FaxPortHandle,
  1470. IN const FAX_GLOBAL_ROUTING_INFOW *RoutingInfo
  1471. );
  1472. #ifdef UNICODE
  1473. #define PFAXSETGLOBALROUTINGINFO PFAXSETGLOBALROUTINGINFOW
  1474. #else
  1475. #define PFAXSETGLOBALROUTINGINFO PFAXSETGLOBALROUTINGINFOA
  1476. #endif // !UNICODE
  1477. WINFAXAPI
  1478. BOOL
  1479. WINAPI
  1480. FaxGetRoutingInfoA(
  1481. IN HANDLE FaxPortHandle,
  1482. IN LPCSTR RoutingGuid,
  1483. OUT LPBYTE *RoutingInfoBuffer,
  1484. OUT LPDWORD RoutingInfoBufferSize
  1485. );
  1486. WINFAXAPI
  1487. BOOL
  1488. WINAPI
  1489. FaxGetRoutingInfoW(
  1490. IN HANDLE FaxPortHandle,
  1491. IN LPCWSTR RoutingGuid,
  1492. OUT LPBYTE *RoutingInfoBuffer,
  1493. OUT LPDWORD RoutingInfoBufferSize
  1494. );
  1495. #ifdef UNICODE
  1496. #define FaxGetRoutingInfo FaxGetRoutingInfoW
  1497. #else
  1498. #define FaxGetRoutingInfo FaxGetRoutingInfoA
  1499. #endif // !UNICODE
  1500. typedef BOOL
  1501. (WINAPI *PFAXGETROUTINGINFOA)(
  1502. IN HANDLE FaxPortHandle,
  1503. IN LPCSTR RoutingGuid,
  1504. OUT LPBYTE *RoutingInfoBuffer,
  1505. OUT LPDWORD RoutingInfoBufferSize
  1506. );
  1507. typedef BOOL
  1508. (WINAPI *PFAXGETROUTINGINFOW)(
  1509. IN HANDLE FaxPortHandle,
  1510. IN LPCWSTR RoutingGuid,
  1511. OUT LPBYTE *RoutingInfoBuffer,
  1512. OUT LPDWORD RoutingInfoBufferSize
  1513. );
  1514. #ifdef UNICODE
  1515. #define PFAXGETROUTINGINFO PFAXGETROUTINGINFOW
  1516. #else
  1517. #define PFAXGETROUTINGINFO PFAXGETROUTINGINFOA
  1518. #endif // !UNICODE
  1519. WINFAXAPI
  1520. BOOL
  1521. WINAPI
  1522. FaxSetRoutingInfoA(
  1523. IN HANDLE FaxPortHandle,
  1524. IN LPCSTR RoutingGuid,
  1525. IN const BYTE *RoutingInfoBuffer,
  1526. IN DWORD RoutingInfoBufferSize
  1527. );
  1528. WINFAXAPI
  1529. BOOL
  1530. WINAPI
  1531. FaxSetRoutingInfoW(
  1532. IN HANDLE FaxPortHandle,
  1533. IN LPCWSTR RoutingGuid,
  1534. IN const BYTE *RoutingInfoBuffer,
  1535. IN DWORD RoutingInfoBufferSize
  1536. );
  1537. #ifdef UNICODE
  1538. #define FaxSetRoutingInfo FaxSetRoutingInfoW
  1539. #else
  1540. #define FaxSetRoutingInfo FaxSetRoutingInfoA
  1541. #endif // !UNICODE
  1542. typedef BOOL
  1543. (WINAPI *PFAXSETROUTINGINFOA)(
  1544. IN HANDLE FaxPortHandle,
  1545. IN LPCSTR RoutingGuid,
  1546. IN const BYTE *RoutingInfoBuffer,
  1547. IN DWORD RoutingInfoBufferSize
  1548. );
  1549. typedef BOOL
  1550. (WINAPI *PFAXSETROUTINGINFOW)(
  1551. IN HANDLE FaxPortHandle,
  1552. IN LPCWSTR RoutingGuid,
  1553. IN const BYTE *RoutingInfoBuffer,
  1554. IN DWORD RoutingInfoBufferSize
  1555. );
  1556. #ifdef UNICODE
  1557. #define PFAXSETROUTINGINFO PFAXSETROUTINGINFOW
  1558. #else
  1559. #define PFAXSETROUTINGINFO PFAXSETROUTINGINFOA
  1560. #endif // !UNICODE
  1561. WINFAXAPI
  1562. BOOL
  1563. WINAPI
  1564. FaxRelease(
  1565. IN HANDLE FaxHandle
  1566. );
  1567. typedef BOOL
  1568. (WINAPI *PFAXRELEASE)(
  1569. IN HANDLE FaxHandle
  1570. );
  1571. BOOL
  1572. FXSAPIInitialize(
  1573. VOID
  1574. );
  1575. VOID
  1576. FXSAPIFree(
  1577. VOID
  1578. );
  1579. WINFAXAPI
  1580. BOOL
  1581. WINAPI
  1582. FaxStartPrintJob2A
  1583. (
  1584. IN LPCSTR PrinterName,
  1585. IN const FAX_PRINT_INFOA *PrintInfo,
  1586. IN short TiffRes,
  1587. OUT LPDWORD FaxJobId,
  1588. OUT PFAX_CONTEXT_INFOA FaxContextInfo
  1589. );
  1590. WINFAXAPI
  1591. BOOL
  1592. WINAPI
  1593. FaxStartPrintJob2W
  1594. (
  1595. IN LPCWSTR PrinterName,
  1596. IN const FAX_PRINT_INFOW *PrintInfo,
  1597. IN short TiffRes,
  1598. OUT LPDWORD FaxJobId,
  1599. OUT PFAX_CONTEXT_INFOW FaxContextInfo
  1600. );
  1601. #ifdef UNICODE
  1602. #define FaxStartPrintJob2 FaxStartPrintJob2W
  1603. #else
  1604. #define FaxStartPrintJob2 FaxStartPrintJob2A
  1605. #endif // !UNICODE
  1606. WINFAXAPI
  1607. BOOL
  1608. WINAPI
  1609. FaxInitializeEventQueue(
  1610. IN HANDLE FaxHandle,
  1611. IN HANDLE CompletionPort,
  1612. IN ULONG_PTR CompletionKey,
  1613. IN HWND hWnd,
  1614. IN UINT MessageStart
  1615. );
  1616. typedef BOOL
  1617. (WINAPI *PFAXINITIALIZEEVENTQUEUE)(
  1618. IN HANDLE FaxHandle,
  1619. IN HANDLE CompletionPort,
  1620. IN ULONG_PTR CompletionKey,
  1621. IN HWND hWnd,
  1622. IN UINT MessageStart
  1623. );
  1624. WINFAXAPI
  1625. VOID
  1626. WINAPI
  1627. FaxFreeBuffer(
  1628. LPVOID Buffer
  1629. );
  1630. typedef VOID
  1631. (WINAPI *PFAXFREEBUFFER)(
  1632. LPVOID Buffer
  1633. );
  1634. WINFAXAPI
  1635. BOOL
  1636. WINAPI
  1637. FaxStartPrintJobA(
  1638. IN LPCSTR PrinterName,
  1639. IN const FAX_PRINT_INFOA *PrintInfo,
  1640. OUT LPDWORD FaxJobId,
  1641. OUT PFAX_CONTEXT_INFOA FaxContextInfo
  1642. );
  1643. WINFAXAPI
  1644. BOOL
  1645. WINAPI
  1646. FaxStartPrintJobW(
  1647. IN LPCWSTR PrinterName,
  1648. IN const FAX_PRINT_INFOW *PrintInfo,
  1649. OUT LPDWORD FaxJobId,
  1650. OUT PFAX_CONTEXT_INFOW FaxContextInfo
  1651. );
  1652. #ifdef UNICODE
  1653. #define FaxStartPrintJob FaxStartPrintJobW
  1654. #else
  1655. #define FaxStartPrintJob FaxStartPrintJobA
  1656. #endif // !UNICODE
  1657. typedef BOOL
  1658. (WINAPI *PFAXSTARTPRINTJOBA)(
  1659. IN LPCSTR PrinterName,
  1660. IN const FAX_PRINT_INFOA *PrintInfo,
  1661. OUT LPDWORD FaxJobId,
  1662. OUT PFAX_CONTEXT_INFOA FaxContextInfo
  1663. );
  1664. typedef BOOL
  1665. (WINAPI *PFAXSTARTPRINTJOBW)(
  1666. IN LPCWSTR PrinterName,
  1667. IN const FAX_PRINT_INFOW *PrintInfo,
  1668. OUT LPDWORD FaxJobId,
  1669. OUT PFAX_CONTEXT_INFOW FaxContextInfo
  1670. );
  1671. #ifdef UNICODE
  1672. #define PFAXSTARTPRINTJOB PFAXSTARTPRINTJOBW
  1673. #else
  1674. #define PFAXSTARTPRINTJOB PFAXSTARTPRINTJOBA
  1675. #endif // !UNICODE
  1676. WINFAXAPI
  1677. BOOL
  1678. WINAPI
  1679. FaxPrintCoverPageA(
  1680. IN const FAX_CONTEXT_INFOA *FaxContextInfo,
  1681. IN const FAX_COVERPAGE_INFOA *CoverPageInfo
  1682. );
  1683. WINFAXAPI
  1684. BOOL
  1685. WINAPI
  1686. FaxPrintCoverPageW(
  1687. IN const FAX_CONTEXT_INFOW *FaxContextInfo,
  1688. IN const FAX_COVERPAGE_INFOW *CoverPageInfo
  1689. );
  1690. #ifdef UNICODE
  1691. #define FaxPrintCoverPage FaxPrintCoverPageW
  1692. #else
  1693. #define FaxPrintCoverPage FaxPrintCoverPageA
  1694. #endif // !UNICODE
  1695. typedef BOOL
  1696. (WINAPI *PFAXPRINTCOVERPAGEA)(
  1697. IN const FAX_CONTEXT_INFOA *FaxContextInfo,
  1698. IN const FAX_COVERPAGE_INFOA *CoverPageInfo
  1699. );
  1700. typedef BOOL
  1701. (WINAPI *PFAXPRINTCOVERPAGEW)(
  1702. IN const FAX_CONTEXT_INFOW *FaxContextInfo,
  1703. IN const FAX_COVERPAGE_INFOW *CoverPageInfo
  1704. );
  1705. #ifdef UNICODE
  1706. #define PFAXPRINTCOVERPAGE PFAXPRINTCOVERPAGEW
  1707. #else
  1708. #define PFAXPRINTCOVERPAGE PFAXPRINTCOVERPAGEA
  1709. #endif // !UNICODE
  1710. WINFAXAPI
  1711. BOOL
  1712. WINAPI
  1713. FaxRegisterServiceProviderW(
  1714. IN LPCWSTR DeviceProvider,
  1715. IN LPCWSTR FriendlyName,
  1716. IN LPCWSTR ImageName,
  1717. IN LPCWSTR TspName
  1718. );
  1719. #define FaxRegisterServiceProvider FaxRegisterServiceProviderW
  1720. typedef BOOL
  1721. (WINAPI *PFAXREGISTERSERVICEPROVIDERW)(
  1722. IN LPCWSTR DeviceProvider,
  1723. IN LPCWSTR FriendlyName,
  1724. IN LPCWSTR ImageName,
  1725. IN LPCWSTR TspName
  1726. );
  1727. #define PFAXREGISTERSERVICEPROVIDER PFAXREGISTERSERVICEPROVIDERW
  1728. typedef BOOL
  1729. (CALLBACK *PFAX_ROUTING_INSTALLATION_CALLBACKW)(
  1730. IN HANDLE FaxHandle,
  1731. IN LPVOID Context,
  1732. IN OUT LPWSTR MethodName,
  1733. IN OUT LPWSTR FriendlyName,
  1734. IN OUT LPWSTR FunctionName,
  1735. IN OUT LPWSTR Guid
  1736. );
  1737. #define PFAX_ROUTING_INSTALLATION_CALLBACK PFAX_ROUTING_INSTALLATION_CALLBACKW
  1738. WINFAXAPI
  1739. BOOL
  1740. WINAPI
  1741. FaxRegisterRoutingExtensionW(
  1742. IN HANDLE FaxHandle,
  1743. IN LPCWSTR ExtensionName,
  1744. IN LPCWSTR FriendlyName,
  1745. IN LPCWSTR ImageName,
  1746. IN PFAX_ROUTING_INSTALLATION_CALLBACKW CallBack,
  1747. IN LPVOID Context
  1748. );
  1749. #define FaxRegisterRoutingExtension FaxRegisterRoutingExtensionW
  1750. typedef BOOL
  1751. (WINAPI *PFAXREGISTERROUTINGEXTENSIONW)(
  1752. IN HANDLE FaxHandle,
  1753. IN LPCWSTR ExtensionName,
  1754. IN LPCWSTR FriendlyName,
  1755. IN LPCWSTR ImageName,
  1756. IN PFAX_ROUTING_INSTALLATION_CALLBACKW CallBack,
  1757. IN LPVOID Context
  1758. );
  1759. #define PFAXREGISTERROUTINGEXTENSION PFAXREGISTERROUTINGEXTENSIONW
  1760. WINFAXAPI
  1761. BOOL
  1762. WINAPI
  1763. FaxUnregisterRoutingExtensionA(
  1764. IN HANDLE hFaxHandle,
  1765. IN LPCSTR lpctstrExtensionName
  1766. );
  1767. WINFAXAPI
  1768. BOOL
  1769. WINAPI
  1770. FaxUnregisterRoutingExtensionW(
  1771. IN HANDLE hFaxHandle,
  1772. IN LPCWSTR lpctstrExtensionName
  1773. );
  1774. #ifdef UNICODE
  1775. #define FaxUnregisterRoutingExtension FaxUnregisterRoutingExtensionW
  1776. #else
  1777. #define FaxUnregisterRoutingExtension FaxUnregisterRoutingExtensionA
  1778. #endif // !UNICODE
  1779. WINFAXAPI
  1780. BOOL
  1781. WINAPI
  1782. FaxGetInstallType(
  1783. IN HANDLE FaxHandle,
  1784. OUT LPDWORD InstallType,
  1785. OUT LPDWORD InstalledPlatforms,
  1786. OUT LPDWORD ProductType
  1787. );
  1788. typedef BOOL
  1789. (WINAPI *PFAXGETINSTALLTYPE)(
  1790. IN HANDLE FaxHandle,
  1791. OUT LPDWORD InstallType,
  1792. OUT LPDWORD InstalledPlatforms,
  1793. OUT LPDWORD ProductType
  1794. );
  1795. WINFAXAPI
  1796. BOOL
  1797. WINAPI
  1798. FaxAccessCheck(
  1799. IN HANDLE FaxHandle,
  1800. IN DWORD AccessMask
  1801. );
  1802. typedef BOOL
  1803. (WINAPI *PFAXACCESSCHECK)(
  1804. IN HANDLE FaxHandle,
  1805. IN DWORD AccessMask
  1806. );
  1807. //
  1808. // Fax Specific Access Rights
  1809. //
  1810. #define FAX_JOB_SUBMIT (0x0001)
  1811. #define FAX_JOB_QUERY (0x0002)
  1812. #define FAX_CONFIG_QUERY (0x0004)
  1813. #define FAX_CONFIG_SET (0x0008)
  1814. #define FAX_PORT_QUERY (0x0010)
  1815. #define FAX_PORT_SET (0x0020)
  1816. #define FAX_JOB_MANAGE (0x0040)
  1817. #define FAX_READ (STANDARD_RIGHTS_READ |\
  1818. FAX_JOB_QUERY |\
  1819. FAX_CONFIG_QUERY |\
  1820. FAX_PORT_QUERY)
  1821. #define FAX_WRITE (STANDARD_RIGHTS_WRITE |\
  1822. FAX_JOB_SUBMIT )
  1823. #define FAX_ALL_ACCESS (STANDARD_RIGHTS_ALL |\
  1824. FAX_JOB_SUBMIT |\
  1825. FAX_JOB_QUERY |\
  1826. FAX_CONFIG_QUERY |\
  1827. FAX_CONFIG_SET |\
  1828. FAX_PORT_QUERY |\
  1829. FAX_PORT_SET |\
  1830. FAX_JOB_MANAGE)
  1831. //************************************
  1832. //* Extended API Functions
  1833. //************************************
  1834. #define MAX_FAX_STRING_LEN MAX_PATH - 2
  1835. #define MAX_DIR_PATH 248
  1836. //
  1837. // Outbound routing defines
  1838. //
  1839. #define ROUTING_RULE_COUNTRY_CODE_ANY 0 // Outbound routing rule - Any country dialing code
  1840. #define ROUTING_RULE_AREA_CODE_ANY 0 // Outbound routing rule - Any area dialing code
  1841. #define MAX_ROUTING_GROUP_NAME 128
  1842. #define ROUTING_GROUP_ALL_DEVICESW L"<All devices>"
  1843. #define ROUTING_GROUP_ALL_DEVICESA "<All devices>"
  1844. #ifdef UNICODE
  1845. #define ROUTING_GROUP_ALL_DEVICES ROUTING_GROUP_ALL_DEVICESW
  1846. #else
  1847. #define ROUTING_GROUP_ALL_DEVICES ROUTING_GROUP_ALL_DEVICESA;
  1848. #endif // UNICODE
  1849. //
  1850. // Activity logging defines
  1851. //
  1852. #define ACTIVITY_LOG_INBOX_FILE TEXT("InboxLOG.txt")
  1853. #define ACTIVITY_LOG_OUTBOX_FILE TEXT("OutboxLOG.txt")
  1854. //
  1855. // Archive defines
  1856. //
  1857. #define FAX_ARCHIVE_FOLDER_INVALID_SIZE MAKELONGLONG(0xffffffff, 0xffffffff)
  1858. #define MAX_ARCHIVE_FOLDER_PATH 180
  1859. //
  1860. // New job status codes
  1861. //
  1862. #define JS_COMPLETED 0x00000100
  1863. #define JS_CANCELED 0x00000200
  1864. #define JS_CANCELING 0x00000400
  1865. #define JS_ROUTING 0x00000800
  1866. //
  1867. // Extended job status defines
  1868. //
  1869. #define JS_EX_DISCONNECTED 0x00000001
  1870. #define JS_EX_INITIALIZING 0x00000002
  1871. #define JS_EX_DIALING 0x00000003
  1872. #define JS_EX_TRANSMITTING 0x00000004
  1873. #define JS_EX_ANSWERED 0x00000005
  1874. #define JS_EX_RECEIVING 0x00000006
  1875. #define JS_EX_LINE_UNAVAILABLE 0x00000007
  1876. #define JS_EX_BUSY 0x00000008
  1877. #define JS_EX_NO_ANSWER 0x00000009
  1878. #define JS_EX_BAD_ADDRESS 0x0000000A
  1879. #define JS_EX_NO_DIAL_TONE 0x0000000B
  1880. #define JS_EX_FATAL_ERROR 0x0000000C
  1881. #define JS_EX_CALL_DELAYED 0x0000000D
  1882. #define JS_EX_CALL_BLACKLISTED 0x0000000E
  1883. #define JS_EX_NOT_FAX_CALL 0x0000000F
  1884. #define JS_EX_PARTIALLY_RECEIVED 0x00000010
  1885. #define JS_EX_HANDLED 0x00000011
  1886. #define FAX_API_VER_0_MAX_JS_EX JS_EX_HANDLED // API version 0 was only aware of extended status codes up to JS_EX_HANDLED
  1887. #define JS_EX_CALL_COMPLETED 0x00000012
  1888. #define JS_EX_CALL_ABORTED 0x00000013
  1889. #define FAX_API_VER_1_MAX_JS_EX JS_EX_CALL_ABORTED // API version 0 was only aware of extended status codes up to JS_EX_CALL_ABORTED
  1890. #define JS_EX_PROPRIETARY 0x01000000
  1891. //
  1892. // Available job operations
  1893. //
  1894. typedef enum
  1895. {
  1896. FAX_JOB_OP_VIEW = 0x0001,
  1897. FAX_JOB_OP_PAUSE = 0x0002,
  1898. FAX_JOB_OP_RESUME = 0x0004,
  1899. FAX_JOB_OP_RESTART = 0x0008,
  1900. FAX_JOB_OP_DELETE = 0x0010,
  1901. FAX_JOB_OP_RECIPIENT_INFO = 0x0020,
  1902. FAX_JOB_OP_SENDER_INFO = 0x0040
  1903. } FAX_ENUM_JOB_OP;
  1904. //************************************
  1905. //* Getting / Settings the queue state
  1906. //************************************
  1907. typedef enum
  1908. {
  1909. FAX_INCOMING_BLOCKED = 0x0001,
  1910. FAX_OUTBOX_BLOCKED = 0x0002,
  1911. FAX_OUTBOX_PAUSED = 0x0004
  1912. } FAX_ENUM_QUEUE_STATE;
  1913. WINFAXAPI
  1914. BOOL
  1915. WINAPI
  1916. FaxGetQueueStates (
  1917. IN HANDLE hFaxHandle,
  1918. OUT PDWORD pdwQueueStates
  1919. );
  1920. WINFAXAPI
  1921. BOOL
  1922. WINAPI
  1923. FaxSetQueue (
  1924. IN HANDLE hFaxHandle,
  1925. IN CONST DWORD dwQueueStates
  1926. );
  1927. //************************************************
  1928. //* Getting / Setting the receipts configuration
  1929. //************************************************
  1930. typedef enum
  1931. {
  1932. FAX_SMTP_AUTH_ANONYMOUS,
  1933. FAX_SMTP_AUTH_BASIC,
  1934. FAX_SMTP_AUTH_NTLM
  1935. } FAX_ENUM_SMTP_AUTH_OPTIONS;
  1936. typedef struct _FAX_RECEIPTS_CONFIGA
  1937. {
  1938. DWORD dwSizeOfStruct; // For version checks
  1939. DWORD dwAllowedReceipts; // Any combination of DRT_EMAIL and DRT_MSGBOX
  1940. FAX_ENUM_SMTP_AUTH_OPTIONS SMTPAuthOption; // SMTP server authentication type
  1941. LPSTR lptstrReserved; // Reserved; must be NULL
  1942. LPSTR lptstrSMTPServer; // SMTP server name
  1943. DWORD dwSMTPPort; // SMTP port number
  1944. LPSTR lptstrSMTPFrom; // SMTP sender address
  1945. LPSTR lptstrSMTPUserName; // SMTP user name (for authenticated connections)
  1946. LPSTR lptstrSMTPPassword; // SMTP password (for authenticated connections)
  1947. // This value is always NULL on get and may be NULL
  1948. // on set (won't be written in the server).
  1949. BOOL bIsToUseForMSRouteThroughEmailMethod;
  1950. } FAX_RECEIPTS_CONFIGA, *PFAX_RECEIPTS_CONFIGA;
  1951. typedef struct _FAX_RECEIPTS_CONFIGW
  1952. {
  1953. DWORD dwSizeOfStruct; // For version checks
  1954. DWORD dwAllowedReceipts; // Any combination of DRT_EMAIL and DRT_MSGBOX
  1955. FAX_ENUM_SMTP_AUTH_OPTIONS SMTPAuthOption; // SMTP server authentication type
  1956. LPWSTR lptstrReserved; // Reserved; must be NULL
  1957. LPWSTR lptstrSMTPServer; // SMTP server name
  1958. DWORD dwSMTPPort; // SMTP port number
  1959. LPWSTR lptstrSMTPFrom; // SMTP sender address
  1960. LPWSTR lptstrSMTPUserName; // SMTP user name (for authenticated connections)
  1961. LPWSTR lptstrSMTPPassword; // SMTP password (for authenticated connections)
  1962. // This value is always NULL on get and may be NULL
  1963. // on set (won't be written in the server).
  1964. BOOL bIsToUseForMSRouteThroughEmailMethod;
  1965. } FAX_RECEIPTS_CONFIGW, *PFAX_RECEIPTS_CONFIGW;
  1966. #ifdef UNICODE
  1967. typedef FAX_RECEIPTS_CONFIGW FAX_RECEIPTS_CONFIG;
  1968. typedef PFAX_RECEIPTS_CONFIGW PFAX_RECEIPTS_CONFIG;
  1969. #else
  1970. typedef FAX_RECEIPTS_CONFIGA FAX_RECEIPTS_CONFIG;
  1971. typedef PFAX_RECEIPTS_CONFIGA PFAX_RECEIPTS_CONFIG;
  1972. #endif // UNICODE
  1973. WINFAXAPI
  1974. BOOL
  1975. WINAPI
  1976. FaxGetReceiptsConfigurationA (
  1977. IN HANDLE hFaxHandle,
  1978. OUT PFAX_RECEIPTS_CONFIGA *ppReceipts
  1979. );
  1980. WINFAXAPI
  1981. BOOL
  1982. WINAPI
  1983. FaxGetReceiptsConfigurationW (
  1984. IN HANDLE hFaxHandle,
  1985. OUT PFAX_RECEIPTS_CONFIGW *ppReceipts
  1986. );
  1987. #ifdef UNICODE
  1988. #define FaxGetReceiptsConfiguration FaxGetReceiptsConfigurationW
  1989. #else
  1990. #define FaxGetReceiptsConfiguration FaxGetReceiptsConfigurationA
  1991. #endif // !UNICODE
  1992. WINFAXAPI
  1993. BOOL
  1994. WINAPI
  1995. FaxSetReceiptsConfigurationA (
  1996. IN HANDLE hFaxHandle,
  1997. IN CONST PFAX_RECEIPTS_CONFIGA pReceipts
  1998. );
  1999. WINFAXAPI
  2000. BOOL
  2001. WINAPI
  2002. FaxSetReceiptsConfigurationW (
  2003. IN HANDLE hFaxHandle,
  2004. IN CONST PFAX_RECEIPTS_CONFIGW pReceipts
  2005. );
  2006. #ifdef UNICODE
  2007. #define FaxSetReceiptsConfiguration FaxSetReceiptsConfigurationW
  2008. #else
  2009. #define FaxSetReceiptsConfiguration FaxSetReceiptsConfigurationA
  2010. #endif // !UNICODE
  2011. WINFAXAPI
  2012. BOOL
  2013. WINAPI
  2014. FaxGetReceiptsOptions (
  2015. IN HANDLE hFaxHandle,
  2016. OUT PDWORD pdwReceiptsOptions // Combination of DRT_EMAIL and DRT_MSGBOX
  2017. );
  2018. //********************************************
  2019. //* Server version
  2020. //********************************************
  2021. typedef struct _FAX_VERSION
  2022. {
  2023. DWORD dwSizeOfStruct; // Size of this structure
  2024. BOOL bValid; // Is version valid?
  2025. WORD wMajorVersion;
  2026. WORD wMinorVersion;
  2027. WORD wMajorBuildNumber;
  2028. WORD wMinorBuildNumber;
  2029. DWORD dwFlags; // Combination of FAX_VER_FLAG_*
  2030. } FAX_VERSION, *PFAX_VERSION;
  2031. typedef enum
  2032. {
  2033. FAX_VER_FLAG_CHECKED = 0x00000001, // File was built in debug mode
  2034. FAX_VER_FLAG_EVALUATION = 0x00000002 // Evaluation build
  2035. } FAX_VERSION_FLAGS;
  2036. WINFAXAPI
  2037. BOOL
  2038. WINAPI
  2039. FaxGetVersion (
  2040. IN HANDLE hFaxHandle,
  2041. OUT PFAX_VERSION pVersion
  2042. );
  2043. #define FAX_API_VERSION_0 0x00000000 // BOS/SBS 2000 Fax Server API (0.0)
  2044. #define FAX_API_VERSION_1 0x00010000 // Windows XP Fax Server API (1.0)
  2045. //
  2046. // NOTICE: Change this value whenever a new API version is introduced.
  2047. //
  2048. #define CURRENT_FAX_API_VERSION FAX_API_VERSION_1
  2049. WINFAXAPI
  2050. BOOL
  2051. WINAPI
  2052. FaxGetReportedServerAPIVersion (
  2053. IN HANDLE hFaxHandle,
  2054. OUT LPDWORD lpdwReportedServerAPIVersion
  2055. );
  2056. //********************************************
  2057. //* Activity logging
  2058. //********************************************
  2059. typedef struct _FAX_ACTIVITY_LOGGING_CONFIGA
  2060. {
  2061. DWORD dwSizeOfStruct;
  2062. BOOL bLogIncoming;
  2063. BOOL bLogOutgoing;
  2064. LPSTR lptstrDBPath;
  2065. } FAX_ACTIVITY_LOGGING_CONFIGA, *PFAX_ACTIVITY_LOGGING_CONFIGA;
  2066. typedef struct _FAX_ACTIVITY_LOGGING_CONFIGW
  2067. {
  2068. DWORD dwSizeOfStruct;
  2069. BOOL bLogIncoming;
  2070. BOOL bLogOutgoing;
  2071. LPWSTR lptstrDBPath;
  2072. } FAX_ACTIVITY_LOGGING_CONFIGW, *PFAX_ACTIVITY_LOGGING_CONFIGW;
  2073. #ifdef UNICODE
  2074. typedef FAX_ACTIVITY_LOGGING_CONFIGW FAX_ACTIVITY_LOGGING_CONFIG;
  2075. typedef PFAX_ACTIVITY_LOGGING_CONFIGW PFAX_ACTIVITY_LOGGING_CONFIG;
  2076. #else
  2077. typedef FAX_ACTIVITY_LOGGING_CONFIGA FAX_ACTIVITY_LOGGING_CONFIG;
  2078. typedef PFAX_ACTIVITY_LOGGING_CONFIGA PFAX_ACTIVITY_LOGGING_CONFIG;
  2079. #endif // UNICODE
  2080. WINFAXAPI
  2081. BOOL
  2082. WINAPI
  2083. FaxGetActivityLoggingConfigurationA (
  2084. IN HANDLE hFaxHandle,
  2085. OUT PFAX_ACTIVITY_LOGGING_CONFIGA *ppActivLogCfg
  2086. );
  2087. WINFAXAPI
  2088. BOOL
  2089. WINAPI
  2090. FaxGetActivityLoggingConfigurationW (
  2091. IN HANDLE hFaxHandle,
  2092. OUT PFAX_ACTIVITY_LOGGING_CONFIGW *ppActivLogCfg
  2093. );
  2094. #ifdef UNICODE
  2095. #define FaxGetActivityLoggingConfiguration FaxGetActivityLoggingConfigurationW
  2096. #else
  2097. #define FaxGetActivityLoggingConfiguration FaxGetActivityLoggingConfigurationA
  2098. #endif // !UNICODE
  2099. WINFAXAPI
  2100. BOOL
  2101. WINAPI
  2102. FaxSetActivityLoggingConfigurationA (
  2103. IN HANDLE hFaxHandle,
  2104. IN CONST PFAX_ACTIVITY_LOGGING_CONFIGA pActivLogCfg
  2105. );
  2106. WINFAXAPI
  2107. BOOL
  2108. WINAPI
  2109. FaxSetActivityLoggingConfigurationW (
  2110. IN HANDLE hFaxHandle,
  2111. IN CONST PFAX_ACTIVITY_LOGGING_CONFIGW pActivLogCfg
  2112. );
  2113. #ifdef UNICODE
  2114. #define FaxSetActivityLoggingConfiguration FaxSetActivityLoggingConfigurationW
  2115. #else
  2116. #define FaxSetActivityLoggingConfiguration FaxSetActivityLoggingConfigurationA
  2117. #endif // !UNICODE
  2118. //********************************************
  2119. //* Outbox configuration
  2120. //********************************************
  2121. typedef struct _FAX_OUTBOX_CONFIG
  2122. {
  2123. DWORD dwSizeOfStruct;
  2124. BOOL bAllowPersonalCP;
  2125. BOOL bUseDeviceTSID;
  2126. DWORD dwRetries;
  2127. DWORD dwRetryDelay;
  2128. FAX_TIME dtDiscountStart;
  2129. FAX_TIME dtDiscountEnd;
  2130. DWORD dwAgeLimit;
  2131. BOOL bBranding;
  2132. } FAX_OUTBOX_CONFIG, *PFAX_OUTBOX_CONFIG;
  2133. WINFAXAPI
  2134. BOOL
  2135. WINAPI
  2136. FaxGetOutboxConfiguration (
  2137. IN HANDLE hFaxHandle,
  2138. OUT PFAX_OUTBOX_CONFIG *ppOutboxCfg
  2139. );
  2140. WINFAXAPI
  2141. BOOL
  2142. WINAPI
  2143. FaxSetOutboxConfiguration (
  2144. IN HANDLE hFaxHandle,
  2145. IN CONST PFAX_OUTBOX_CONFIG pOutboxCfg
  2146. );
  2147. WINFAXAPI
  2148. BOOL
  2149. WINAPI
  2150. FaxGetPersonalCoverPagesOption (
  2151. IN HANDLE hFaxHandle,
  2152. OUT LPBOOL lpbPersonalCPAllowed
  2153. );
  2154. //********************************************
  2155. //* Archive configuration
  2156. //********************************************
  2157. typedef enum
  2158. {
  2159. FAX_MESSAGE_FOLDER_INBOX,
  2160. FAX_MESSAGE_FOLDER_SENTITEMS,
  2161. FAX_MESSAGE_FOLDER_QUEUE
  2162. } FAX_ENUM_MESSAGE_FOLDER;
  2163. typedef struct _FAX_ARCHIVE_CONFIGA
  2164. {
  2165. DWORD dwSizeOfStruct;
  2166. BOOL bUseArchive;
  2167. LPSTR lpcstrFolder;
  2168. BOOL bSizeQuotaWarning;
  2169. DWORD dwSizeQuotaHighWatermark;
  2170. DWORD dwSizeQuotaLowWatermark;
  2171. DWORD dwAgeLimit;
  2172. DWORDLONG dwlArchiveSize;
  2173. } FAX_ARCHIVE_CONFIGA, *PFAX_ARCHIVE_CONFIGA;
  2174. typedef struct _FAX_ARCHIVE_CONFIGW
  2175. {
  2176. DWORD dwSizeOfStruct;
  2177. BOOL bUseArchive;
  2178. LPWSTR lpcstrFolder;
  2179. BOOL bSizeQuotaWarning;
  2180. DWORD dwSizeQuotaHighWatermark;
  2181. DWORD dwSizeQuotaLowWatermark;
  2182. DWORD dwAgeLimit;
  2183. DWORDLONG dwlArchiveSize;
  2184. } FAX_ARCHIVE_CONFIGW, *PFAX_ARCHIVE_CONFIGW;
  2185. #ifdef UNICODE
  2186. typedef FAX_ARCHIVE_CONFIGW FAX_ARCHIVE_CONFIG;
  2187. typedef PFAX_ARCHIVE_CONFIGW PFAX_ARCHIVE_CONFIG;
  2188. #else
  2189. typedef FAX_ARCHIVE_CONFIGA FAX_ARCHIVE_CONFIG;
  2190. typedef PFAX_ARCHIVE_CONFIGA PFAX_ARCHIVE_CONFIG;
  2191. #endif // UNICODE
  2192. WINFAXAPI
  2193. BOOL
  2194. WINAPI
  2195. FaxGetArchiveConfigurationA (
  2196. IN HANDLE hFaxHandle,
  2197. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2198. OUT PFAX_ARCHIVE_CONFIGA *ppArchiveCfg
  2199. );
  2200. WINFAXAPI
  2201. BOOL
  2202. WINAPI
  2203. FaxGetArchiveConfigurationW (
  2204. IN HANDLE hFaxHandle,
  2205. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2206. OUT PFAX_ARCHIVE_CONFIGW *ppArchiveCfg
  2207. );
  2208. #ifdef UNICODE
  2209. #define FaxGetArchiveConfiguration FaxGetArchiveConfigurationW
  2210. #else
  2211. #define FaxGetArchiveConfiguration FaxGetArchiveConfigurationA
  2212. #endif // !UNICODE
  2213. WINFAXAPI
  2214. BOOL
  2215. WINAPI
  2216. FaxSetArchiveConfigurationA (
  2217. IN HANDLE hFaxHandle,
  2218. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2219. IN CONST PFAX_ARCHIVE_CONFIGA pArchiveCfg
  2220. );
  2221. WINFAXAPI
  2222. BOOL
  2223. WINAPI
  2224. FaxSetArchiveConfigurationW (
  2225. IN HANDLE hFaxHandle,
  2226. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2227. IN CONST PFAX_ARCHIVE_CONFIGW pArchiveCfg
  2228. );
  2229. #ifdef UNICODE
  2230. #define FaxSetArchiveConfiguration FaxSetArchiveConfigurationW
  2231. #else
  2232. #define FaxSetArchiveConfiguration FaxSetArchiveConfigurationA
  2233. #endif // !UNICODE
  2234. //********************************************
  2235. //* Server activity
  2236. //********************************************
  2237. typedef struct _FAX_SERVER_ACTIVITY
  2238. {
  2239. DWORD dwSizeOfStruct;
  2240. DWORD dwIncomingMessages;
  2241. DWORD dwRoutingMessages;
  2242. DWORD dwOutgoingMessages;
  2243. DWORD dwDelegatedOutgoingMessages;
  2244. DWORD dwQueuedMessages;
  2245. DWORD dwErrorEvents;
  2246. DWORD dwWarningEvents;
  2247. DWORD dwInformationEvents;
  2248. } FAX_SERVER_ACTIVITY, *PFAX_SERVER_ACTIVITY;
  2249. WINFAXAPI
  2250. BOOL
  2251. WINAPI
  2252. FaxGetServerActivity (
  2253. IN HANDLE hFaxHandle,
  2254. OUT PFAX_SERVER_ACTIVITY pServerActivity
  2255. );
  2256. //********************************************
  2257. //* Queue jobs
  2258. //********************************************
  2259. typedef enum
  2260. {
  2261. FAX_PRIORITY_TYPE_LOW,
  2262. FAX_PRIORITY_TYPE_NORMAL,
  2263. FAX_PRIORITY_TYPE_HIGH
  2264. } FAX_ENUM_PRIORITY_TYPE;
  2265. #define FAX_PRIORITY_TYPE_DEFAULT FAX_PRIORITY_TYPE_LOW
  2266. typedef enum
  2267. {
  2268. FAX_JOB_FIELD_JOB_ID = 0x00000001,
  2269. FAX_JOB_FIELD_TYPE = 0x00000002,
  2270. FAX_JOB_FIELD_QUEUE_STATUS = 0x00000004,
  2271. FAX_JOB_FIELD_STATUS_EX = 0x00000008,
  2272. FAX_JOB_FIELD_SIZE = 0x00000010,
  2273. FAX_JOB_FIELD_PAGE_COUNT = 0x00000020,
  2274. FAX_JOB_FIELD_CURRENT_PAGE = 0x00000040,
  2275. FAX_JOB_FIELD_RECIPIENT_PROFILE = 0x00000080,
  2276. FAX_JOB_FIELD_SCHEDULE_TIME = 0x00000100,
  2277. FAX_JOB_FIELD_ORIGINAL_SCHEDULE_TIME = 0x00000200,
  2278. FAX_JOB_FIELD_SUBMISSION_TIME = 0x00000400,
  2279. FAX_JOB_FIELD_TRANSMISSION_START_TIME = 0x00000800,
  2280. FAX_JOB_FIELD_TRANSMISSION_END_TIME = 0x00001000,
  2281. FAX_JOB_FIELD_PRIORITY = 0x00002000,
  2282. FAX_JOB_FIELD_RETRIES = 0x00004000,
  2283. FAX_JOB_FIELD_DELIVERY_REPORT_TYPE = 0x00008000,
  2284. FAX_JOB_FIELD_SENDER_PROFILE = 0x00010000,
  2285. FAX_JOB_FIELD_STATUS_SUB_STRUCT = 0x00020000,
  2286. FAX_JOB_FIELD_DEVICE_ID = 0x00040000,
  2287. FAX_JOB_FIELD_MESSAGE_ID = 0x00080000,
  2288. FAX_JOB_FIELD_BROADCAST_ID = 0x00010000
  2289. } FAX_ENUM_JOB_FIELDS;
  2290. typedef struct _FAX_JOB_STATUSA
  2291. {
  2292. DWORD dwSizeOfStruct;
  2293. DWORD dwValidityMask;
  2294. DWORD dwJobID;
  2295. DWORD dwJobType;
  2296. DWORD dwQueueStatus;
  2297. DWORD dwExtendedStatus;
  2298. LPCSTR lpctstrExtendedStatus;
  2299. DWORD dwSize;
  2300. DWORD dwPageCount;
  2301. DWORD dwCurrentPage;
  2302. LPCSTR lpctstrTsid;
  2303. LPCSTR lpctstrCsid;
  2304. SYSTEMTIME tmScheduleTime;
  2305. SYSTEMTIME tmTransmissionStartTime;
  2306. SYSTEMTIME tmTransmissionEndTime;
  2307. DWORD dwDeviceID;
  2308. LPCSTR lpctstrDeviceName;
  2309. DWORD dwRetries;
  2310. LPCSTR lpctstrCallerID;
  2311. LPCSTR lpctstrRoutingInfo;
  2312. DWORD dwAvailableJobOperations;
  2313. } FAX_JOB_STATUSA, *PFAX_JOB_STATUSA;
  2314. typedef struct _FAX_JOB_STATUSW
  2315. {
  2316. DWORD dwSizeOfStruct;
  2317. DWORD dwValidityMask;
  2318. DWORD dwJobID;
  2319. DWORD dwJobType;
  2320. DWORD dwQueueStatus;
  2321. DWORD dwExtendedStatus;
  2322. LPCWSTR lpctstrExtendedStatus;
  2323. DWORD dwSize;
  2324. DWORD dwPageCount;
  2325. DWORD dwCurrentPage;
  2326. LPCWSTR lpctstrTsid;
  2327. LPCWSTR lpctstrCsid;
  2328. SYSTEMTIME tmScheduleTime;
  2329. SYSTEMTIME tmTransmissionStartTime;
  2330. SYSTEMTIME tmTransmissionEndTime;
  2331. DWORD dwDeviceID;
  2332. LPCWSTR lpctstrDeviceName;
  2333. DWORD dwRetries;
  2334. LPCWSTR lpctstrCallerID;
  2335. LPCWSTR lpctstrRoutingInfo;
  2336. DWORD dwAvailableJobOperations;
  2337. } FAX_JOB_STATUSW, *PFAX_JOB_STATUSW;
  2338. #ifdef UNICODE
  2339. typedef FAX_JOB_STATUSW FAX_JOB_STATUS;
  2340. typedef PFAX_JOB_STATUSW PFAX_JOB_STATUS;
  2341. #else
  2342. typedef FAX_JOB_STATUSA FAX_JOB_STATUS;
  2343. typedef PFAX_JOB_STATUSA PFAX_JOB_STATUS;
  2344. #endif // UNICODE
  2345. typedef struct _FAX_JOB_ENTRY_EXA
  2346. {
  2347. DWORD dwSizeOfStruct;
  2348. DWORD dwValidityMask;
  2349. DWORDLONG dwlMessageId;
  2350. DWORDLONG dwlBroadcastId;
  2351. LPCSTR lpctstrRecipientNumber;
  2352. LPCSTR lpctstrRecipientName;
  2353. LPCSTR lpctstrSenderUserName;
  2354. LPCSTR lpctstrBillingCode;
  2355. SYSTEMTIME tmOriginalScheduleTime;
  2356. SYSTEMTIME tmSubmissionTime;
  2357. FAX_ENUM_PRIORITY_TYPE Priority;
  2358. DWORD dwDeliveryReportType;
  2359. LPCSTR lpctstrDocumentName;
  2360. LPCSTR lpctstrSubject;
  2361. PFAX_JOB_STATUSA pStatus;
  2362. } FAX_JOB_ENTRY_EXA, *PFAX_JOB_ENTRY_EXA;
  2363. typedef struct _FAX_JOB_ENTRY_EXW
  2364. {
  2365. DWORD dwSizeOfStruct;
  2366. DWORD dwValidityMask;
  2367. DWORDLONG dwlMessageId;
  2368. DWORDLONG dwlBroadcastId;
  2369. LPCWSTR lpctstrRecipientNumber;
  2370. LPCWSTR lpctstrRecipientName;
  2371. LPCWSTR lpctstrSenderUserName;
  2372. LPCWSTR lpctstrBillingCode;
  2373. SYSTEMTIME tmOriginalScheduleTime;
  2374. SYSTEMTIME tmSubmissionTime;
  2375. FAX_ENUM_PRIORITY_TYPE Priority;
  2376. DWORD dwDeliveryReportType;
  2377. LPCWSTR lpctstrDocumentName;
  2378. LPCWSTR lpctstrSubject;
  2379. PFAX_JOB_STATUSW pStatus;
  2380. } FAX_JOB_ENTRY_EXW, *PFAX_JOB_ENTRY_EXW;
  2381. #ifdef UNICODE
  2382. typedef FAX_JOB_ENTRY_EXW FAX_JOB_ENTRY_EX;
  2383. typedef PFAX_JOB_ENTRY_EXW PFAX_JOB_ENTRY_EX;
  2384. #else
  2385. typedef FAX_JOB_ENTRY_EXA FAX_JOB_ENTRY_EX;
  2386. typedef PFAX_JOB_ENTRY_EXA PFAX_JOB_ENTRY_EX;
  2387. #endif // UNICODE
  2388. typedef struct _FAX_JOB_PARAM_EXA
  2389. {
  2390. DWORD dwSizeOfStruct;
  2391. DWORD dwScheduleAction;
  2392. SYSTEMTIME tmSchedule;
  2393. DWORD dwReceiptDeliveryType;
  2394. LPSTR lptstrReceiptDeliveryAddress;
  2395. FAX_ENUM_PRIORITY_TYPE Priority;
  2396. HCALL hCall;
  2397. DWORD_PTR dwReserved[4];
  2398. LPSTR lptstrDocumentName;
  2399. DWORD dwPageCount;
  2400. } FAX_JOB_PARAM_EXA, *PFAX_JOB_PARAM_EXA;
  2401. typedef struct _FAX_JOB_PARAM_EXW
  2402. {
  2403. DWORD dwSizeOfStruct;
  2404. DWORD dwScheduleAction;
  2405. SYSTEMTIME tmSchedule;
  2406. DWORD dwReceiptDeliveryType;
  2407. LPWSTR lptstrReceiptDeliveryAddress;
  2408. FAX_ENUM_PRIORITY_TYPE Priority;
  2409. HCALL hCall;
  2410. DWORD_PTR dwReserved[4];
  2411. LPWSTR lptstrDocumentName;
  2412. DWORD dwPageCount;
  2413. } FAX_JOB_PARAM_EXW, *PFAX_JOB_PARAM_EXW;
  2414. #ifdef UNICODE
  2415. typedef FAX_JOB_PARAM_EXW FAX_JOB_PARAM_EX;
  2416. typedef PFAX_JOB_PARAM_EXW PFAX_JOB_PARAM_EX;
  2417. #else
  2418. typedef FAX_JOB_PARAM_EXA FAX_JOB_PARAM_EX;
  2419. typedef PFAX_JOB_PARAM_EXA PFAX_JOB_PARAM_EX;
  2420. #endif // UNICODE
  2421. WINFAXAPI
  2422. BOOL
  2423. WINAPI FaxEnumJobsExA (
  2424. IN HANDLE hFaxHandle,
  2425. IN DWORD dwJobTypes,
  2426. OUT PFAX_JOB_ENTRY_EXA *ppJobEntries,
  2427. OUT LPDWORD lpdwJobs
  2428. );
  2429. WINFAXAPI
  2430. BOOL
  2431. WINAPI FaxEnumJobsExW (
  2432. IN HANDLE hFaxHandle,
  2433. IN DWORD dwJobTypes,
  2434. OUT PFAX_JOB_ENTRY_EXW *ppJobEntries,
  2435. OUT LPDWORD lpdwJobs
  2436. );
  2437. #ifdef UNICODE
  2438. #define FaxEnumJobsEx FaxEnumJobsExW
  2439. #else
  2440. #define FaxEnumJobsEx FaxEnumJobsExA
  2441. #endif // !UNICODE
  2442. WINFAXAPI
  2443. BOOL
  2444. WINAPI
  2445. FaxGetJobExA (
  2446. IN HANDLE hFaxHandle,
  2447. IN DWORDLONG dwlMessageID,
  2448. OUT PFAX_JOB_ENTRY_EXA *ppJobEntry
  2449. );
  2450. WINFAXAPI
  2451. BOOL
  2452. WINAPI
  2453. FaxGetJobExW (
  2454. IN HANDLE hFaxHandle,
  2455. IN DWORDLONG dwlMessageID,
  2456. OUT PFAX_JOB_ENTRY_EXW *ppJobEntry
  2457. );
  2458. #ifdef UNICODE
  2459. #define FaxGetJobEx FaxGetJobExW
  2460. #else
  2461. #define FaxGetJobEx FaxGetJobExA
  2462. #endif // !UNICODE
  2463. typedef const FAX_JOB_PARAM_EXW * LPCFAX_JOB_PARAM_EXW;
  2464. typedef const FAX_JOB_PARAM_EXA * LPCFAX_JOB_PARAM_EXA;
  2465. #ifdef UNICODE
  2466. typedef LPCFAX_JOB_PARAM_EXW LPCFAX_JOB_PARAM_EX;
  2467. #else
  2468. typedef LPCFAX_JOB_PARAM_EXA LPCFAX_JOB_PARAM_EX;
  2469. #endif
  2470. typedef enum
  2471. {
  2472. FAX_COVERPAGE_FMT_COV = 1,
  2473. FAX_COVERPAGE_FMT_COV_SUBJECT_ONLY
  2474. } FAX_ENUM_COVERPAGE_FORMATS;
  2475. typedef struct _FAX_COVERPAGE_INFO_EXA
  2476. {
  2477. DWORD dwSizeOfStruct;
  2478. DWORD dwCoverPageFormat;
  2479. LPSTR lptstrCoverPageFileName;
  2480. BOOL bServerBased;
  2481. LPSTR lptstrNote;
  2482. LPSTR lptstrSubject;
  2483. } FAX_COVERPAGE_INFO_EXA, *PFAX_COVERPAGE_INFO_EXA;
  2484. typedef struct _FAX_COVERPAGE_INFO_EXW
  2485. {
  2486. DWORD dwSizeOfStruct;
  2487. DWORD dwCoverPageFormat;
  2488. LPWSTR lptstrCoverPageFileName;
  2489. BOOL bServerBased;
  2490. LPWSTR lptstrNote;
  2491. LPWSTR lptstrSubject;
  2492. } FAX_COVERPAGE_INFO_EXW, *PFAX_COVERPAGE_INFO_EXW;
  2493. #ifdef UNICODE
  2494. typedef FAX_COVERPAGE_INFO_EXW FAX_COVERPAGE_INFO_EX;
  2495. typedef PFAX_COVERPAGE_INFO_EXW PFAX_COVERPAGE_INFO_EX;
  2496. #else
  2497. typedef FAX_COVERPAGE_INFO_EXA FAX_COVERPAGE_INFO_EX;
  2498. typedef PFAX_COVERPAGE_INFO_EXA PFAX_COVERPAGE_INFO_EX;
  2499. #endif // UNICODE
  2500. typedef const FAX_COVERPAGE_INFO_EXW * LPCFAX_COVERPAGE_INFO_EXW;
  2501. typedef const FAX_COVERPAGE_INFO_EXA * LPCFAX_COVERPAGE_INFO_EXA;
  2502. #ifdef UNICODE
  2503. typedef LPCFAX_COVERPAGE_INFO_EXW LPCFAX_COVERPAGE_INFO_EX;
  2504. #else
  2505. typedef LPCFAX_COVERPAGE_INFO_EXA LPCFAX_COVERPAGE_INFO_EX;
  2506. #endif
  2507. typedef struct _FAX_PERSONAL_PROFILEA
  2508. {
  2509. DWORD dwSizeOfStruct; // Size of this structure
  2510. LPSTR lptstrName; // Name of person
  2511. LPSTR lptstrFaxNumber; // Fax number
  2512. LPSTR lptstrCompany; // Company name
  2513. LPSTR lptstrStreetAddress; // Street address
  2514. LPSTR lptstrCity; // City
  2515. LPSTR lptstrState; // State
  2516. LPSTR lptstrZip; // Zip code
  2517. LPSTR lptstrCountry; // Country
  2518. LPSTR lptstrTitle; // Title
  2519. LPSTR lptstrDepartment; // Department
  2520. LPSTR lptstrOfficeLocation; // Office location
  2521. LPSTR lptstrHomePhone; // Phone number at home
  2522. LPSTR lptstrOfficePhone; // Phone number at office
  2523. LPSTR lptstrEmail; // Personal e-mail address
  2524. LPSTR lptstrBillingCode; // Billing code
  2525. LPSTR lptstrTSID; // Tsid
  2526. } FAX_PERSONAL_PROFILEA, *PFAX_PERSONAL_PROFILEA;
  2527. typedef struct _FAX_PERSONAL_PROFILEW
  2528. {
  2529. DWORD dwSizeOfStruct; // Size of this structure
  2530. LPWSTR lptstrName; // Name of person
  2531. LPWSTR lptstrFaxNumber; // Fax number
  2532. LPWSTR lptstrCompany; // Company name
  2533. LPWSTR lptstrStreetAddress; // Street address
  2534. LPWSTR lptstrCity; // City
  2535. LPWSTR lptstrState; // State
  2536. LPWSTR lptstrZip; // Zip code
  2537. LPWSTR lptstrCountry; // Country
  2538. LPWSTR lptstrTitle; // Title
  2539. LPWSTR lptstrDepartment; // Department
  2540. LPWSTR lptstrOfficeLocation; // Office location
  2541. LPWSTR lptstrHomePhone; // Phone number at home
  2542. LPWSTR lptstrOfficePhone; // Phone number at office
  2543. LPWSTR lptstrEmail; // Personal e-mail address
  2544. LPWSTR lptstrBillingCode; // Billing code
  2545. LPWSTR lptstrTSID; // Tsid
  2546. } FAX_PERSONAL_PROFILEW, *PFAX_PERSONAL_PROFILEW;
  2547. #ifdef UNICODE
  2548. typedef FAX_PERSONAL_PROFILEW FAX_PERSONAL_PROFILE;
  2549. typedef PFAX_PERSONAL_PROFILEW PFAX_PERSONAL_PROFILE;
  2550. #else
  2551. typedef FAX_PERSONAL_PROFILEA FAX_PERSONAL_PROFILE;
  2552. typedef PFAX_PERSONAL_PROFILEA PFAX_PERSONAL_PROFILE;
  2553. #endif // UNICODE
  2554. typedef const FAX_PERSONAL_PROFILEW * LPCFAX_PERSONAL_PROFILEW;
  2555. typedef const FAX_PERSONAL_PROFILEA * LPCFAX_PERSONAL_PROFILEA;
  2556. #ifdef UNICODE
  2557. typedef LPCFAX_PERSONAL_PROFILEW LPCFAX_PERSONAL_PROFILE;
  2558. #else
  2559. typedef LPCFAX_PERSONAL_PROFILEA LPCFAX_PERSONAL_PROFILE;
  2560. #endif
  2561. BOOL WINAPI FaxSendDocumentExA
  2562. (
  2563. IN HANDLE hFaxHandle,
  2564. IN LPCSTR lpctstrFileName,
  2565. IN LPCFAX_COVERPAGE_INFO_EXA lpcCoverPageInfo,
  2566. IN LPCFAX_PERSONAL_PROFILEA lpcSenderProfile,
  2567. IN DWORD dwNumRecipients,
  2568. IN LPCFAX_PERSONAL_PROFILEA lpcRecipientList,
  2569. IN LPCFAX_JOB_PARAM_EXA lpJobParams,
  2570. OUT PDWORDLONG lpdwlMessageId,
  2571. OUT PDWORDLONG lpdwlRecipientMessageIds
  2572. );
  2573. BOOL WINAPI FaxSendDocumentExW
  2574. (
  2575. IN HANDLE hFaxHandle,
  2576. IN LPCWSTR lpctstrFileName,
  2577. IN LPCFAX_COVERPAGE_INFO_EXW lpcCoverPageInfo,
  2578. IN LPCFAX_PERSONAL_PROFILEW lpcSenderProfile,
  2579. IN DWORD dwNumRecipients,
  2580. IN LPCFAX_PERSONAL_PROFILEW lpcRecipientList,
  2581. IN LPCFAX_JOB_PARAM_EXW lpJobParams,
  2582. OUT PDWORDLONG lpdwlMessageId,
  2583. OUT PDWORDLONG lpdwlRecipientMessageIds
  2584. );
  2585. #ifdef UNICODE
  2586. #define FaxSendDocumentEx FaxSendDocumentExW
  2587. #else
  2588. #define FaxSendDocumentEx FaxSendDocumentExA
  2589. #endif // !UNICODE
  2590. typedef BOOL
  2591. (WINAPI *PFAXSENDDOCUMENTEXA)(
  2592. IN HANDLE hFaxHandle,
  2593. IN LPCSTR lpctstrFileName,
  2594. IN LPCFAX_COVERPAGE_INFO_EXA lpcCoverPageInfo,
  2595. IN LPCFAX_PERSONAL_PROFILEA lpcSenderProfile,
  2596. IN DWORD dwNumRecipients,
  2597. IN LPCFAX_PERSONAL_PROFILEA lpcRecipientList,
  2598. IN LPCFAX_JOB_PARAM_EXA lpcJobParams,
  2599. OUT PDWORDLONG lpdwlMessageId,
  2600. OUT PDWORDLONG lpdwlRecipientMessageIds
  2601. );
  2602. typedef BOOL
  2603. (WINAPI *PFAXSENDDOCUMENTEXW)(
  2604. IN HANDLE hFaxHandle,
  2605. IN LPCWSTR lpctstrFileName,
  2606. IN LPCFAX_COVERPAGE_INFO_EXW lpcCoverPageInfo,
  2607. IN LPCFAX_PERSONAL_PROFILEW lpcSenderProfile,
  2608. IN DWORD dwNumRecipients,
  2609. IN LPCFAX_PERSONAL_PROFILEW lpcRecipientList,
  2610. IN LPCFAX_JOB_PARAM_EXW lpcJobParams,
  2611. OUT PDWORDLONG lpdwlMessageId,
  2612. OUT PDWORDLONG lpdwlRecipientMessageIds
  2613. );
  2614. #ifdef UNICODE
  2615. #define PFAXSENDDOCUMENTEX PFAXSENDDOCUMENTEXW
  2616. #else
  2617. #define PFAXSENDDOCUMENTEX PFAXSENDDOCUMENTEXA
  2618. #endif // !UNICODE
  2619. //********************************************
  2620. //* Archive jobs
  2621. //********************************************
  2622. typedef struct _FAX_MESSAGEA
  2623. {
  2624. DWORD dwSizeOfStruct;
  2625. DWORD dwValidityMask;
  2626. DWORDLONG dwlMessageId;
  2627. DWORDLONG dwlBroadcastId;
  2628. DWORD dwJobType;
  2629. DWORD dwQueueStatus;
  2630. DWORD dwExtendedStatus;
  2631. LPCSTR lpctstrExtendedStatus;
  2632. DWORD dwSize;
  2633. DWORD dwPageCount;
  2634. LPCSTR lpctstrRecipientNumber;
  2635. LPCSTR lpctstrRecipientName;
  2636. LPCSTR lpctstrSenderNumber;
  2637. LPCSTR lpctstrSenderName;
  2638. LPCSTR lpctstrTsid;
  2639. LPCSTR lpctstrCsid;
  2640. LPCSTR lpctstrSenderUserName;
  2641. LPCSTR lpctstrBillingCode;
  2642. SYSTEMTIME tmOriginalScheduleTime;
  2643. SYSTEMTIME tmSubmissionTime;
  2644. SYSTEMTIME tmTransmissionStartTime;
  2645. SYSTEMTIME tmTransmissionEndTime;
  2646. LPCSTR lpctstrDeviceName;
  2647. FAX_ENUM_PRIORITY_TYPE Priority;
  2648. DWORD dwRetries;
  2649. LPCSTR lpctstrDocumentName;
  2650. LPCSTR lpctstrSubject;
  2651. LPCSTR lpctstrCallerID;
  2652. LPCSTR lpctstrRoutingInfo;
  2653. } FAX_MESSAGEA, *PFAX_MESSAGEA;
  2654. typedef struct _FAX_MESSAGEW
  2655. {
  2656. DWORD dwSizeOfStruct;
  2657. DWORD dwValidityMask;
  2658. DWORDLONG dwlMessageId;
  2659. DWORDLONG dwlBroadcastId;
  2660. DWORD dwJobType;
  2661. DWORD dwQueueStatus;
  2662. DWORD dwExtendedStatus;
  2663. LPCWSTR lpctstrExtendedStatus;
  2664. DWORD dwSize;
  2665. DWORD dwPageCount;
  2666. LPCWSTR lpctstrRecipientNumber;
  2667. LPCWSTR lpctstrRecipientName;
  2668. LPCWSTR lpctstrSenderNumber;
  2669. LPCWSTR lpctstrSenderName;
  2670. LPCWSTR lpctstrTsid;
  2671. LPCWSTR lpctstrCsid;
  2672. LPCWSTR lpctstrSenderUserName;
  2673. LPCWSTR lpctstrBillingCode;
  2674. SYSTEMTIME tmOriginalScheduleTime;
  2675. SYSTEMTIME tmSubmissionTime;
  2676. SYSTEMTIME tmTransmissionStartTime;
  2677. SYSTEMTIME tmTransmissionEndTime;
  2678. LPCWSTR lpctstrDeviceName;
  2679. FAX_ENUM_PRIORITY_TYPE Priority;
  2680. DWORD dwRetries;
  2681. LPCWSTR lpctstrDocumentName;
  2682. LPCWSTR lpctstrSubject;
  2683. LPCWSTR lpctstrCallerID;
  2684. LPCWSTR lpctstrRoutingInfo;
  2685. } FAX_MESSAGEW, *PFAX_MESSAGEW;
  2686. #ifdef UNICODE
  2687. typedef FAX_MESSAGEW FAX_MESSAGE;
  2688. typedef PFAX_MESSAGEW PFAX_MESSAGE;
  2689. #else
  2690. typedef FAX_MESSAGEA FAX_MESSAGE;
  2691. typedef PFAX_MESSAGEA PFAX_MESSAGE;
  2692. #endif // UNICODE
  2693. WINFAXAPI
  2694. BOOL
  2695. WINAPI
  2696. FaxStartMessagesEnum (
  2697. IN HANDLE hFaxHandle,
  2698. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2699. OUT PHANDLE phEnum
  2700. );
  2701. WINFAXAPI
  2702. BOOL
  2703. WINAPI
  2704. FaxEndMessagesEnum (
  2705. IN HANDLE hEnum
  2706. );
  2707. WINFAXAPI
  2708. BOOL
  2709. WINAPI
  2710. FaxEnumMessagesA (
  2711. IN HANDLE hEnum,
  2712. IN DWORD dwNumMessages,
  2713. OUT PFAX_MESSAGEA *ppMsgs,
  2714. OUT LPDWORD lpdwReturnedMsgs
  2715. );
  2716. WINFAXAPI
  2717. BOOL
  2718. WINAPI
  2719. FaxEnumMessagesW (
  2720. IN HANDLE hEnum,
  2721. IN DWORD dwNumMessages,
  2722. OUT PFAX_MESSAGEW *ppMsgs,
  2723. OUT LPDWORD lpdwReturnedMsgs
  2724. );
  2725. #ifdef UNICODE
  2726. #define FaxEnumMessages FaxEnumMessagesW
  2727. #else
  2728. #define FaxEnumMessages FaxEnumMessagesA
  2729. #endif // !UNICODE
  2730. WINFAXAPI
  2731. BOOL
  2732. WINAPI
  2733. FaxGetMessageA (
  2734. IN HANDLE hFaxHandle,
  2735. IN DWORDLONG dwlMessageId,
  2736. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2737. OUT PFAX_MESSAGEA *ppMsg
  2738. );
  2739. WINFAXAPI
  2740. BOOL
  2741. WINAPI
  2742. FaxGetMessageW (
  2743. IN HANDLE hFaxHandle,
  2744. IN DWORDLONG dwlMessageId,
  2745. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2746. OUT PFAX_MESSAGEW *ppMsg
  2747. );
  2748. #ifdef UNICODE
  2749. #define FaxGetMessage FaxGetMessageW
  2750. #else
  2751. #define FaxGetMessage FaxGetMessageA
  2752. #endif // !UNICODE
  2753. WINFAXAPI
  2754. BOOL
  2755. WINAPI
  2756. FaxRemoveMessage (
  2757. IN HANDLE hFaxHandle,
  2758. IN DWORDLONG dwlMessageId,
  2759. IN FAX_ENUM_MESSAGE_FOLDER Folder
  2760. );
  2761. WINFAXAPI
  2762. BOOL
  2763. WINAPI
  2764. FaxGetMessageTiffA (
  2765. IN HANDLE hFaxHandle,
  2766. IN DWORDLONG dwlMessageId,
  2767. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2768. IN LPCSTR lpctstrFilePath
  2769. );
  2770. WINFAXAPI
  2771. BOOL
  2772. WINAPI
  2773. FaxGetMessageTiffW (
  2774. IN HANDLE hFaxHandle,
  2775. IN DWORDLONG dwlMessageId,
  2776. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  2777. IN LPCWSTR lpctstrFilePath
  2778. );
  2779. #ifdef UNICODE
  2780. #define FaxGetMessageTiff FaxGetMessageTiffW
  2781. #else
  2782. #define FaxGetMessageTiff FaxGetMessageTiffA
  2783. #endif // !UNICODE
  2784. //************************************
  2785. //* Non-RPC extended interfaces
  2786. //************************************
  2787. HRESULT WINAPI
  2788. FaxFreeSenderInformation(
  2789. PFAX_PERSONAL_PROFILE pfppSender
  2790. );
  2791. HRESULT WINAPI
  2792. FaxSetSenderInformation(
  2793. PFAX_PERSONAL_PROFILE pfppSender
  2794. );
  2795. HRESULT WINAPI
  2796. FaxGetSenderInformation(
  2797. PFAX_PERSONAL_PROFILE pfppSender
  2798. );
  2799. //********************************************
  2800. //* Security
  2801. //********************************************
  2802. //
  2803. // Specific access rights
  2804. //
  2805. typedef enum
  2806. {
  2807. FAX_ACCESS_SUBMIT = 0x0001,
  2808. FAX_ACCESS_SUBMIT_NORMAL = 0x0002,
  2809. FAX_ACCESS_SUBMIT_HIGH = 0x0004,
  2810. FAX_ACCESS_QUERY_JOBS = 0x0008,
  2811. FAX_ACCESS_MANAGE_JOBS = 0x0010,
  2812. FAX_ACCESS_QUERY_CONFIG = 0x0020,
  2813. FAX_ACCESS_MANAGE_CONFIG = 0x0040,
  2814. FAX_ACCESS_QUERY_IN_ARCHIVE = 0x0080,
  2815. FAX_ACCESS_MANAGE_IN_ARCHIVE = 0x0100,
  2816. FAX_ACCESS_QUERY_OUT_ARCHIVE = 0x0200,
  2817. FAX_ACCESS_MANAGE_OUT_ARCHIVE = 0x0400
  2818. } FAX_SPECIFIC_ACCESS_RIGHTS;
  2819. #define FAX_GENERIC_READ (FAX_ACCESS_QUERY_JOBS | FAX_ACCESS_QUERY_CONFIG | FAX_ACCESS_QUERY_IN_ARCHIVE | FAX_ACCESS_QUERY_OUT_ARCHIVE)
  2820. #define FAX_GENERIC_WRITE (FAX_ACCESS_MANAGE_JOBS | FAX_ACCESS_MANAGE_CONFIG | FAX_ACCESS_MANAGE_IN_ARCHIVE | FAX_ACCESS_MANAGE_OUT_ARCHIVE)
  2821. #define FAX_GENERIC_EXECUTE (FAX_ACCESS_SUBMIT)
  2822. #define FAX_GENERIC_ALL (FAX_ACCESS_SUBMIT | \
  2823. FAX_ACCESS_SUBMIT_NORMAL | \
  2824. FAX_ACCESS_SUBMIT_HIGH | \
  2825. FAX_ACCESS_QUERY_JOBS | \
  2826. FAX_ACCESS_MANAGE_JOBS | \
  2827. FAX_ACCESS_QUERY_CONFIG | \
  2828. FAX_ACCESS_MANAGE_CONFIG | \
  2829. FAX_ACCESS_QUERY_IN_ARCHIVE | \
  2830. FAX_ACCESS_MANAGE_IN_ARCHIVE | \
  2831. FAX_ACCESS_QUERY_OUT_ARCHIVE | \
  2832. FAX_ACCESS_MANAGE_OUT_ARCHIVE)
  2833. //
  2834. // Functions
  2835. //
  2836. //********************************************
  2837. //* Security
  2838. //********************************************
  2839. WINFAXAPI
  2840. BOOL
  2841. WINAPI
  2842. FaxGetSecurity (
  2843. IN HANDLE hFaxHandle,
  2844. OUT PSECURITY_DESCRIPTOR *ppSecDesc
  2845. );
  2846. WINFAXAPI
  2847. BOOL
  2848. WINAPI
  2849. FaxGetSecurityEx (
  2850. IN HANDLE hFaxHandle,
  2851. IN SECURITY_INFORMATION SecurityInformation,
  2852. OUT PSECURITY_DESCRIPTOR *ppSecDesc
  2853. );
  2854. WINFAXAPI
  2855. BOOL
  2856. WINAPI
  2857. FaxSetSecurity (
  2858. IN HANDLE hFaxHandle,
  2859. IN SECURITY_INFORMATION SecurityInformation,
  2860. IN CONST PSECURITY_DESCRIPTOR pSecDesc
  2861. );
  2862. WINFAXAPI
  2863. BOOL
  2864. WINAPI
  2865. FaxAccessCheckEx (
  2866. IN HANDLE FaxHandle,
  2867. IN DWORD AccessMask,
  2868. OUT LPDWORD lpdwRights
  2869. );
  2870. //********************************************
  2871. //* Extension data
  2872. //********************************************
  2873. WINFAXAPI
  2874. BOOL
  2875. WINAPI
  2876. FaxGetExtensionDataA (
  2877. IN HANDLE hFaxHandle,
  2878. IN DWORD dwDeviceID,
  2879. IN LPCSTR lpctstrNameGUID,
  2880. OUT PVOID *ppData,
  2881. OUT LPDWORD lpdwDataSize
  2882. );
  2883. WINFAXAPI
  2884. BOOL
  2885. WINAPI
  2886. FaxGetExtensionDataW (
  2887. IN HANDLE hFaxHandle,
  2888. IN DWORD dwDeviceID,
  2889. IN LPCWSTR lpctstrNameGUID,
  2890. OUT PVOID *ppData,
  2891. OUT LPDWORD lpdwDataSize
  2892. );
  2893. #ifdef UNICODE
  2894. #define FaxGetExtensionData FaxGetExtensionDataW
  2895. #else
  2896. #define FaxGetExtensionData FaxGetExtensionDataA
  2897. #endif // !UNICODE
  2898. WINFAXAPI
  2899. BOOL
  2900. WINAPI
  2901. FaxSetExtensionDataA (
  2902. IN HANDLE hFaxHandle,
  2903. IN DWORD dwDeviceID,
  2904. IN LPCSTR lpctstrNameGUID,
  2905. IN CONST PVOID pData,
  2906. IN CONST DWORD dwDataSize
  2907. );
  2908. WINFAXAPI
  2909. BOOL
  2910. WINAPI
  2911. FaxSetExtensionDataW (
  2912. IN HANDLE hFaxHandle,
  2913. IN DWORD dwDeviceID,
  2914. IN LPCWSTR lpctstrNameGUID,
  2915. IN CONST PVOID pData,
  2916. IN CONST DWORD dwDataSize
  2917. );
  2918. #ifdef UNICODE
  2919. #define FaxSetExtensionData FaxSetExtensionDataW
  2920. #else
  2921. #define FaxSetExtensionData FaxSetExtensionDataA
  2922. #endif // !UNICODE
  2923. //********************************************
  2924. //* FSP
  2925. //********************************************
  2926. typedef enum
  2927. {
  2928. FAX_PROVIDER_STATUS_SUCCESS, // Provider was successfully loaded
  2929. FAX_PROVIDER_STATUS_SERVER_ERROR,// An error occured on the server while loading provider.
  2930. FAX_PROVIDER_STATUS_BAD_GUID, // Provider's GUID is invalid
  2931. FAX_PROVIDER_STATUS_BAD_VERSION, // Provider's API version is invalid
  2932. FAX_PROVIDER_STATUS_CANT_LOAD, // Can't load provider's DLL
  2933. FAX_PROVIDER_STATUS_CANT_LINK, // Can't find required exported function(s) in provider's DLL
  2934. FAX_PROVIDER_STATUS_CANT_INIT // Failed while initializing provider
  2935. } FAX_ENUM_PROVIDER_STATUS;
  2936. typedef struct _FAX_DEVICE_PROVIDER_INFOA
  2937. {
  2938. DWORD dwSizeOfStruct;
  2939. LPCSTR lpctstrFriendlyName;
  2940. LPCSTR lpctstrImageName;
  2941. LPCSTR lpctstrProviderName;
  2942. LPCSTR lpctstrGUID;
  2943. DWORD dwCapabilities;
  2944. FAX_VERSION Version;
  2945. FAX_ENUM_PROVIDER_STATUS Status;
  2946. DWORD dwLastError;
  2947. } FAX_DEVICE_PROVIDER_INFOA, *PFAX_DEVICE_PROVIDER_INFOA;
  2948. typedef struct _FAX_DEVICE_PROVIDER_INFOW
  2949. {
  2950. DWORD dwSizeOfStruct;
  2951. LPCWSTR lpctstrFriendlyName;
  2952. LPCWSTR lpctstrImageName;
  2953. LPCWSTR lpctstrProviderName;
  2954. LPCWSTR lpctstrGUID;
  2955. DWORD dwCapabilities;
  2956. FAX_VERSION Version;
  2957. FAX_ENUM_PROVIDER_STATUS Status;
  2958. DWORD dwLastError;
  2959. } FAX_DEVICE_PROVIDER_INFOW, *PFAX_DEVICE_PROVIDER_INFOW;
  2960. #ifdef UNICODE
  2961. typedef FAX_DEVICE_PROVIDER_INFOW FAX_DEVICE_PROVIDER_INFO;
  2962. typedef PFAX_DEVICE_PROVIDER_INFOW PFAX_DEVICE_PROVIDER_INFO;
  2963. #else
  2964. typedef FAX_DEVICE_PROVIDER_INFOA FAX_DEVICE_PROVIDER_INFO;
  2965. typedef PFAX_DEVICE_PROVIDER_INFOA PFAX_DEVICE_PROVIDER_INFO;
  2966. #endif // UNICODE
  2967. WINFAXAPI
  2968. BOOL
  2969. WINAPI
  2970. FaxEnumerateProvidersA (
  2971. IN HANDLE hFaxHandle,
  2972. OUT PFAX_DEVICE_PROVIDER_INFOA *ppProviders,
  2973. OUT LPDWORD lpdwNumProviders
  2974. );
  2975. WINFAXAPI
  2976. BOOL
  2977. WINAPI
  2978. FaxEnumerateProvidersW (
  2979. IN HANDLE hFaxHandle,
  2980. OUT PFAX_DEVICE_PROVIDER_INFOW *ppProviders,
  2981. OUT LPDWORD lpdwNumProviders
  2982. );
  2983. #ifdef UNICODE
  2984. #define FaxEnumerateProviders FaxEnumerateProvidersW
  2985. #else
  2986. #define FaxEnumerateProviders FaxEnumerateProvidersA
  2987. #endif // !UNICODE
  2988. //********************************************
  2989. //* Routing extensions
  2990. //********************************************
  2991. typedef struct _FAX_ROUTING_EXTENSION_INFOA
  2992. {
  2993. DWORD dwSizeOfStruct;
  2994. LPCSTR lpctstrFriendlyName;
  2995. LPCSTR lpctstrImageName;
  2996. LPCSTR lpctstrExtensionName;
  2997. FAX_VERSION Version;
  2998. FAX_ENUM_PROVIDER_STATUS Status;
  2999. DWORD dwLastError;
  3000. } FAX_ROUTING_EXTENSION_INFOA, *PFAX_ROUTING_EXTENSION_INFOA;
  3001. typedef struct _FAX_ROUTING_EXTENSION_INFOW
  3002. {
  3003. DWORD dwSizeOfStruct;
  3004. LPCWSTR lpctstrFriendlyName;
  3005. LPCWSTR lpctstrImageName;
  3006. LPCWSTR lpctstrExtensionName;
  3007. FAX_VERSION Version;
  3008. FAX_ENUM_PROVIDER_STATUS Status;
  3009. DWORD dwLastError;
  3010. } FAX_ROUTING_EXTENSION_INFOW, *PFAX_ROUTING_EXTENSION_INFOW;
  3011. #ifdef UNICODE
  3012. typedef FAX_ROUTING_EXTENSION_INFOW FAX_ROUTING_EXTENSION_INFO;
  3013. typedef PFAX_ROUTING_EXTENSION_INFOW PFAX_ROUTING_EXTENSION_INFO;
  3014. #else
  3015. typedef FAX_ROUTING_EXTENSION_INFOA FAX_ROUTING_EXTENSION_INFO;
  3016. typedef PFAX_ROUTING_EXTENSION_INFOA PFAX_ROUTING_EXTENSION_INFO;
  3017. #endif // UNICODE
  3018. WINFAXAPI
  3019. BOOL
  3020. WINAPI
  3021. FaxEnumRoutingExtensionsA (
  3022. IN HANDLE hFaxHandle,
  3023. OUT PFAX_ROUTING_EXTENSION_INFOA *ppRoutingExtensions,
  3024. OUT LPDWORD lpdwNumExtensions
  3025. );
  3026. WINFAXAPI
  3027. BOOL
  3028. WINAPI
  3029. FaxEnumRoutingExtensionsW (
  3030. IN HANDLE hFaxHandle,
  3031. OUT PFAX_ROUTING_EXTENSION_INFOW *ppRoutingExtensions,
  3032. OUT LPDWORD lpdwNumExtensions
  3033. );
  3034. #ifdef UNICODE
  3035. #define FaxEnumRoutingExtensions FaxEnumRoutingExtensionsW
  3036. #else
  3037. #define FaxEnumRoutingExtensions FaxEnumRoutingExtensionsA
  3038. #endif // !UNICODE
  3039. //********************************************
  3040. //* Ports
  3041. //********************************************
  3042. typedef enum
  3043. {
  3044. FAX_DEVICE_STATUS_POWERED_OFF = 0x0001,
  3045. FAX_DEVICE_STATUS_SENDING = 0x0002,
  3046. FAX_DEVICE_STATUS_RECEIVING = 0x0004,
  3047. FAX_DEVICE_STATUS_RINGING = 0x0008
  3048. } FAX_ENUM_DEVICE_STATUS;
  3049. typedef enum
  3050. {
  3051. FAX_DEVICE_RECEIVE_MODE_OFF = 0, // Do not answer to incoming calls
  3052. FAX_DEVICE_RECEIVE_MODE_AUTO = 1, // Automatically answer to incoming calls after dwRings rings
  3053. FAX_DEVICE_RECEIVE_MODE_MANUAL = 2 // Manually answer to incoming calls - only FaxAnswerCall answers the call
  3054. } FAX_ENUM_DEVICE_RECEIVE_MODE;
  3055. typedef struct _FAX_PORT_INFO_EXA
  3056. {
  3057. DWORD dwSizeOfStruct; // For versioning
  3058. DWORD dwDeviceID; // Fax id
  3059. LPCSTR lpctstrDeviceName; // Name of the device
  3060. LPSTR lptstrDescription; // Descriptive string
  3061. LPCSTR lpctstrProviderName; // FSP's name
  3062. LPCSTR lpctstrProviderGUID; // FSP's GUID
  3063. BOOL bSend; // Is the device send-enabled?
  3064. FAX_ENUM_DEVICE_RECEIVE_MODE ReceiveMode; // The device receive mode. See FAX_ENUM_DEVICE_RECEIVE_MODE for details.
  3065. DWORD dwStatus; // Device status - a combination of values from FAX_ENUM_DEVICE_STATUS
  3066. DWORD dwRings; // Number of rings before answering an incoming call
  3067. LPSTR lptstrCsid; // Called Station Id
  3068. LPSTR lptstrTsid; // Transmitting Station Id
  3069. } FAX_PORT_INFO_EXA, *PFAX_PORT_INFO_EXA;
  3070. typedef struct _FAX_PORT_INFO_EXW
  3071. {
  3072. DWORD dwSizeOfStruct; // For versioning
  3073. DWORD dwDeviceID; // Fax id
  3074. LPCWSTR lpctstrDeviceName; // Name of the device
  3075. LPWSTR lptstrDescription; // Descriptive string
  3076. LPCWSTR lpctstrProviderName; // FSP's name
  3077. LPCWSTR lpctstrProviderGUID; // FSP's GUID
  3078. BOOL bSend; // Is the device send-enabled?
  3079. FAX_ENUM_DEVICE_RECEIVE_MODE ReceiveMode; // The device receive mode. See FAX_ENUM_DEVICE_RECEIVE_MODE for details.
  3080. DWORD dwStatus; // Device status - a combination of values from FAX_ENUM_DEVICE_STATUS
  3081. DWORD dwRings; // Number of rings before answering an incoming call
  3082. LPWSTR lptstrCsid; // Called Station Id
  3083. LPWSTR lptstrTsid; // Transmitting Station Id
  3084. } FAX_PORT_INFO_EXW, *PFAX_PORT_INFO_EXW;
  3085. #ifdef UNICODE
  3086. typedef FAX_PORT_INFO_EXW FAX_PORT_INFO_EX;
  3087. typedef PFAX_PORT_INFO_EXW PFAX_PORT_INFO_EX;
  3088. #else
  3089. typedef FAX_PORT_INFO_EXA FAX_PORT_INFO_EX;
  3090. typedef PFAX_PORT_INFO_EXA PFAX_PORT_INFO_EX;
  3091. #endif // UNICODE
  3092. WINFAXAPI
  3093. DWORD
  3094. WINAPI
  3095. IsDeviceVirtual (
  3096. IN HANDLE hFaxHandle,
  3097. IN DWORD dwDeviceId,
  3098. OUT LPBOOL lpbVirtual
  3099. );
  3100. WINFAXAPI
  3101. BOOL
  3102. WINAPI
  3103. FaxGetPortExA (
  3104. IN HANDLE hFaxHandle,
  3105. IN DWORD dwDeviceId,
  3106. OUT PFAX_PORT_INFO_EXA *ppPortInfo
  3107. );
  3108. WINFAXAPI
  3109. BOOL
  3110. WINAPI
  3111. FaxGetPortExW (
  3112. IN HANDLE hFaxHandle,
  3113. IN DWORD dwDeviceId,
  3114. OUT PFAX_PORT_INFO_EXW *ppPortInfo
  3115. );
  3116. #ifdef UNICODE
  3117. #define FaxGetPortEx FaxGetPortExW
  3118. #else
  3119. #define FaxGetPortEx FaxGetPortExA
  3120. #endif // !UNICODE
  3121. WINFAXAPI
  3122. BOOL
  3123. WINAPI
  3124. FaxSetPortExA (
  3125. IN HANDLE hFaxHandle,
  3126. IN DWORD dwDeviceId,
  3127. IN PFAX_PORT_INFO_EXA pPortInfo
  3128. );
  3129. WINFAXAPI
  3130. BOOL
  3131. WINAPI
  3132. FaxSetPortExW (
  3133. IN HANDLE hFaxHandle,
  3134. IN DWORD dwDeviceId,
  3135. IN PFAX_PORT_INFO_EXW pPortInfo
  3136. );
  3137. #ifdef UNICODE
  3138. #define FaxSetPortEx FaxSetPortExW
  3139. #else
  3140. #define FaxSetPortEx FaxSetPortExA
  3141. #endif // !UNICODE
  3142. WINFAXAPI
  3143. BOOL
  3144. WINAPI
  3145. FaxEnumPortsExA (
  3146. IN HANDLE hFaxHandle,
  3147. OUT PFAX_PORT_INFO_EXA *ppPorts,
  3148. OUT LPDWORD lpdwNumPorts
  3149. );
  3150. WINFAXAPI
  3151. BOOL
  3152. WINAPI
  3153. FaxEnumPortsExW (
  3154. IN HANDLE hFaxHandle,
  3155. OUT PFAX_PORT_INFO_EXW *ppPorts,
  3156. OUT LPDWORD lpdwNumPorts
  3157. );
  3158. #ifdef UNICODE
  3159. #define FaxEnumPortsEx FaxEnumPortsExW
  3160. #else
  3161. #define FaxEnumPortsEx FaxEnumPortsExA
  3162. #endif // !UNICODE
  3163. //********************************************
  3164. //* Recipient and sender information
  3165. //********************************************
  3166. WINFAXAPI
  3167. BOOL
  3168. WINAPI
  3169. FaxGetRecipientInfoA (
  3170. IN HANDLE hFaxHandle,
  3171. IN DWORDLONG dwlMessageId,
  3172. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  3173. OUT PFAX_PERSONAL_PROFILEA *lpPersonalProfile
  3174. );
  3175. WINFAXAPI
  3176. BOOL
  3177. WINAPI
  3178. FaxGetRecipientInfoW (
  3179. IN HANDLE hFaxHandle,
  3180. IN DWORDLONG dwlMessageId,
  3181. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  3182. OUT PFAX_PERSONAL_PROFILEW *lpPersonalProfile
  3183. );
  3184. #ifdef UNICODE
  3185. #define FaxGetRecipientInfo FaxGetRecipientInfoW
  3186. #else
  3187. #define FaxGetRecipientInfo FaxGetRecipientInfoA
  3188. #endif // !UNICODE
  3189. WINFAXAPI
  3190. BOOL
  3191. WINAPI
  3192. FaxGetSenderInfoA (
  3193. IN HANDLE hFaxHandle,
  3194. IN DWORDLONG dwlMessageId,
  3195. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  3196. OUT PFAX_PERSONAL_PROFILEA *lpPersonalProfile
  3197. );
  3198. WINFAXAPI
  3199. BOOL
  3200. WINAPI
  3201. FaxGetSenderInfoW (
  3202. IN HANDLE hFaxHandle,
  3203. IN DWORDLONG dwlMessageId,
  3204. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  3205. OUT PFAX_PERSONAL_PROFILEW *lpPersonalProfile
  3206. );
  3207. #ifdef UNICODE
  3208. #define FaxGetSenderInfo FaxGetSenderInfoW
  3209. #else
  3210. #define FaxGetSenderInfo FaxGetSenderInfoA
  3211. #endif // !UNICODE
  3212. //********************************************
  3213. //* Outbound routing groups
  3214. //********************************************
  3215. typedef enum
  3216. {
  3217. FAX_GROUP_STATUS_ALL_DEV_VALID,
  3218. FAX_GROUP_STATUS_EMPTY,
  3219. FAX_GROUP_STATUS_ALL_DEV_NOT_VALID,
  3220. FAX_GROUP_STATUS_SOME_DEV_NOT_VALID,
  3221. } FAX_ENUM_GROUP_STATUS;
  3222. typedef struct _FAX_OUTBOUND_ROUTING_GROUPA
  3223. {
  3224. DWORD dwSizeOfStruct;
  3225. LPCSTR lpctstrGroupName;
  3226. DWORD dwNumDevices;
  3227. LPDWORD lpdwDevices;
  3228. FAX_ENUM_GROUP_STATUS Status;
  3229. } FAX_OUTBOUND_ROUTING_GROUPA, *PFAX_OUTBOUND_ROUTING_GROUPA;
  3230. typedef struct _FAX_OUTBOUND_ROUTING_GROUPW
  3231. {
  3232. DWORD dwSizeOfStruct;
  3233. LPCWSTR lpctstrGroupName;
  3234. DWORD dwNumDevices;
  3235. LPDWORD lpdwDevices;
  3236. FAX_ENUM_GROUP_STATUS Status;
  3237. } FAX_OUTBOUND_ROUTING_GROUPW, *PFAX_OUTBOUND_ROUTING_GROUPW;
  3238. #ifdef UNICODE
  3239. typedef FAX_OUTBOUND_ROUTING_GROUPW FAX_OUTBOUND_ROUTING_GROUP;
  3240. typedef PFAX_OUTBOUND_ROUTING_GROUPW PFAX_OUTBOUND_ROUTING_GROUP;
  3241. #else
  3242. typedef FAX_OUTBOUND_ROUTING_GROUPA FAX_OUTBOUND_ROUTING_GROUP;
  3243. typedef PFAX_OUTBOUND_ROUTING_GROUPA PFAX_OUTBOUND_ROUTING_GROUP;
  3244. #endif // UNICODE
  3245. WINFAXAPI
  3246. BOOL
  3247. WINAPI
  3248. FaxEnumOutboundGroupsA (
  3249. IN HANDLE hFaxHandle,
  3250. OUT PFAX_OUTBOUND_ROUTING_GROUPA *ppGroups,
  3251. OUT LPDWORD lpdwNumGroups
  3252. );
  3253. WINFAXAPI
  3254. BOOL
  3255. WINAPI
  3256. FaxEnumOutboundGroupsW (
  3257. IN HANDLE hFaxHandle,
  3258. OUT PFAX_OUTBOUND_ROUTING_GROUPW *ppGroups,
  3259. OUT LPDWORD lpdwNumGroups
  3260. );
  3261. #ifdef UNICODE
  3262. #define FaxEnumOutboundGroups FaxEnumOutboundGroupsW
  3263. #else
  3264. #define FaxEnumOutboundGroups FaxEnumOutboundGroupsA
  3265. #endif // !UNICODE
  3266. WINFAXAPI
  3267. BOOL
  3268. WINAPI
  3269. FaxSetOutboundGroupA (
  3270. IN HANDLE hFaxHandle,
  3271. IN PFAX_OUTBOUND_ROUTING_GROUPA pGroup
  3272. );
  3273. WINFAXAPI
  3274. BOOL
  3275. WINAPI
  3276. FaxSetOutboundGroupW (
  3277. IN HANDLE hFaxHandle,
  3278. IN PFAX_OUTBOUND_ROUTING_GROUPW pGroup
  3279. );
  3280. #ifdef UNICODE
  3281. #define FaxSetOutboundGroup FaxSetOutboundGroupW
  3282. #else
  3283. #define FaxSetOutboundGroup FaxSetOutboundGroupA
  3284. #endif // !UNICODE
  3285. WINFAXAPI
  3286. BOOL
  3287. WINAPI
  3288. FaxAddOutboundGroupA (
  3289. IN HANDLE hFaxHandle,
  3290. IN LPCSTR lpctstrGroupName
  3291. );
  3292. WINFAXAPI
  3293. BOOL
  3294. WINAPI
  3295. FaxAddOutboundGroupW (
  3296. IN HANDLE hFaxHandle,
  3297. IN LPCWSTR lpctstrGroupName
  3298. );
  3299. #ifdef UNICODE
  3300. #define FaxAddOutboundGroup FaxAddOutboundGroupW
  3301. #else
  3302. #define FaxAddOutboundGroup FaxAddOutboundGroupA
  3303. #endif // !UNICODE
  3304. WINFAXAPI
  3305. BOOL
  3306. WINAPI
  3307. FaxRemoveOutboundGroupA (
  3308. IN HANDLE hFaxHandle,
  3309. IN LPCSTR lpctstrGroupName
  3310. );
  3311. WINFAXAPI
  3312. BOOL
  3313. WINAPI
  3314. FaxRemoveOutboundGroupW (
  3315. IN HANDLE hFaxHandle,
  3316. IN LPCWSTR lpctstrGroupName
  3317. );
  3318. #ifdef UNICODE
  3319. #define FaxRemoveOutboundGroup FaxRemoveOutboundGroupW
  3320. #else
  3321. #define FaxRemoveOutboundGroup FaxRemoveOutboundGroupA
  3322. #endif // !UNICODE
  3323. BOOL
  3324. WINAPI
  3325. FaxSetDeviceOrderInGroupA (
  3326. IN HANDLE hFaxHandle,
  3327. IN LPCSTR lpctstrGroupName,
  3328. IN DWORD dwDeviceId,
  3329. IN DWORD dwNewOrder
  3330. );
  3331. BOOL
  3332. WINAPI
  3333. FaxSetDeviceOrderInGroupW (
  3334. IN HANDLE hFaxHandle,
  3335. IN LPCWSTR lpctstrGroupName,
  3336. IN DWORD dwDeviceId,
  3337. IN DWORD dwNewOrder
  3338. );
  3339. #ifdef UNICODE
  3340. #define FaxSetDeviceOrderInGroup FaxSetDeviceOrderInGroupW
  3341. #else
  3342. #define FaxSetDeviceOrderInGroup FaxSetDeviceOrderInGroupA
  3343. #endif // !UNICODE
  3344. //********************************************
  3345. //* Outbound routing rules
  3346. //********************************************
  3347. typedef enum
  3348. {
  3349. FAX_RULE_STATUS_VALID,
  3350. FAX_RULE_STATUS_EMPTY_GROUP, // The rule's destination group has no devices
  3351. FAX_RULE_STATUS_ALL_GROUP_DEV_NOT_VALID, // The rule's destination group has valid devices
  3352. FAX_RULE_STATUS_SOME_GROUP_DEV_NOT_VALID, // The rule's destination group has some invalid devices
  3353. FAX_RULE_STATUS_BAD_DEVICE // The rule's destination device is not valid
  3354. } FAX_ENUM_RULE_STATUS;
  3355. typedef struct _FAX_OUTBOUND_ROUTING_RULEA
  3356. {
  3357. DWORD dwSizeOfStruct;
  3358. DWORD dwAreaCode;
  3359. DWORD dwCountryCode;
  3360. LPCSTR lpctstrCountryName;
  3361. union
  3362. {
  3363. DWORD dwDeviceId;
  3364. LPCSTR lpcstrGroupName;
  3365. } Destination;
  3366. BOOL bUseGroup;
  3367. FAX_ENUM_RULE_STATUS Status;
  3368. } FAX_OUTBOUND_ROUTING_RULEA, *PFAX_OUTBOUND_ROUTING_RULEA;
  3369. typedef struct _FAX_OUTBOUND_ROUTING_RULEW
  3370. {
  3371. DWORD dwSizeOfStruct;
  3372. DWORD dwAreaCode;
  3373. DWORD dwCountryCode;
  3374. LPCWSTR lpctstrCountryName;
  3375. union
  3376. {
  3377. DWORD dwDeviceId;
  3378. LPCWSTR lpcstrGroupName;
  3379. } Destination;
  3380. BOOL bUseGroup;
  3381. FAX_ENUM_RULE_STATUS Status;
  3382. } FAX_OUTBOUND_ROUTING_RULEW, *PFAX_OUTBOUND_ROUTING_RULEW;
  3383. #ifdef UNICODE
  3384. typedef FAX_OUTBOUND_ROUTING_RULEW FAX_OUTBOUND_ROUTING_RULE;
  3385. typedef PFAX_OUTBOUND_ROUTING_RULEW PFAX_OUTBOUND_ROUTING_RULE;
  3386. #else
  3387. typedef FAX_OUTBOUND_ROUTING_RULEA FAX_OUTBOUND_ROUTING_RULE;
  3388. typedef PFAX_OUTBOUND_ROUTING_RULEA PFAX_OUTBOUND_ROUTING_RULE;
  3389. #endif // UNICODE
  3390. WINFAXAPI
  3391. BOOL
  3392. WINAPI
  3393. FaxEnumOutboundRulesA (
  3394. IN HANDLE hFaxHandle,
  3395. OUT PFAX_OUTBOUND_ROUTING_RULEA *ppRules,
  3396. OUT LPDWORD lpdwNumRules
  3397. );
  3398. WINFAXAPI
  3399. BOOL
  3400. WINAPI
  3401. FaxEnumOutboundRulesW (
  3402. IN HANDLE hFaxHandle,
  3403. OUT PFAX_OUTBOUND_ROUTING_RULEW *ppRules,
  3404. OUT LPDWORD lpdwNumRules
  3405. );
  3406. #ifdef UNICODE
  3407. #define FaxEnumOutboundRules FaxEnumOutboundRulesW
  3408. #else
  3409. #define FaxEnumOutboundRules FaxEnumOutboundRulesA
  3410. #endif // !UNICODE
  3411. WINFAXAPI
  3412. BOOL
  3413. WINAPI
  3414. FaxSetOutboundRuleA (
  3415. IN HANDLE hFaxHandle,
  3416. IN PFAX_OUTBOUND_ROUTING_RULEA pRule
  3417. );
  3418. WINFAXAPI
  3419. BOOL
  3420. WINAPI
  3421. FaxSetOutboundRuleW (
  3422. IN HANDLE hFaxHandle,
  3423. IN PFAX_OUTBOUND_ROUTING_RULEW pRule
  3424. );
  3425. #ifdef UNICODE
  3426. #define FaxSetOutboundRule FaxSetOutboundRuleW
  3427. #else
  3428. #define FaxSetOutboundRule FaxSetOutboundRuleA
  3429. #endif // !UNICODE
  3430. WINFAXAPI
  3431. BOOL
  3432. WINAPI
  3433. FaxAddOutboundRuleA (
  3434. IN HANDLE hFaxHandle,
  3435. IN DWORD dwAreaCode,
  3436. IN DWORD dwCountryCode,
  3437. IN DWORD dwDeviceID,
  3438. IN LPCSTR lpctstrGroupName,
  3439. IN BOOL bUseGroup
  3440. );
  3441. WINFAXAPI
  3442. BOOL
  3443. WINAPI
  3444. FaxAddOutboundRuleW (
  3445. IN HANDLE hFaxHandle,
  3446. IN DWORD dwAreaCode,
  3447. IN DWORD dwCountryCode,
  3448. IN DWORD dwDeviceID,
  3449. IN LPCWSTR lpctstrGroupName,
  3450. IN BOOL bUseGroup
  3451. );
  3452. #ifdef UNICODE
  3453. #define FaxAddOutboundRule FaxAddOutboundRuleW
  3454. #else
  3455. #define FaxAddOutboundRule FaxAddOutboundRuleA
  3456. #endif // !UNICODE
  3457. WINFAXAPI
  3458. BOOL
  3459. WINAPI
  3460. FaxRemoveOutboundRule (
  3461. IN HANDLE hFaxHandle,
  3462. IN DWORD dwAreaCode,
  3463. IN DWORD dwCountryCode
  3464. );
  3465. //********************************************
  3466. //* TAPI countries support
  3467. //********************************************
  3468. typedef struct _FAX_TAPI_LINECOUNTRY_ENTRYA
  3469. {
  3470. DWORD dwCountryID;
  3471. DWORD dwCountryCode;
  3472. LPCSTR lpctstrCountryName;
  3473. LPCSTR lpctstrLongDistanceRule;
  3474. } FAX_TAPI_LINECOUNTRY_ENTRYA, *PFAX_TAPI_LINECOUNTRY_ENTRYA;
  3475. typedef struct _FAX_TAPI_LINECOUNTRY_ENTRYW
  3476. {
  3477. DWORD dwCountryID;
  3478. DWORD dwCountryCode;
  3479. LPCWSTR lpctstrCountryName;
  3480. LPCWSTR lpctstrLongDistanceRule;
  3481. } FAX_TAPI_LINECOUNTRY_ENTRYW, *PFAX_TAPI_LINECOUNTRY_ENTRYW;
  3482. #ifdef UNICODE
  3483. typedef FAX_TAPI_LINECOUNTRY_ENTRYW FAX_TAPI_LINECOUNTRY_ENTRY;
  3484. typedef PFAX_TAPI_LINECOUNTRY_ENTRYW PFAX_TAPI_LINECOUNTRY_ENTRY;
  3485. #else
  3486. typedef FAX_TAPI_LINECOUNTRY_ENTRYA FAX_TAPI_LINECOUNTRY_ENTRY;
  3487. typedef PFAX_TAPI_LINECOUNTRY_ENTRYA PFAX_TAPI_LINECOUNTRY_ENTRY;
  3488. #endif // UNICODE
  3489. typedef struct _FAX_TAPI_LINECOUNTRY_LISTA
  3490. {
  3491. DWORD dwNumCountries;
  3492. PFAX_TAPI_LINECOUNTRY_ENTRYA LineCountryEntries;
  3493. } FAX_TAPI_LINECOUNTRY_LISTA, *PFAX_TAPI_LINECOUNTRY_LISTA;
  3494. typedef struct _FAX_TAPI_LINECOUNTRY_LISTW
  3495. {
  3496. DWORD dwNumCountries;
  3497. PFAX_TAPI_LINECOUNTRY_ENTRYW LineCountryEntries;
  3498. } FAX_TAPI_LINECOUNTRY_LISTW, *PFAX_TAPI_LINECOUNTRY_LISTW;
  3499. #ifdef UNICODE
  3500. typedef FAX_TAPI_LINECOUNTRY_LISTW FAX_TAPI_LINECOUNTRY_LIST;
  3501. typedef PFAX_TAPI_LINECOUNTRY_LISTW PFAX_TAPI_LINECOUNTRY_LIST;
  3502. #else
  3503. typedef FAX_TAPI_LINECOUNTRY_LISTA FAX_TAPI_LINECOUNTRY_LIST;
  3504. typedef PFAX_TAPI_LINECOUNTRY_LISTA PFAX_TAPI_LINECOUNTRY_LIST;
  3505. #endif // UNICODE
  3506. WINFAXAPI
  3507. BOOL
  3508. WINAPI
  3509. FaxGetCountryListA (
  3510. IN HANDLE hFaxHandle,
  3511. OUT PFAX_TAPI_LINECOUNTRY_LISTA *ppCountryListBuffer
  3512. );
  3513. WINFAXAPI
  3514. BOOL
  3515. WINAPI
  3516. FaxGetCountryListW (
  3517. IN HANDLE hFaxHandle,
  3518. OUT PFAX_TAPI_LINECOUNTRY_LISTW *ppCountryListBuffer
  3519. );
  3520. #ifdef UNICODE
  3521. #define FaxGetCountryList FaxGetCountryListW
  3522. #else
  3523. #define FaxGetCountryList FaxGetCountryListA
  3524. #endif // !UNICODE
  3525. //********************************************
  3526. //* EFSP registration
  3527. //********************************************
  3528. //
  3529. // FSPI versions
  3530. //
  3531. typedef enum
  3532. {
  3533. FSPI_API_VERSION_1 = 0x00010000, // Used by FSPs
  3534. FSPI_API_VERSION_2 = 0x00020000 // Used by EFSPs
  3535. } FSPI_API_VERSIONS; // Used in FaxRegisterServiceProviderEx
  3536. WINFAXAPI
  3537. BOOL
  3538. WINAPI
  3539. FaxRegisterServiceProviderExA(
  3540. IN HANDLE hFaxHandle,
  3541. IN LPCSTR lpctstrGUID,
  3542. IN LPCSTR lpctstrFriendlyName,
  3543. IN LPCSTR lpctstrImageName,
  3544. IN LPCSTR lpctstrTspName,
  3545. IN DWORD dwFSPIVersion,
  3546. IN DWORD dwCapabilities
  3547. );
  3548. WINFAXAPI
  3549. BOOL
  3550. WINAPI
  3551. FaxRegisterServiceProviderExW(
  3552. IN HANDLE hFaxHandle,
  3553. IN LPCWSTR lpctstrGUID,
  3554. IN LPCWSTR lpctstrFriendlyName,
  3555. IN LPCWSTR lpctstrImageName,
  3556. IN LPCWSTR lpctstrTspName,
  3557. IN DWORD dwFSPIVersion,
  3558. IN DWORD dwCapabilities
  3559. );
  3560. #ifdef UNICODE
  3561. #define FaxRegisterServiceProviderEx FaxRegisterServiceProviderExW
  3562. #else
  3563. #define FaxRegisterServiceProviderEx FaxRegisterServiceProviderExA
  3564. #endif // !UNICODE
  3565. WINFAXAPI
  3566. BOOL
  3567. WINAPI
  3568. FaxUnregisterServiceProviderExA(
  3569. IN HANDLE hFaxHandle,
  3570. IN LPCSTR lpctstrGUID
  3571. );
  3572. WINFAXAPI
  3573. BOOL
  3574. WINAPI
  3575. FaxUnregisterServiceProviderExW(
  3576. IN HANDLE hFaxHandle,
  3577. IN LPCWSTR lpctstrGUID
  3578. );
  3579. #ifdef UNICODE
  3580. #define FaxUnregisterServiceProviderEx FaxUnregisterServiceProviderExW
  3581. #else
  3582. #define FaxUnregisterServiceProviderEx FaxUnregisterServiceProviderExA
  3583. #endif // !UNICODE
  3584. //********************************************
  3585. //* Server events
  3586. //********************************************
  3587. typedef enum
  3588. {
  3589. FAX_EVENT_TYPE_IN_QUEUE = 0x00000001,
  3590. FAX_EVENT_TYPE_OUT_QUEUE = 0x00000002,
  3591. FAX_EVENT_TYPE_CONFIG = 0x00000004,
  3592. FAX_EVENT_TYPE_ACTIVITY = 0x00000008,
  3593. FAX_EVENT_TYPE_QUEUE_STATE = 0x00000010,
  3594. FAX_EVENT_TYPE_IN_ARCHIVE = 0x00000020,
  3595. FAX_EVENT_TYPE_OUT_ARCHIVE = 0x00000040,
  3596. FAX_EVENT_TYPE_FXSSVC_ENDED = 0x00000080,
  3597. FAX_EVENT_TYPE_DEVICE_STATUS = 0x00000100,
  3598. FAX_EVENT_TYPE_NEW_CALL = 0x00000200
  3599. } FAX_ENUM_EVENT_TYPE;
  3600. typedef enum
  3601. {
  3602. FAX_JOB_EVENT_TYPE_ADDED,
  3603. FAX_JOB_EVENT_TYPE_REMOVED,
  3604. FAX_JOB_EVENT_TYPE_STATUS
  3605. } FAX_ENUM_JOB_EVENT_TYPE;
  3606. typedef enum
  3607. {
  3608. FAX_CONFIG_TYPE_RECEIPTS,
  3609. FAX_CONFIG_TYPE_ACTIVITY_LOGGING,
  3610. FAX_CONFIG_TYPE_OUTBOX,
  3611. FAX_CONFIG_TYPE_SENTITEMS,
  3612. FAX_CONFIG_TYPE_INBOX,
  3613. FAX_CONFIG_TYPE_SECURITY,
  3614. FAX_CONFIG_TYPE_EVENTLOGS,
  3615. FAX_CONFIG_TYPE_DEVICES,
  3616. FAX_CONFIG_TYPE_OUT_GROUPS,
  3617. FAX_CONFIG_TYPE_OUT_RULES
  3618. } FAX_ENUM_CONFIG_TYPE;
  3619. typedef struct _FAX_EVENT_JOBA
  3620. {
  3621. DWORDLONG dwlMessageId;
  3622. FAX_ENUM_JOB_EVENT_TYPE Type;
  3623. PFAX_JOB_STATUSA pJobData;
  3624. } FAX_EVENT_JOBA, *PFAX_EVENT_JOBA;
  3625. typedef struct _FAX_EVENT_JOBW
  3626. {
  3627. DWORDLONG dwlMessageId;
  3628. FAX_ENUM_JOB_EVENT_TYPE Type;
  3629. PFAX_JOB_STATUSW pJobData;
  3630. } FAX_EVENT_JOBW, *PFAX_EVENT_JOBW;
  3631. #ifdef UNICODE
  3632. typedef FAX_EVENT_JOBW FAX_EVENT_JOB;
  3633. typedef PFAX_EVENT_JOBW PFAX_EVENT_JOB;
  3634. #else
  3635. typedef FAX_EVENT_JOBA FAX_EVENT_JOB;
  3636. typedef PFAX_EVENT_JOBA PFAX_EVENT_JOB;
  3637. #endif // UNICODE
  3638. typedef struct _FAX_EVENT_DEVICE_STATUS
  3639. {
  3640. DWORD dwDeviceId; // Id of the device whose status has just changed
  3641. DWORD dwNewStatus; // The new status - a combination of values from FAX_ENUM_DEVICE_STATUS
  3642. } FAX_EVENT_DEVICE_STATUS, *PFAX_EVENT_DEVICE_STATUS;
  3643. typedef struct _FAX_EVENT_NEW_CALLA
  3644. {
  3645. HCALL hCall;
  3646. DWORD dwDeviceId;
  3647. LPTSTR lptstrCallerId;
  3648. } FAX_EVENT_NEW_CALLA, *PFAX_EVENT_NEW_CALLA;
  3649. typedef struct _FAX_EVENT_NEW_CALLW
  3650. {
  3651. HCALL hCall;
  3652. DWORD dwDeviceId;
  3653. LPTSTR lptstrCallerId;
  3654. } FAX_EVENT_NEW_CALLW, *PFAX_EVENT_NEW_CALLW;
  3655. #ifdef UNICODE
  3656. typedef FAX_EVENT_NEW_CALLW FAX_EVENT_NEW_CALL;
  3657. typedef PFAX_EVENT_NEW_CALLW PFAX_EVENT_NEW_CALL;
  3658. #else
  3659. typedef FAX_EVENT_NEW_CALLA FAX_EVENT_NEW_CALL;
  3660. typedef PFAX_EVENT_NEW_CALLA PFAX_EVENT_NEW_CALL;
  3661. #endif // UNICODE
  3662. typedef struct _FAX_EVENT_EXA
  3663. {
  3664. DWORD dwSizeOfStruct;
  3665. FILETIME TimeStamp;
  3666. FAX_ENUM_EVENT_TYPE EventType;
  3667. union
  3668. {
  3669. FAX_EVENT_JOBA JobInfo;
  3670. FAX_ENUM_CONFIG_TYPE ConfigType;
  3671. FAX_SERVER_ACTIVITY ActivityInfo;
  3672. FAX_EVENT_NEW_CALL NewCall;
  3673. DWORD dwQueueStates;
  3674. FAX_EVENT_DEVICE_STATUS DeviceStatus;
  3675. } EventInfo;
  3676. } FAX_EVENT_EXA, *PFAX_EVENT_EXA;
  3677. typedef struct _FAX_EVENT_EXW
  3678. {
  3679. DWORD dwSizeOfStruct;
  3680. FILETIME TimeStamp;
  3681. FAX_ENUM_EVENT_TYPE EventType;
  3682. union
  3683. {
  3684. FAX_EVENT_JOBW JobInfo;
  3685. FAX_ENUM_CONFIG_TYPE ConfigType;
  3686. FAX_SERVER_ACTIVITY ActivityInfo;
  3687. FAX_EVENT_NEW_CALL NewCall;
  3688. DWORD dwQueueStates;
  3689. FAX_EVENT_DEVICE_STATUS DeviceStatus;
  3690. } EventInfo;
  3691. } FAX_EVENT_EXW, *PFAX_EVENT_EXW;
  3692. #ifdef UNICODE
  3693. typedef FAX_EVENT_EXW FAX_EVENT_EX;
  3694. typedef PFAX_EVENT_EXW PFAX_EVENT_EX;
  3695. #else
  3696. typedef FAX_EVENT_EXA FAX_EVENT_EX;
  3697. typedef PFAX_EVENT_EXA PFAX_EVENT_EX;
  3698. #endif // UNICODE
  3699. //-------------------------------------------------------------------------------
  3700. // Printers Info
  3701. //-------------------------------------------------------------------------------
  3702. typedef struct _FAX_PRINTER_INFOA
  3703. {
  3704. LPSTR lptstrPrinterName;
  3705. LPSTR lptstrServerName;
  3706. LPSTR lptstrDriverName;
  3707. } FAX_PRINTER_INFOA, *PFAX_PRINTER_INFOA;
  3708. typedef struct _FAX_PRINTER_INFOW
  3709. {
  3710. LPWSTR lptstrPrinterName;
  3711. LPWSTR lptstrServerName;
  3712. LPWSTR lptstrDriverName;
  3713. } FAX_PRINTER_INFOW, *PFAX_PRINTER_INFOW;
  3714. #ifdef UNICODE
  3715. typedef FAX_PRINTER_INFOW FAX_PRINTER_INFO;
  3716. typedef PFAX_PRINTER_INFOW PFAX_PRINTER_INFO;
  3717. #else
  3718. typedef FAX_PRINTER_INFOA FAX_PRINTER_INFO;
  3719. typedef PFAX_PRINTER_INFOA PFAX_PRINTER_INFO;
  3720. #endif // UNICODE
  3721. WINFAXAPI
  3722. BOOL
  3723. WINAPI
  3724. FaxGetServicePrintersA(
  3725. IN HANDLE hFaxHandle,
  3726. OUT PFAX_PRINTER_INFOA *ppPrinterInfo,
  3727. OUT LPDWORD lpdwPrintersReturned
  3728. );
  3729. WINFAXAPI
  3730. BOOL
  3731. WINAPI
  3732. FaxGetServicePrintersW(
  3733. IN HANDLE hFaxHandle,
  3734. OUT PFAX_PRINTER_INFOW *ppPrinterInfo,
  3735. OUT LPDWORD lpdwPrintersReturned
  3736. );
  3737. #ifdef UNICODE
  3738. #define FaxGetServicePrinters FaxGetServicePrintersW
  3739. #else
  3740. #define FaxGetServicePrinters FaxGetServicePrintersA
  3741. #endif // !UNICODE
  3742. typedef BOOL
  3743. (WINAPI *PFAXGETSERVICEPRINTERSA)(
  3744. IN HANDLE hFaxHandle,
  3745. OUT PFAX_PRINTER_INFOA *ppPrinterInfo,
  3746. OUT LPDWORD lpdwPrintersReturned
  3747. );
  3748. typedef BOOL
  3749. (WINAPI *PFAXGETSERVICEPRINTERSW)(
  3750. IN HANDLE hFaxHandle,
  3751. OUT PFAX_PRINTER_INFOW *ppPrinterInfo,
  3752. OUT LPDWORD lpdwPrintersReturned
  3753. );
  3754. #ifdef UNICODE
  3755. #define PFAXGETSERVICEPRINTERS PFAXGETSERVICEPRINTERSW
  3756. #else
  3757. #define PFAXGETSERVICEPRINTERS PFAXGETSERVICEPRINTERSA
  3758. #endif // !UNICODE
  3759. WINFAXAPI
  3760. BOOL
  3761. WINAPI
  3762. FaxRegisterForServerEvents (
  3763. IN HANDLE hFaxHandle,
  3764. IN DWORD dwEventTypes,
  3765. IN HANDLE hCompletionPort,
  3766. IN DWORD_PTR dwCompletionKey,
  3767. IN HWND hWnd,
  3768. IN DWORD dwMessage,
  3769. OUT LPHANDLE lphEvent
  3770. );
  3771. WINFAXAPI
  3772. BOOL
  3773. WINAPI
  3774. FaxUnregisterForServerEvents (
  3775. IN HANDLE hEvent
  3776. );
  3777. //********************************************
  3778. //* Manual answer support functions
  3779. //********************************************
  3780. WINFAXAPI
  3781. BOOL
  3782. WINAPI
  3783. FaxAnswerCall(
  3784. IN HANDLE hFaxHandle,
  3785. IN CONST DWORD dwDeviceId
  3786. );
  3787. //********************************************
  3788. //* Configuration Wizard support functions
  3789. //********************************************
  3790. WINFAXAPI
  3791. BOOL
  3792. WINAPI
  3793. FaxGetConfigWizardUsed (
  3794. OUT LPBOOL lpbConfigWizardUsed
  3795. );
  3796. WINFAXAPI
  3797. BOOL
  3798. WINAPI
  3799. FaxSetConfigWizardUsed (
  3800. IN HANDLE hFaxHandle,
  3801. OUT BOOL bConfigWizardUsed
  3802. );
  3803. //********************************************
  3804. //* Ivalidate archive folder
  3805. //********************************************
  3806. WINFAXAPI
  3807. BOOL
  3808. WINAPI
  3809. FaxRefreshArchive (
  3810. IN HANDLE hFaxHandle,
  3811. IN FAX_ENUM_MESSAGE_FOLDER Folder
  3812. );
  3813. #ifdef __cplusplus
  3814. }
  3815. #endif
  3816. #endif