Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2682 lines
79 KiB

  1. ;begin_both
  2. /*++
  3. Copyright (c) Microsoft Corporation. All rights reserved.
  4. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  5. EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  6. WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  7. Module Name:
  8. winfax.h
  9. Abstract:
  10. This module contains the WIN32 FAX APIs.
  11. --*/
  12. ;end_both
  13. #ifndef _FAXAPI_
  14. #define _FAXAPI_
  15. ;begin_internal
  16. #ifndef _FAXAPIP_
  17. #define _FAXAPIP_
  18. #include <FaxUIConstants.h>
  19. ;end_internal
  20. ;begin_both
  21. #ifndef MIDL_PASS
  22. #include <tapi.h>
  23. #endif
  24. #if !defined(_WINFAX_)
  25. #define WINFAXAPI DECLSPEC_IMPORT
  26. #else
  27. #define WINFAXAPI
  28. #endif
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. //
  33. // FAX ERROR CODES
  34. //
  35. #define FAX_ERR_START 7001L // First fax specific error code
  36. #define FAX_ERR_SRV_OUTOFMEMORY 7001L
  37. #define FAX_ERR_GROUP_NOT_FOUND 7002L
  38. #define FAX_ERR_BAD_GROUP_CONFIGURATION 7003L
  39. #define FAX_ERR_GROUP_IN_USE 7004L
  40. #define FAX_ERR_RULE_NOT_FOUND 7005L
  41. #define FAX_ERR_NOT_NTFS 7006L
  42. #define FAX_ERR_DIRECTORY_IN_USE 7007L
  43. #define FAX_ERR_FILE_ACCESS_DENIED 7008L
  44. #define FAX_ERR_MESSAGE_NOT_FOUND 7009L
  45. #define FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED 7010L
  46. #define FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU 7011L
  47. #define FAX_ERR_VERSION_MISMATCH 7012L // Fax client/server versions mismtach
  48. #define FAX_ERR_RECIPIENTS_LIMIT 7013L // Recipients limit in a single broadcast
  49. #define FAX_ERR_END 7013L // Last fax specific error code
  50. //
  51. // MessageId: FAX_E_SRV_OUTOFMEMORY
  52. //
  53. // MessageText:
  54. //
  55. // The fax server failed to allocate memory.
  56. //
  57. #define FAX_E_SRV_OUTOFMEMORY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_SRV_OUTOFMEMORY)
  58. //
  59. // MessageId: FAX_E_GROUP_NOT_FOUND
  60. //
  61. // MessageText:
  62. //
  63. // The fax server failed to locate an outbound routing group by name.
  64. //
  65. #define FAX_E_GROUP_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_GROUP_NOT_FOUND)
  66. //
  67. // MessageId: FAX_E_BAD_GROUP_CONFIGURATION
  68. //
  69. // MessageText:
  70. //
  71. // The fax server encountered an outbound routing group with bad configuration.
  72. //
  73. #define FAX_E_BAD_GROUP_CONFIGURATION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_BAD_GROUP_CONFIGURATION)
  74. //
  75. // MessageId: FAX_E_GROUP_IN_USE
  76. //
  77. // MessageText:
  78. //
  79. // The fax server cannot remove an outbound routing group because it is in use by one or more outbound routing rules.
  80. //
  81. #define FAX_E_GROUP_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_GROUP_IN_USE)
  82. //
  83. // MessageId: FAX_E_RULE_NOT_FOUND
  84. //
  85. // MessageText:
  86. //
  87. // The fax server failed to locate an outbound routing rule by country code and area code.
  88. //
  89. #define FAX_E_RULE_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_RULE_NOT_FOUND)
  90. //
  91. // MessageId: FAX_E_NOT_NTFS
  92. //
  93. // MessageText:
  94. //
  95. // The fax server cannot set an archive folder to a non-NTFS partition.
  96. //
  97. #define FAX_E_NOT_NTFS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_NOT_NTFS)
  98. //
  99. // MessageId: FAX_E_DIRECTORY_IN_USE
  100. //
  101. // MessageText:
  102. //
  103. // The fax server cannot use the same folder for both the inbox and the sent-items archives.
  104. //
  105. #define FAX_E_DIRECTORY_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_DIRECTORY_IN_USE)
  106. //
  107. // MessageId: FAX_E_FILE_ACCESS_DENIED
  108. //
  109. // MessageText:
  110. //
  111. // The fax server cannot access the specified file or folder.
  112. //
  113. #define FAX_E_FILE_ACCESS_DENIED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_FILE_ACCESS_DENIED)
  114. //
  115. // MessageId: FAX_E_MESSAGE_NOT_FOUND
  116. //
  117. // MessageText:
  118. //
  119. // The fax server cannot find the job or message by its ID.
  120. //
  121. #define FAX_E_MESSAGE_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_MESSAGE_NOT_FOUND)
  122. //
  123. // MessageId: FAX_E_DEVICE_NUM_LIMIT_EXCEEDED
  124. //
  125. // MessageText:
  126. //
  127. // The fax server cannot complete the operation because the number of active fax devices allowed for this version of Windows was exceeded.
  128. //
  129. #define FAX_E_DEVICE_NUM_LIMIT_EXCEEDED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED)
  130. //
  131. // MessageId: FAX_E_NOT_SUPPORTED_ON_THIS_SKU
  132. //
  133. // MessageText:
  134. //
  135. // The fax server cannot complete the operation because it is not supported for this version of Windows.
  136. //
  137. #define FAX_E_NOT_SUPPORTED_ON_THIS_SKU MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU)
  138. //
  139. // MessageId: FAX_E_VERSION_MISMATCH
  140. //
  141. // MessageText:
  142. //
  143. // The fax server API version does not support the requested operation.
  144. //
  145. #define FAX_E_VERSION_MISMATCH MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_VERSION_MISMATCH)
  146. //
  147. // MessageId: FAX_E_RECIPIENT_LIMIT
  148. //
  149. // MessageText:
  150. //
  151. // The limit on the number of recipients for a single fax broadcast was reached.
  152. //
  153. #define FAX_E_RECIPIENTS_LIMIT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, FAX_ERR_RECIPIENTS_LIMIT)
  154. typedef enum
  155. {
  156. FAXLOG_LEVEL_NONE = 0,
  157. FAXLOG_LEVEL_MIN,
  158. FAXLOG_LEVEL_MED,
  159. FAXLOG_LEVEL_MAX
  160. } FAX_ENUM_LOG_LEVELS;
  161. typedef enum
  162. {
  163. FAXLOG_CATEGORY_INIT = 1, // Initialization / shutdown
  164. FAXLOG_CATEGORY_OUTBOUND, // Outbound messages
  165. FAXLOG_CATEGORY_INBOUND, // Inbound messages
  166. FAXLOG_CATEGORY_UNKNOWN // Unknown category (all others)
  167. } FAX_ENUM_LOG_CATEGORIES;
  168. typedef struct _FAX_LOG_CATEGORY%
  169. {
  170. LPCTSTR% Name; // logging category name
  171. DWORD Category; // logging category number
  172. DWORD Level; // logging level for the category
  173. } FAX_LOG_CATEGORY%, *PFAX_LOG_CATEGORY%;
  174. typedef struct _FAX_TIME
  175. {
  176. WORD Hour;
  177. WORD Minute;
  178. } FAX_TIME, *PFAX_TIME;
  179. typedef struct _FAX_CONFIGURATION%
  180. {
  181. DWORD SizeOfStruct; // size of this structure
  182. DWORD Retries; // number of retries for fax send
  183. DWORD RetryDelay; // number of minutes between retries
  184. DWORD DirtyDays; // number of days to keep an unsent job in the queue
  185. BOOL Branding; // fsp should brand outgoing faxes
  186. BOOL UseDeviceTsid; // server uses device tsid only
  187. BOOL ServerCp; // clients must use cover pages on the server
  188. BOOL PauseServerQueue; // is the server queue paused?
  189. FAX_TIME StartCheapTime; // start of discount rate period
  190. FAX_TIME StopCheapTime; // end of discount rate period
  191. BOOL ArchiveOutgoingFaxes; // whether outgoing faxes should be archived
  192. LPCTSTR% ArchiveDirectory; // archive directory for outgoing faxes
  193. LPCTSTR% Reserved; // Reserved; must be NULL
  194. } FAX_CONFIGURATION%, *PFAX_CONFIGURATION%;
  195. //
  196. // FaxSetJob() command codes
  197. //
  198. typedef enum
  199. {
  200. JC_UNKNOWN = 0,
  201. JC_DELETE,
  202. JC_PAUSE,
  203. JC_RESUME
  204. } FAX_ENUM_JOB_COMMANDS;
  205. #define JC_RESTART JC_RESUME
  206. //
  207. // job type defines
  208. //
  209. ;end_both
  210. #define JT_UNKNOWN 0
  211. #define JT_SEND 1
  212. #define JT_RECEIVE 2
  213. #define JT_ROUTING 3
  214. #define JT_FAIL_RECEIVE 4
  215. //
  216. // job status defines
  217. //
  218. #define JS_PENDING 0x00000000
  219. #define JS_INPROGRESS 0x00000001
  220. #define JS_DELETING 0x00000002
  221. #define JS_FAILED 0x00000004
  222. #define JS_PAUSED 0x00000008
  223. #define JS_NOLINE 0x00000010
  224. #define JS_RETRYING 0x00000020
  225. #define JS_RETRIES_EXCEEDED 0x00000040
  226. ;begin_internal
  227. //
  228. // NOTICE: JT_* and JS_* are different from the Win2K public constants.
  229. // If you use WinFax.h and/or the Win2K COM interfaces, you get the Win2K constants.
  230. // If you use fxsapip.h, you get the Whistler constants.
  231. //
  232. // NEVER MIX THEM !!!
  233. //
  234. typedef enum
  235. {
  236. JT_UNKNOWN = 0x0001, // Fax type is not determined yet
  237. JT_SEND = 0x0002, // Outgoing fax message
  238. JT_RECEIVE = 0x0004, // Incoming fax message
  239. JT_ROUTING = 0x0008, // Incoming message - being routed
  240. JT_FAIL_RECEIVE = 0x0010, // Fail receive job (legacy support only)
  241. JT_BROADCAST = 0x0020 // Outgoing broadcast message
  242. } FAX_ENUM_JOB_TYPES;
  243. //
  244. // job status defines
  245. //
  246. #define JS_PENDING 0x00000001
  247. #define JS_INPROGRESS 0x00000002
  248. #define JS_DELETING 0x00000004
  249. #define JS_FAILED 0x00000008
  250. #define JS_PAUSED 0x00000010
  251. #define JS_NOLINE 0x00000020
  252. #define JS_RETRYING 0x00000040
  253. #define JS_RETRIES_EXCEEDED 0x00000080
  254. ;end_internal
  255. ;begin_both
  256. typedef struct _FAX_DEVICE_STATUS%
  257. {
  258. DWORD SizeOfStruct; // size of this structure
  259. LPCTSTR% CallerId; // caller id string
  260. LPCTSTR% Csid; // station identifier
  261. DWORD CurrentPage; // current page
  262. DWORD DeviceId; // permanent line id
  263. LPCTSTR% DeviceName; // device name
  264. LPCTSTR% DocumentName; // document name
  265. DWORD JobType; // send or receive?
  266. LPCTSTR% PhoneNumber; // sending phone number
  267. LPCTSTR% RoutingString; // routing information
  268. LPCTSTR% SenderName; // sender name
  269. LPCTSTR% RecipientName; // recipient name
  270. DWORD Size; // size in bytes of the document
  271. FILETIME StartTime; // starting time of the fax send/receive
  272. DWORD Status; // current status of the device, see FPS_??? masks
  273. LPCTSTR% StatusString; // status string if the Status field is zero. this may be NULL.
  274. FILETIME SubmittedTime; // time the document was submitted
  275. DWORD TotalPages; // total number of pages in this job
  276. LPCTSTR% Tsid; // transmitting station identifier
  277. LPCTSTR% UserName; // user that submitted the active job
  278. } FAX_DEVICE_STATUS%, *PFAX_DEVICE_STATUS%;
  279. typedef struct _FAX_JOB_ENTRY%
  280. {
  281. DWORD SizeOfStruct; // size of this structure
  282. DWORD JobId; // fax job id
  283. LPCTSTR% UserName; // user who submitted the job
  284. DWORD JobType; // job type, see JT defines
  285. DWORD QueueStatus; // job queue status, see JS defines
  286. DWORD Status; // current status of the device, see FPS_??? masks
  287. DWORD Size; // size in bytes of the document
  288. DWORD PageCount; // total page count
  289. LPCTSTR% RecipientNumber; // recipient fax number
  290. LPCTSTR% RecipientName; // recipient name
  291. LPCTSTR% Tsid; // transmitter's id
  292. LPCTSTR% SenderName; // sender name
  293. LPCTSTR% SenderCompany; // sender company
  294. LPCTSTR% SenderDept; // sender department
  295. LPCTSTR% BillingCode; // billing code
  296. DWORD ScheduleAction; // when to schedule the fax, see JSA defines
  297. SYSTEMTIME ScheduleTime; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  298. DWORD DeliveryReportType; // delivery report type, see DRT defines
  299. LPCTSTR% DeliveryReportAddress; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  300. LPCTSTR% DocumentName; // document name
  301. } FAX_JOB_ENTRY%, *PFAX_JOB_ENTRY%;
  302. //
  303. // fax port state masks
  304. //
  305. // if you change these defines the be sure to
  306. // change the resources in the fax service.
  307. //
  308. #define FPS_DIALING 0x20000001
  309. #define FPS_SENDING 0x20000002
  310. #define FPS_RECEIVING 0x20000004
  311. #define FPS_COMPLETED 0x20000008
  312. #define FPS_HANDLED 0x20000010
  313. #define FPS_UNAVAILABLE 0x20000020
  314. #define FPS_BUSY 0x20000040
  315. #define FPS_NO_ANSWER 0x20000080
  316. #define FPS_BAD_ADDRESS 0x20000100
  317. #define FPS_NO_DIAL_TONE 0x20000200
  318. #define FPS_DISCONNECTED 0x20000400
  319. #define FPS_FATAL_ERROR 0x20000800
  320. #define FPS_NOT_FAX_CALL 0x20001000
  321. #define FPS_CALL_DELAYED 0x20002000
  322. #define FPS_CALL_BLACKLISTED 0x20004000
  323. #define FPS_INITIALIZING 0x20008000
  324. #define FPS_OFFLINE 0x20010000
  325. #define FPS_RINGING 0x20020000
  326. #define FPS_AVAILABLE 0x20100000
  327. #define FPS_ABORTING 0x20200000
  328. #define FPS_ROUTING 0x20400000
  329. #define FPS_ANSWERED 0x20800000
  330. //
  331. // fax port capability mask
  332. //
  333. #define FPF_RECEIVE 0x00000001 // Automatically receive faxes
  334. #define FPF_SEND 0x00000002
  335. #define FPF_VIRTUAL 0x00000004
  336. typedef struct _FAX_PORT_INFO%
  337. {
  338. DWORD SizeOfStruct; // size of this structure
  339. DWORD DeviceId; // Device ID
  340. DWORD State; // State of the device
  341. DWORD Flags; // Device specific flags
  342. DWORD Rings; // Number of rings before answer
  343. DWORD Priority; // Device priority
  344. LPCTSTR% DeviceName; // Device name
  345. LPCTSTR% Tsid; // Device Tsid
  346. LPCTSTR% Csid; // Device Csid
  347. } FAX_PORT_INFO%, *PFAX_PORT_INFO%;
  348. typedef struct _FAX_ROUTING_METHOD%
  349. {
  350. DWORD SizeOfStruct; // size of this structure
  351. DWORD DeviceId; // device identifier
  352. BOOL Enabled; // is this method enabled for this device?
  353. LPCTSTR% DeviceName; // device name
  354. LPCTSTR% Guid; // guid that identifies this routing method
  355. LPCTSTR% FriendlyName; // friendly name for this method
  356. LPCTSTR% FunctionName; // exported function name that identifies this method
  357. LPCTSTR% ExtensionImageName; // module (dll) name that implements this method
  358. LPCTSTR% ExtensionFriendlyName; // displayable string that identifies the extension
  359. } FAX_ROUTING_METHOD%, *PFAX_ROUTING_METHOD%;
  360. typedef struct _FAX_GLOBAL_ROUTING_INFO%
  361. {
  362. DWORD SizeOfStruct; // size of this structure
  363. DWORD Priority; // priority of this device
  364. LPCTSTR% Guid; // guid that identifies this routing method
  365. LPCTSTR% FriendlyName; // friendly name for this method
  366. LPCTSTR% FunctionName; // exported function name that identifies this method
  367. LPCTSTR% ExtensionImageName; // module (dll) name that implements this method
  368. LPCTSTR% ExtensionFriendlyName; // displayable string that identifies the extension
  369. } FAX_GLOBAL_ROUTING_INFO%, *PFAX_GLOBAL_ROUTING_INFO%;
  370. typedef struct _FAX_COVERPAGE_INFO%
  371. {
  372. DWORD SizeOfStruct; // Size of this structure
  373. //
  374. // general
  375. //
  376. LPCTSTR% CoverPageName; // coverpage document name
  377. BOOL UseServerCoverPage; // coverpage exists on the fax server
  378. //
  379. // Recipient information
  380. //
  381. LPCTSTR% RecName; //
  382. LPCTSTR% RecFaxNumber; //
  383. LPCTSTR% RecCompany; //
  384. LPCTSTR% RecStreetAddress; //
  385. LPCTSTR% RecCity; //
  386. LPCTSTR% RecState; //
  387. LPCTSTR% RecZip; //
  388. LPCTSTR% RecCountry; //
  389. LPCTSTR% RecTitle; //
  390. LPCTSTR% RecDepartment; //
  391. LPCTSTR% RecOfficeLocation; //
  392. LPCTSTR% RecHomePhone; //
  393. LPCTSTR% RecOfficePhone; //
  394. //
  395. // Sender information
  396. //
  397. LPCTSTR% SdrName; //
  398. LPCTSTR% SdrFaxNumber; //
  399. LPCTSTR% SdrCompany; //
  400. LPCTSTR% SdrAddress; //
  401. LPCTSTR% SdrTitle; //
  402. LPCTSTR% SdrDepartment; //
  403. LPCTSTR% SdrOfficeLocation; //
  404. LPCTSTR% SdrHomePhone; //
  405. LPCTSTR% SdrOfficePhone; //
  406. //
  407. // Misc information
  408. //
  409. LPCTSTR% Note; //
  410. LPCTSTR% Subject; //
  411. SYSTEMTIME TimeSent; // Time the fax was sent
  412. DWORD PageCount; // Number of pages
  413. } FAX_COVERPAGE_INFO%, *PFAX_COVERPAGE_INFO%;
  414. typedef enum
  415. {
  416. JSA_NOW = 0, // Send now
  417. JSA_SPECIFIC_TIME, // Send at specific time
  418. JSA_DISCOUNT_PERIOD // Send at server configured discount period
  419. } FAX_ENUM_JOB_SEND_ATTRIBUTES;
  420. ;end_both
  421. typedef enum
  422. {
  423. DRT_NONE = 0x0000, // Do not send receipt
  424. DRT_EMAIL = 0x0001, // Send receipt by email
  425. DRT_INBOX = 0x0002 // send receipt to local inbox
  426. } FAX_ENUM_DELIVERY_REPORT_TYPES;
  427. ;begin_internal
  428. typedef enum
  429. {
  430. DRT_NONE = 0x0000, // Do not send receipt
  431. DRT_EMAIL = 0x0001, // Send receipt by email (SMTP)
  432. DRT_UNUSED = 0x0002, // Reserved
  433. DRT_MSGBOX = 0x0004, // Send receipt by a message box
  434. DRT_GRP_PARENT = 0x0008, // Send a single receipt for a broadcast job
  435. DRT_ATTACH_FAX = 0x0010 // Attach the fax tiff file to the receipt
  436. } FAX_ENUM_DELIVERY_REPORT_TYPES;
  437. #define DRT_ALL (DRT_EMAIL | DRT_MSGBOX) // All possible delivery report types
  438. #define DRT_MODIFIERS (DRT_GRP_PARENT | DRT_ATTACH_FAX) // All state modifiers
  439. //
  440. // the reserved fields are private data used
  441. // by the fax monitor and winfax.
  442. //
  443. //
  444. // Reserved[0] == 0xffffffff
  445. // Reserved[1] == Print job id
  446. //
  447. // Reserved[0] == 0xfffffffe start of a broadcast job
  448. //
  449. ;end_internal
  450. ;begin_both
  451. typedef struct _FAX_JOB_PARAM%
  452. {
  453. DWORD SizeOfStruct; // size of this structure
  454. LPCTSTR% RecipientNumber; // recipient fax number
  455. LPCTSTR% RecipientName; // recipient name
  456. LPCTSTR% Tsid; // transmitter's id
  457. LPCTSTR% SenderName; // sender name
  458. LPCTSTR% SenderCompany; // sender company
  459. LPCTSTR% SenderDept; // sender department
  460. LPCTSTR% BillingCode; // billing code
  461. DWORD ScheduleAction; // when to schedule the fax, see JSA defines
  462. SYSTEMTIME ScheduleTime; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  463. DWORD DeliveryReportType; // delivery report type, see DRT defines
  464. LPCTSTR% DeliveryReportAddress; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  465. LPCTSTR% DocumentName; // document name (optional)
  466. HCALL CallHandle; // optional call handle
  467. DWORD_PTR Reserved[3]; // reserved for ms use only
  468. } FAX_JOB_PARAM%, *PFAX_JOB_PARAM%;
  469. //
  470. // Event Ids
  471. //
  472. // FEI_NEVENTS is the number of events
  473. //
  474. #define FEI_DIALING 0x00000001
  475. #define FEI_SENDING 0x00000002
  476. #define FEI_RECEIVING 0x00000003
  477. #define FEI_COMPLETED 0x00000004
  478. #define FEI_BUSY 0x00000005
  479. #define FEI_NO_ANSWER 0x00000006
  480. #define FEI_BAD_ADDRESS 0x00000007
  481. #define FEI_NO_DIAL_TONE 0x00000008
  482. #define FEI_DISCONNECTED 0x00000009
  483. #define FEI_FATAL_ERROR 0x0000000a
  484. #define FEI_NOT_FAX_CALL 0x0000000b
  485. #define FEI_CALL_DELAYED 0x0000000c
  486. #define FEI_CALL_BLACKLISTED 0x0000000d
  487. #define FEI_RINGING 0x0000000e
  488. #define FEI_ABORTING 0x0000000f
  489. #define FEI_ROUTING 0x00000010
  490. #define FEI_MODEM_POWERED_ON 0x00000011
  491. #define FEI_MODEM_POWERED_OFF 0x00000012
  492. #define FEI_IDLE 0x00000013
  493. #define FEI_FAXSVC_ENDED 0x00000014
  494. #define FEI_ANSWERED 0x00000015
  495. #define FEI_JOB_QUEUED 0x00000016
  496. #define FEI_DELETED 0x00000017
  497. #define FEI_INITIALIZING 0x00000018
  498. #define FEI_LINE_UNAVAILABLE 0x00000019
  499. #define FEI_HANDLED 0x0000001a
  500. #define FEI_FAXSVC_STARTED 0x0000001b
  501. #define FEI_NEVENTS FEI_FAXSVC_STARTED
  502. typedef struct _FAX_EVENT%
  503. {
  504. DWORD SizeOfStruct; // Size of this structure
  505. FILETIME TimeStamp; // Timestamp for when the event was generated
  506. DWORD DeviceId; // Permanent line id
  507. DWORD EventId; // Current event id
  508. DWORD JobId; // Fax Job Id, 0xffffffff indicates inactive job
  509. } FAX_EVENT%, *PFAX_EVENT%;
  510. typedef struct _FAX_PRINT_INFO%
  511. {
  512. DWORD SizeOfStruct; // Size of this structure
  513. LPCTSTR% DocName; // Document name that appears in the spooler
  514. LPCTSTR% RecipientName; // Recipient name
  515. LPCTSTR% RecipientNumber; // Recipient fax number (non-canonical number)
  516. LPCTSTR% SenderName; // Sender name
  517. LPCTSTR% SenderCompany; // Sender company (optional)
  518. LPCTSTR% SenderDept; // Sender department
  519. LPCTSTR% SenderBillingCode; // Billing code
  520. LPCTSTR% Reserved; // Reserved; must be NULL
  521. LPCTSTR% DrEmailAddress; // E.Mail address for delivery report
  522. LPCTSTR% OutputFileName; // for print to file, resulting file name
  523. } FAX_PRINT_INFO%, *PFAX_PRINT_INFO%;
  524. typedef struct _FAX_CONTEXT_INFO%
  525. {
  526. DWORD SizeOfStruct; // Size of this structure
  527. HDC hDC; // Device Context
  528. TCHAR% ServerName[MAX_COMPUTERNAME_LENGTH+1]; // Server name
  529. } FAX_CONTEXT_INFO%, *PFAX_CONTEXT_INFO%;
  530. //
  531. // prototypes
  532. //
  533. WINFAXAPI
  534. BOOL
  535. WINAPI
  536. FaxConnectFaxServer%(
  537. IN LPCTSTR% MachineName OPTIONAL,
  538. OUT LPHANDLE FaxHandle
  539. );
  540. typedef BOOL
  541. (WINAPI *PFAXCONNECTFAXSERVER%)(
  542. IN LPCTSTR% MachineName OPTIONAL,
  543. OUT LPHANDLE FaxHandle
  544. );
  545. WINFAXAPI
  546. BOOL
  547. WINAPI
  548. FaxClose(
  549. IN HANDLE FaxHandle
  550. );
  551. typedef BOOL
  552. (WINAPI *PFAXCLOSE)(
  553. IN HANDLE FaxHandle
  554. );
  555. typedef enum
  556. {
  557. PORT_OPEN_QUERY = 1,
  558. PORT_OPEN_MODIFY
  559. } FAX_ENUM_PORT_OPEN_TYPE;
  560. WINFAXAPI
  561. BOOL
  562. WINAPI
  563. FaxOpenPort(
  564. IN HANDLE FaxHandle,
  565. IN DWORD DeviceId,
  566. IN DWORD Flags,
  567. OUT LPHANDLE FaxPortHandle
  568. );
  569. typedef BOOL
  570. (WINAPI *PFAXOPENPORT)(
  571. IN HANDLE FaxHandle,
  572. IN DWORD DeviceId,
  573. IN DWORD Flags,
  574. OUT LPHANDLE FaxPortHandle
  575. );
  576. WINFAXAPI
  577. BOOL
  578. WINAPI
  579. FaxCompleteJobParams%(
  580. IN OUT PFAX_JOB_PARAM% *JobParams,
  581. IN OUT PFAX_COVERPAGE_INFO% *CoverpageInfo
  582. );
  583. typedef BOOL
  584. (WINAPI *PFAXCOMPLETEJOBPARAMS%)(
  585. IN OUT PFAX_JOB_PARAM% *JobParams,
  586. IN OUT PFAX_COVERPAGE_INFO% *CoverpageInfo
  587. );
  588. WINFAXAPI
  589. BOOL
  590. WINAPI
  591. FaxSendDocument%(
  592. IN HANDLE FaxHandle,
  593. IN LPCTSTR% FileName,
  594. IN PFAX_JOB_PARAM% JobParams,
  595. IN const FAX_COVERPAGE_INFO% *CoverpageInfo, OPTIONAL
  596. OUT LPDWORD FaxJobId OPTIONAL
  597. );
  598. typedef BOOL
  599. (WINAPI *PFAXSENDDOCUMENT%)(
  600. IN HANDLE FaxHandle,
  601. IN LPCTSTR% FileName,
  602. IN PFAX_JOB_PARAM% JobParams,
  603. IN const FAX_COVERPAGE_INFO% *CoverpageInfo, OPTIONAL
  604. OUT LPDWORD FaxJobId OPTIONAL
  605. );
  606. typedef BOOL
  607. (CALLBACK *PFAX_RECIPIENT_CALLBACK%)(
  608. IN HANDLE FaxHandle,
  609. IN DWORD RecipientNumber,
  610. IN LPVOID Context,
  611. IN OUT PFAX_JOB_PARAM% JobParams,
  612. IN OUT PFAX_COVERPAGE_INFO% CoverpageInfo OPTIONAL
  613. );
  614. WINFAXAPI
  615. BOOL
  616. WINAPI
  617. FaxSendDocumentForBroadcast%(
  618. IN HANDLE FaxHandle,
  619. IN LPCTSTR% FileName,
  620. OUT LPDWORD FaxJobId,
  621. IN PFAX_RECIPIENT_CALLBACK% FaxRecipientCallback,
  622. IN LPVOID Context
  623. );
  624. typedef BOOL
  625. (WINAPI *PFAXSENDDOCUMENTFORBROADCAST%)(
  626. IN HANDLE FaxHandle,
  627. IN LPCTSTR% FileName,
  628. OUT LPDWORD FaxJobId,
  629. IN PFAX_RECIPIENT_CALLBACK% FaxRecipientCallback,
  630. IN LPVOID Context
  631. );
  632. ;end_both
  633. WINFAXAPI
  634. BOOL
  635. WINAPI
  636. FaxEnumJobs%(
  637. IN HANDLE FaxHandle,
  638. OUT PFAX_JOB_ENTRY% *JobEntry,
  639. OUT LPDWORD JobsReturned
  640. );
  641. typedef BOOL
  642. (WINAPI *PFAXENUMJOBS%)(
  643. IN HANDLE FaxHandle,
  644. OUT PFAX_JOB_ENTRY% *JobEntry,
  645. OUT LPDWORD JobsReturned
  646. );
  647. WINFAXAPI
  648. BOOL
  649. WINAPI
  650. FaxGetJob%(
  651. IN HANDLE FaxHandle,
  652. IN DWORD JobId,
  653. OUT PFAX_JOB_ENTRY% *JobEntry
  654. );
  655. typedef BOOL
  656. (WINAPI *PFAXGETJOB%)(
  657. IN HANDLE FaxHandle,
  658. IN DWORD JobId,
  659. OUT PFAX_JOB_ENTRY% *JobEntry
  660. );
  661. ;begin_both
  662. WINFAXAPI
  663. BOOL
  664. WINAPI
  665. FaxSetJob%(
  666. IN HANDLE FaxHandle,
  667. IN DWORD JobId,
  668. IN DWORD Command,
  669. IN const FAX_JOB_ENTRY% *JobEntry
  670. );
  671. typedef BOOL
  672. (WINAPI *PFAXSETJOB%)(
  673. IN HANDLE FaxHandle,
  674. IN DWORD JobId,
  675. IN DWORD Command,
  676. IN const FAX_JOB_ENTRY% *JobEntry
  677. );
  678. WINFAXAPI
  679. BOOL
  680. WINAPI
  681. FaxGetPageData(
  682. IN HANDLE FaxHandle,
  683. IN DWORD JobId,
  684. OUT LPBYTE *Buffer,
  685. OUT LPDWORD BufferSize,
  686. OUT LPDWORD ImageWidth,
  687. OUT LPDWORD ImageHeight
  688. );
  689. typedef BOOL
  690. (WINAPI *PFAXGETPAGEDATA)(
  691. IN HANDLE FaxHandle,
  692. IN DWORD JobId,
  693. OUT LPBYTE *Buffer,
  694. OUT LPDWORD BufferSize,
  695. OUT LPDWORD ImageWidth,
  696. OUT LPDWORD ImageHeight
  697. );
  698. WINFAXAPI
  699. BOOL
  700. WINAPI
  701. FaxGetDeviceStatus%(
  702. IN HANDLE FaxPortHandle,
  703. OUT PFAX_DEVICE_STATUS% *DeviceStatus
  704. );
  705. typedef BOOL
  706. (WINAPI *PFAXGETDEVICESTATUS%)(
  707. IN HANDLE FaxPortHandle,
  708. OUT PFAX_DEVICE_STATUS% *DeviceStatus
  709. );
  710. WINFAXAPI
  711. BOOL
  712. WINAPI
  713. FaxAbort(
  714. IN HANDLE FaxHandle,
  715. IN DWORD JobId
  716. );
  717. typedef BOOL
  718. (WINAPI *PFAXABORT)(
  719. IN HANDLE FaxHandle,
  720. IN DWORD JobId
  721. );
  722. WINFAXAPI
  723. BOOL
  724. WINAPI
  725. FaxGetConfiguration%(
  726. IN HANDLE FaxHandle,
  727. OUT PFAX_CONFIGURATION% *FaxConfig
  728. );
  729. typedef BOOL
  730. (WINAPI *PFAXGETCONFIGURATION%)(
  731. IN HANDLE FaxHandle,
  732. OUT PFAX_CONFIGURATION% *FaxConfig
  733. );
  734. WINFAXAPI
  735. BOOL
  736. WINAPI
  737. FaxSetConfiguration%(
  738. IN HANDLE FaxHandle,
  739. IN const FAX_CONFIGURATION% *FaxConfig
  740. );
  741. typedef BOOL
  742. (WINAPI *PFAXSETCONFIGURATION%)(
  743. IN HANDLE FaxHandle,
  744. IN const FAX_CONFIGURATION% *FaxConfig
  745. );
  746. WINFAXAPI
  747. BOOL
  748. WINAPI
  749. FaxGetLoggingCategories%(
  750. IN HANDLE FaxHandle,
  751. OUT PFAX_LOG_CATEGORY% *Categories,
  752. OUT LPDWORD NumberCategories
  753. );
  754. typedef BOOL
  755. (WINAPI *PFAXGETLOGGINGCATEGORIES%)(
  756. IN HANDLE FaxHandle,
  757. OUT PFAX_LOG_CATEGORY% *Categories,
  758. OUT LPDWORD NumberCategories
  759. );
  760. WINFAXAPI
  761. BOOL
  762. WINAPI
  763. FaxSetLoggingCategories%(
  764. IN HANDLE FaxHandle,
  765. IN const FAX_LOG_CATEGORY% *Categories,
  766. IN DWORD NumberCategories
  767. );
  768. typedef BOOL
  769. (WINAPI *PFAXSETLOGGINGCATEGORIES%)(
  770. IN HANDLE FaxHandle,
  771. IN const FAX_LOG_CATEGORY% *Categories,
  772. IN DWORD NumberCategories
  773. );
  774. WINFAXAPI
  775. BOOL
  776. WINAPI
  777. FaxEnumPorts%(
  778. IN HANDLE FaxHandle,
  779. OUT PFAX_PORT_INFO% *PortInfo,
  780. OUT LPDWORD PortsReturned
  781. );
  782. typedef BOOL
  783. (WINAPI *PFAXENUMPORTS%)(
  784. IN HANDLE FaxHandle,
  785. OUT PFAX_PORT_INFO% *PortInfo,
  786. OUT LPDWORD PortsReturned
  787. );
  788. WINFAXAPI
  789. BOOL
  790. WINAPI
  791. FaxGetPort%(
  792. IN HANDLE FaxPortHandle,
  793. OUT PFAX_PORT_INFO% *PortInfo
  794. );
  795. typedef BOOL
  796. (WINAPI *PFAXGETPORT%)(
  797. IN HANDLE FaxPortHandle,
  798. OUT PFAX_PORT_INFO% *PortInfo
  799. );
  800. WINFAXAPI
  801. BOOL
  802. WINAPI
  803. FaxSetPort%(
  804. IN HANDLE FaxPortHandle,
  805. IN const FAX_PORT_INFO% *PortInfo
  806. );
  807. typedef BOOL
  808. (WINAPI *PFAXSETPORT%)(
  809. IN HANDLE FaxPortHandle,
  810. IN const FAX_PORT_INFO% *PortInfo
  811. );
  812. WINFAXAPI
  813. BOOL
  814. WINAPI
  815. FaxEnumRoutingMethods%(
  816. IN HANDLE FaxPortHandle,
  817. OUT PFAX_ROUTING_METHOD% *RoutingMethod,
  818. OUT LPDWORD MethodsReturned
  819. );
  820. typedef BOOL
  821. (WINAPI *PFAXENUMROUTINGMETHODS%)(
  822. IN HANDLE FaxPortHandle,
  823. OUT PFAX_ROUTING_METHOD% *RoutingMethod,
  824. OUT LPDWORD MethodsReturned
  825. );
  826. WINFAXAPI
  827. BOOL
  828. WINAPI
  829. FaxEnableRoutingMethod%(
  830. IN HANDLE FaxPortHandle,
  831. IN LPCTSTR% RoutingGuid,
  832. IN BOOL Enabled
  833. );
  834. typedef BOOL
  835. (WINAPI *PFAXENABLEROUTINGMETHOD%)(
  836. IN HANDLE FaxPortHandle,
  837. IN LPCTSTR% RoutingGuid,
  838. IN BOOL Enabled
  839. );
  840. WINFAXAPI
  841. BOOL
  842. WINAPI
  843. FaxEnumGlobalRoutingInfo%(
  844. IN HANDLE FaxHandle,
  845. OUT PFAX_GLOBAL_ROUTING_INFO% *RoutingInfo,
  846. OUT LPDWORD MethodsReturned
  847. );
  848. typedef BOOL
  849. (WINAPI *PFAXENUMGLOBALROUTINGINFO%)(
  850. IN HANDLE FaxHandle,
  851. OUT PFAX_GLOBAL_ROUTING_INFO% *RoutingInfo,
  852. OUT LPDWORD MethodsReturned
  853. );
  854. WINFAXAPI
  855. BOOL
  856. WINAPI
  857. FaxSetGlobalRoutingInfo%(
  858. IN HANDLE FaxHandle,
  859. IN const FAX_GLOBAL_ROUTING_INFO% *RoutingInfo
  860. );
  861. typedef BOOL
  862. (WINAPI *PFAXSETGLOBALROUTINGINFO%)(
  863. IN HANDLE FaxPortHandle,
  864. IN const FAX_GLOBAL_ROUTING_INFO% *RoutingInfo
  865. );
  866. WINFAXAPI
  867. BOOL
  868. WINAPI
  869. FaxGetRoutingInfo%(
  870. IN HANDLE FaxPortHandle,
  871. IN LPCTSTR% RoutingGuid,
  872. OUT LPBYTE *RoutingInfoBuffer,
  873. OUT LPDWORD RoutingInfoBufferSize
  874. );
  875. typedef BOOL
  876. (WINAPI *PFAXGETROUTINGINFO%)(
  877. IN HANDLE FaxPortHandle,
  878. IN LPCTSTR% RoutingGuid,
  879. OUT LPBYTE *RoutingInfoBuffer,
  880. OUT LPDWORD RoutingInfoBufferSize
  881. );
  882. WINFAXAPI
  883. BOOL
  884. WINAPI
  885. FaxSetRoutingInfo%(
  886. IN HANDLE FaxPortHandle,
  887. IN LPCTSTR% RoutingGuid,
  888. IN const BYTE *RoutingInfoBuffer,
  889. IN DWORD RoutingInfoBufferSize
  890. );
  891. typedef BOOL
  892. (WINAPI *PFAXSETROUTINGINFO%)(
  893. IN HANDLE FaxPortHandle,
  894. IN LPCTSTR% RoutingGuid,
  895. IN const BYTE *RoutingInfoBuffer,
  896. IN DWORD RoutingInfoBufferSize
  897. );
  898. ;end_both
  899. ;begin_internal
  900. WINFAXAPI
  901. BOOL
  902. WINAPI
  903. FaxRelease(
  904. IN HANDLE FaxHandle
  905. );
  906. typedef BOOL
  907. (WINAPI *PFAXRELEASE)(
  908. IN HANDLE FaxHandle
  909. );
  910. BOOL
  911. FXSAPIInitialize(
  912. VOID
  913. );
  914. VOID
  915. FXSAPIFree(
  916. VOID
  917. );
  918. WINFAXAPI
  919. BOOL
  920. WINAPI
  921. FaxStartPrintJob2%
  922. (
  923. IN LPCTSTR% PrinterName,
  924. IN const FAX_PRINT_INFO% *PrintInfo,
  925. IN short TiffRes,
  926. OUT LPDWORD FaxJobId,
  927. OUT PFAX_CONTEXT_INFO% FaxContextInfo
  928. );
  929. ;end_internal
  930. ;begin_both
  931. WINFAXAPI
  932. BOOL
  933. WINAPI
  934. FaxInitializeEventQueue(
  935. IN HANDLE FaxHandle,
  936. IN HANDLE CompletionPort,
  937. IN ULONG_PTR CompletionKey,
  938. IN HWND hWnd,
  939. IN UINT MessageStart
  940. );
  941. typedef BOOL
  942. (WINAPI *PFAXINITIALIZEEVENTQUEUE)(
  943. IN HANDLE FaxHandle,
  944. IN HANDLE CompletionPort,
  945. IN ULONG_PTR CompletionKey,
  946. IN HWND hWnd,
  947. IN UINT MessageStart
  948. );
  949. WINFAXAPI
  950. VOID
  951. WINAPI
  952. FaxFreeBuffer(
  953. LPVOID Buffer
  954. );
  955. typedef VOID
  956. (WINAPI *PFAXFREEBUFFER)(
  957. LPVOID Buffer
  958. );
  959. WINFAXAPI
  960. BOOL
  961. WINAPI
  962. FaxStartPrintJob%(
  963. IN LPCTSTR% PrinterName,
  964. IN const FAX_PRINT_INFO% *PrintInfo,
  965. OUT LPDWORD FaxJobId,
  966. OUT PFAX_CONTEXT_INFO% FaxContextInfo
  967. );
  968. typedef BOOL
  969. (WINAPI *PFAXSTARTPRINTJOB%)(
  970. IN LPCTSTR% PrinterName,
  971. IN const FAX_PRINT_INFO% *PrintInfo,
  972. OUT LPDWORD FaxJobId,
  973. OUT PFAX_CONTEXT_INFO% FaxContextInfo
  974. );
  975. WINFAXAPI
  976. BOOL
  977. WINAPI
  978. FaxPrintCoverPage%(
  979. IN const FAX_CONTEXT_INFO% *FaxContextInfo,
  980. IN const FAX_COVERPAGE_INFO% *CoverPageInfo
  981. );
  982. typedef BOOL
  983. (WINAPI *PFAXPRINTCOVERPAGE%)(
  984. IN const FAX_CONTEXT_INFO% *FaxContextInfo,
  985. IN const FAX_COVERPAGE_INFO% *CoverPageInfo
  986. );
  987. WINFAXAPI
  988. BOOL
  989. WINAPI
  990. FaxRegisterServiceProviderW(
  991. IN LPCWSTR DeviceProvider,
  992. IN LPCWSTR FriendlyName,
  993. IN LPCWSTR ImageName,
  994. IN LPCWSTR TspName
  995. );
  996. #define FaxRegisterServiceProvider FaxRegisterServiceProviderW
  997. typedef BOOL
  998. (WINAPI *PFAXREGISTERSERVICEPROVIDERW)(
  999. IN LPCWSTR DeviceProvider,
  1000. IN LPCWSTR FriendlyName,
  1001. IN LPCWSTR ImageName,
  1002. IN LPCWSTR TspName
  1003. );
  1004. #define PFAXREGISTERSERVICEPROVIDER PFAXREGISTERSERVICEPROVIDERW
  1005. WINFAXAPI
  1006. BOOL
  1007. WINAPI
  1008. FaxUnregisterServiceProviderW(
  1009. IN LPCWSTR DeviceProvider
  1010. );
  1011. #define FaxUnregisterServiceProvider FaxUnregisterServiceProviderW
  1012. typedef BOOL
  1013. (WINAPI *PFAXUNREGISTERSERVICEPROVIDERW)(
  1014. IN LPCWSTR DeviceProvider
  1015. );
  1016. #define PFAXUNREGISTERSERVICEPROVIDER PFAXUNREGISTERSERVICEPROVIDERW
  1017. typedef BOOL
  1018. (CALLBACK *PFAX_ROUTING_INSTALLATION_CALLBACKW)(
  1019. IN HANDLE FaxHandle,
  1020. IN LPVOID Context,
  1021. IN OUT LPWSTR MethodName,
  1022. IN OUT LPWSTR FriendlyName,
  1023. IN OUT LPWSTR FunctionName,
  1024. IN OUT LPWSTR Guid
  1025. );
  1026. #define PFAX_ROUTING_INSTALLATION_CALLBACK PFAX_ROUTING_INSTALLATION_CALLBACKW
  1027. WINFAXAPI
  1028. BOOL
  1029. WINAPI
  1030. FaxRegisterRoutingExtensionW(
  1031. IN HANDLE FaxHandle,
  1032. IN LPCWSTR ExtensionName,
  1033. IN LPCWSTR FriendlyName,
  1034. IN LPCWSTR ImageName,
  1035. IN PFAX_ROUTING_INSTALLATION_CALLBACKW CallBack,
  1036. IN LPVOID Context
  1037. );
  1038. #define FaxRegisterRoutingExtension FaxRegisterRoutingExtensionW
  1039. typedef BOOL
  1040. (WINAPI *PFAXREGISTERROUTINGEXTENSIONW)(
  1041. IN HANDLE FaxHandle,
  1042. IN LPCWSTR ExtensionName,
  1043. IN LPCWSTR FriendlyName,
  1044. IN LPCWSTR ImageName,
  1045. IN PFAX_ROUTING_INSTALLATION_CALLBACKW CallBack,
  1046. IN LPVOID Context
  1047. );
  1048. #define PFAXREGISTERROUTINGEXTENSION PFAXREGISTERROUTINGEXTENSIONW
  1049. WINFAXAPI
  1050. BOOL
  1051. WINAPI
  1052. FaxUnregisterRoutingExtension%(
  1053. IN HANDLE hFaxHandle,
  1054. IN LPCTSTR% lpctstrExtensionName
  1055. );
  1056. ;end_both
  1057. ;begin_internal
  1058. WINFAXAPI
  1059. BOOL
  1060. WINAPI
  1061. FaxGetInstallType(
  1062. IN HANDLE FaxHandle,
  1063. OUT LPDWORD InstallType,
  1064. OUT LPDWORD InstalledPlatforms,
  1065. OUT LPDWORD ProductType
  1066. );
  1067. typedef BOOL
  1068. (WINAPI *PFAXGETINSTALLTYPE)(
  1069. IN HANDLE FaxHandle,
  1070. OUT LPDWORD InstallType,
  1071. OUT LPDWORD InstalledPlatforms,
  1072. OUT LPDWORD ProductType
  1073. );
  1074. ;end_internal
  1075. ;begin_both
  1076. WINFAXAPI
  1077. BOOL
  1078. WINAPI
  1079. FaxAccessCheck(
  1080. IN HANDLE FaxHandle,
  1081. IN DWORD AccessMask
  1082. );
  1083. typedef BOOL
  1084. (WINAPI *PFAXACCESSCHECK)(
  1085. IN HANDLE FaxHandle,
  1086. IN DWORD AccessMask
  1087. );
  1088. //
  1089. // Fax Specific Access Rights
  1090. //
  1091. #define FAX_JOB_SUBMIT (0x0001)
  1092. #define FAX_JOB_QUERY (0x0002)
  1093. #define FAX_CONFIG_QUERY (0x0004)
  1094. #define FAX_CONFIG_SET (0x0008)
  1095. #define FAX_PORT_QUERY (0x0010)
  1096. #define FAX_PORT_SET (0x0020)
  1097. #define FAX_JOB_MANAGE (0x0040)
  1098. #define FAX_READ (STANDARD_RIGHTS_READ |\
  1099. FAX_JOB_QUERY |\
  1100. FAX_CONFIG_QUERY |\
  1101. FAX_PORT_QUERY)
  1102. #define FAX_WRITE (STANDARD_RIGHTS_WRITE |\
  1103. FAX_JOB_SUBMIT )
  1104. #define FAX_ALL_ACCESS (STANDARD_RIGHTS_ALL |\
  1105. FAX_JOB_SUBMIT |\
  1106. FAX_JOB_QUERY |\
  1107. FAX_CONFIG_QUERY |\
  1108. FAX_CONFIG_SET |\
  1109. FAX_PORT_QUERY |\
  1110. FAX_PORT_SET |\
  1111. FAX_JOB_MANAGE)
  1112. ;end_both
  1113. ;begin_internal
  1114. //************************************
  1115. //* Extended API Functions
  1116. //************************************
  1117. #define MAX_DIR_PATH 248
  1118. //
  1119. // Outbound routing defines
  1120. //
  1121. #define ROUTING_RULE_COUNTRY_CODE_ANY 0 // Outbound routing rule - Any country dialing code
  1122. #define ROUTING_RULE_AREA_CODE_ANY 0 // Outbound routing rule - Any area dialing code
  1123. #define MAX_ROUTING_GROUP_NAME 128
  1124. #define ROUTING_GROUP_ALL_DEVICESW L"<All devices>"
  1125. #define ROUTING_GROUP_ALL_DEVICESA "<All devices>"
  1126. #ifdef UNICODE
  1127. #define ROUTING_GROUP_ALL_DEVICES ROUTING_GROUP_ALL_DEVICESW
  1128. #else
  1129. #define ROUTING_GROUP_ALL_DEVICES ROUTING_GROUP_ALL_DEVICESA;
  1130. #endif // UNICODE
  1131. //
  1132. // Activity logging defines
  1133. //
  1134. #define ACTIVITY_LOG_INBOX_FILENAME TEXT("InboxLOG")
  1135. #define ACTIVITY_LOG_OUTBOX_FILENAME TEXT("OutboxLOG")
  1136. #define ACTIVITY_LOG_FILE_EXTENSION TEXT(".txt")
  1137. #define ACTIVITY_LOG_INBOX_FILE ACTIVITY_LOG_INBOX_FILENAME ACTIVITY_LOG_FILE_EXTENSION
  1138. #define ACTIVITY_LOG_OUTBOX_FILE ACTIVITY_LOG_OUTBOX_FILENAME ACTIVITY_LOG_FILE_EXTENSION
  1139. #define ACTIVITY_LOG_INBOX_FILENAME_TEMPLATE ACTIVITY_LOG_INBOX_FILENAME TEXT(" %04d-%02d-%02d - %04d-%02d-%02d") ACTIVITY_LOG_FILE_EXTENSION
  1140. #define ACTIVITY_LOG_OUTBOX_FILENAME_TEMPLATE ACTIVITY_LOG_OUTBOX_FILENAME TEXT(" %04d-%02d-%02d - %04d-%02d-%02d") ACTIVITY_LOG_FILE_EXTENSION
  1141. #define ACTIVITY_LOG_INBOX (0x0000)
  1142. #define ACTIVITY_LOG_OUTBOX (0x0001)
  1143. #define ACTIVITY_LOG_LIMIT_CRITERIA_NONE (0x0000)
  1144. #define ACTIVITY_LOG_LIMIT_CRITERIA_SIZE (0x0001)
  1145. #define ACTIVITY_LOG_LIMIT_CRITERIA_AGE (0x0002)
  1146. #define ACTIVITY_LOG_LIMIT_REACHED_ACTION_COPY (0x0000)
  1147. #define ACTIVITY_LOG_LIMIT_REACHED_ACTION_DELETE (0x0001)
  1148. #define ACTIVITY_LOG_DEFAULT_SIZE_LIMIT (50) // 50 Mbyte
  1149. #define ACTIVITY_LOG_DEFAULT_AGE_LIMIT (1) // 1 Month
  1150. //
  1151. // Archive defines
  1152. //
  1153. #define FAX_ARCHIVE_FOLDER_INVALID_SIZE MAKELONGLONG(0xffffffff, 0xffffffff)
  1154. #define MAX_ARCHIVE_FOLDER_PATH 180
  1155. //
  1156. // New job status codes
  1157. //
  1158. #define JS_COMPLETED 0x00000100
  1159. #define JS_CANCELED 0x00000200
  1160. #define JS_CANCELING 0x00000400
  1161. #define JS_ROUTING 0x00000800
  1162. //
  1163. // Extended job status defines
  1164. //
  1165. #define JS_EX_DISCONNECTED 0x00000001
  1166. #define JS_EX_INITIALIZING 0x00000002
  1167. #define JS_EX_DIALING 0x00000003
  1168. #define JS_EX_TRANSMITTING 0x00000004
  1169. #define JS_EX_ANSWERED 0x00000005
  1170. #define JS_EX_RECEIVING 0x00000006
  1171. #define JS_EX_LINE_UNAVAILABLE 0x00000007
  1172. #define JS_EX_BUSY 0x00000008
  1173. #define JS_EX_NO_ANSWER 0x00000009
  1174. #define JS_EX_BAD_ADDRESS 0x0000000A
  1175. #define JS_EX_NO_DIAL_TONE 0x0000000B
  1176. #define JS_EX_FATAL_ERROR 0x0000000C
  1177. #define JS_EX_CALL_DELAYED 0x0000000D
  1178. #define JS_EX_CALL_BLACKLISTED 0x0000000E
  1179. #define JS_EX_NOT_FAX_CALL 0x0000000F
  1180. #define JS_EX_PARTIALLY_RECEIVED 0x00000010
  1181. #define JS_EX_HANDLED 0x00000011
  1182. #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
  1183. #define JS_EX_CALL_COMPLETED 0x00000012
  1184. #define JS_EX_CALL_ABORTED 0x00000013
  1185. #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
  1186. //
  1187. // Available job operations
  1188. //
  1189. typedef enum
  1190. {
  1191. FAX_JOB_OP_VIEW = 0x0001,
  1192. FAX_JOB_OP_PAUSE = 0x0002,
  1193. FAX_JOB_OP_RESUME = 0x0004,
  1194. FAX_JOB_OP_RESTART = 0x0008,
  1195. FAX_JOB_OP_DELETE = 0x0010,
  1196. FAX_JOB_OP_RECIPIENT_INFO = 0x0020,
  1197. FAX_JOB_OP_SENDER_INFO = 0x0040
  1198. } FAX_ENUM_JOB_OP;
  1199. //************************************
  1200. //* Getting / Settings the queue state
  1201. //************************************
  1202. typedef enum
  1203. {
  1204. FAX_INCOMING_BLOCKED = 0x0001,
  1205. FAX_OUTBOX_BLOCKED = 0x0002,
  1206. FAX_OUTBOX_PAUSED = 0x0004
  1207. } FAX_ENUM_QUEUE_STATE;
  1208. WINFAXAPI
  1209. BOOL
  1210. WINAPI
  1211. FaxGetQueueStates (
  1212. IN HANDLE hFaxHandle,
  1213. OUT PDWORD pdwQueueStates
  1214. );
  1215. WINFAXAPI
  1216. BOOL
  1217. WINAPI
  1218. FaxSetQueue (
  1219. IN HANDLE hFaxHandle,
  1220. IN CONST DWORD dwQueueStates
  1221. );
  1222. //************************************************
  1223. //* Getting / Setting the receipts configuration
  1224. //************************************************
  1225. typedef enum
  1226. {
  1227. FAX_SMTP_AUTH_ANONYMOUS,
  1228. FAX_SMTP_AUTH_BASIC,
  1229. FAX_SMTP_AUTH_NTLM
  1230. } FAX_ENUM_SMTP_AUTH_OPTIONS;
  1231. typedef struct _FAX_RECEIPTS_CONFIG%
  1232. {
  1233. DWORD dwSizeOfStruct; // For version checks
  1234. DWORD dwAllowedReceipts; // Any combination of DRT_EMAIL and DRT_MSGBOX
  1235. FAX_ENUM_SMTP_AUTH_OPTIONS SMTPAuthOption; // SMTP server authentication type
  1236. LPTSTR% lptstrReserved; // Reserved; must be NULL
  1237. LPTSTR% lptstrSMTPServer; // SMTP server name
  1238. DWORD dwSMTPPort; // SMTP port number
  1239. LPTSTR% lptstrSMTPFrom; // SMTP sender address
  1240. LPTSTR% lptstrSMTPUserName; // SMTP user name (for authenticated connections)
  1241. LPTSTR% lptstrSMTPPassword; // SMTP password (for authenticated connections)
  1242. // This value is always NULL on get and may be NULL
  1243. // on set (won't be written in the server).
  1244. BOOL bIsToUseForMSRouteThroughEmailMethod;
  1245. } FAX_RECEIPTS_CONFIG%, *PFAX_RECEIPTS_CONFIG%;
  1246. WINFAXAPI
  1247. BOOL
  1248. WINAPI
  1249. FaxGetReceiptsConfiguration% (
  1250. IN HANDLE hFaxHandle,
  1251. OUT PFAX_RECEIPTS_CONFIG% *ppReceipts
  1252. );
  1253. WINFAXAPI
  1254. BOOL
  1255. WINAPI
  1256. FaxSetReceiptsConfiguration% (
  1257. IN HANDLE hFaxHandle,
  1258. IN CONST PFAX_RECEIPTS_CONFIG% pReceipts
  1259. );
  1260. WINFAXAPI
  1261. BOOL
  1262. WINAPI
  1263. FaxGetReceiptsOptions (
  1264. IN HANDLE hFaxHandle,
  1265. OUT PDWORD pdwReceiptsOptions // Combination of DRT_EMAIL and DRT_MSGBOX
  1266. );
  1267. //********************************************
  1268. //* Server version
  1269. //********************************************
  1270. typedef struct _FAX_VERSION
  1271. {
  1272. DWORD dwSizeOfStruct; // Size of this structure
  1273. BOOL bValid; // Is version valid?
  1274. WORD wMajorVersion;
  1275. WORD wMinorVersion;
  1276. WORD wMajorBuildNumber;
  1277. WORD wMinorBuildNumber;
  1278. DWORD dwFlags; // Combination of FAX_VER_FLAG_*
  1279. } FAX_VERSION, *PFAX_VERSION;
  1280. typedef enum
  1281. {
  1282. FAX_VER_FLAG_CHECKED = 0x00000001, // File was built in debug mode
  1283. FAX_VER_FLAG_EVALUATION = 0x00000002 // Evaluation build
  1284. } FAX_VERSION_FLAGS;
  1285. WINFAXAPI
  1286. BOOL
  1287. WINAPI
  1288. FaxGetVersion (
  1289. IN HANDLE hFaxHandle,
  1290. OUT PFAX_VERSION pVersion
  1291. );
  1292. #define FAX_API_VERSION_0 0x00000000 // BOS/SBS 2000 Fax Server API (0.0)
  1293. #define FAX_API_VERSION_1 0x00010000 // Windows XP Fax Server API (1.0)
  1294. #define FAX_API_VERSION_2 0x00020000 // Windows Server 2003 Fax Server API (2.0)
  1295. //
  1296. // NOTICE: Change this value whenever a new API version is introduced.
  1297. //
  1298. #define CURRENT_FAX_API_VERSION FAX_API_VERSION_2
  1299. WINFAXAPI
  1300. BOOL
  1301. WINAPI
  1302. FaxGetReportedServerAPIVersion (
  1303. IN HANDLE hFaxHandle,
  1304. OUT LPDWORD lpdwReportedServerAPIVersion
  1305. );
  1306. //********************************************
  1307. //* Activity logging
  1308. //********************************************
  1309. typedef struct _FAX_ACTIVITY_LOGGING_CONFIG%
  1310. {
  1311. DWORD dwSizeOfStruct;
  1312. BOOL bLogIncoming;
  1313. BOOL bLogOutgoing;
  1314. LPTSTR% lptstrDBPath;
  1315. } FAX_ACTIVITY_LOGGING_CONFIG%, *PFAX_ACTIVITY_LOGGING_CONFIG%;
  1316. WINFAXAPI
  1317. BOOL
  1318. WINAPI
  1319. FaxGetActivityLoggingConfiguration% (
  1320. IN HANDLE hFaxHandle,
  1321. OUT PFAX_ACTIVITY_LOGGING_CONFIG% *ppActivLogCfg
  1322. );
  1323. WINFAXAPI
  1324. BOOL
  1325. WINAPI
  1326. FaxSetActivityLoggingConfiguration% (
  1327. IN HANDLE hFaxHandle,
  1328. IN CONST PFAX_ACTIVITY_LOGGING_CONFIG% pActivLogCfg
  1329. );
  1330. //********************************************
  1331. //* Outbox configuration
  1332. //********************************************
  1333. typedef struct _FAX_OUTBOX_CONFIG
  1334. {
  1335. DWORD dwSizeOfStruct;
  1336. BOOL bAllowPersonalCP;
  1337. BOOL bUseDeviceTSID;
  1338. DWORD dwRetries;
  1339. DWORD dwRetryDelay;
  1340. FAX_TIME dtDiscountStart;
  1341. FAX_TIME dtDiscountEnd;
  1342. DWORD dwAgeLimit;
  1343. BOOL bBranding;
  1344. } FAX_OUTBOX_CONFIG, *PFAX_OUTBOX_CONFIG;
  1345. WINFAXAPI
  1346. BOOL
  1347. WINAPI
  1348. FaxGetOutboxConfiguration (
  1349. IN HANDLE hFaxHandle,
  1350. OUT PFAX_OUTBOX_CONFIG *ppOutboxCfg
  1351. );
  1352. WINFAXAPI
  1353. BOOL
  1354. WINAPI
  1355. FaxSetOutboxConfiguration (
  1356. IN HANDLE hFaxHandle,
  1357. IN CONST PFAX_OUTBOX_CONFIG pOutboxCfg
  1358. );
  1359. WINFAXAPI
  1360. BOOL
  1361. WINAPI
  1362. FaxGetPersonalCoverPagesOption (
  1363. IN HANDLE hFaxHandle,
  1364. OUT LPBOOL lpbPersonalCPAllowed
  1365. );
  1366. //********************************************
  1367. //* Archive configuration
  1368. //********************************************
  1369. typedef enum
  1370. {
  1371. FAX_MESSAGE_FOLDER_INBOX,
  1372. FAX_MESSAGE_FOLDER_SENTITEMS,
  1373. FAX_MESSAGE_FOLDER_QUEUE
  1374. } FAX_ENUM_MESSAGE_FOLDER;
  1375. typedef struct _FAX_ARCHIVE_CONFIG%
  1376. {
  1377. DWORD dwSizeOfStruct;
  1378. BOOL bUseArchive;
  1379. LPTSTR% lpcstrFolder;
  1380. BOOL bSizeQuotaWarning;
  1381. DWORD dwSizeQuotaHighWatermark;
  1382. DWORD dwSizeQuotaLowWatermark;
  1383. DWORD dwAgeLimit;
  1384. DWORDLONG dwlArchiveSize;
  1385. } FAX_ARCHIVE_CONFIG%, *PFAX_ARCHIVE_CONFIG%;
  1386. WINFAXAPI
  1387. BOOL
  1388. WINAPI
  1389. FaxGetArchiveConfiguration% (
  1390. IN HANDLE hFaxHandle,
  1391. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1392. OUT PFAX_ARCHIVE_CONFIG% *ppArchiveCfg
  1393. );
  1394. WINFAXAPI
  1395. BOOL
  1396. WINAPI
  1397. FaxSetArchiveConfiguration% (
  1398. IN HANDLE hFaxHandle,
  1399. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1400. IN CONST PFAX_ARCHIVE_CONFIG% pArchiveCfg
  1401. );
  1402. //********************************************
  1403. //* Server activity
  1404. //********************************************
  1405. typedef struct _FAX_SERVER_ACTIVITY
  1406. {
  1407. DWORD dwSizeOfStruct;
  1408. DWORD dwIncomingMessages;
  1409. DWORD dwRoutingMessages;
  1410. DWORD dwOutgoingMessages;
  1411. DWORD dwDelegatedOutgoingMessages;
  1412. DWORD dwQueuedMessages;
  1413. DWORD dwErrorEvents;
  1414. DWORD dwWarningEvents;
  1415. DWORD dwInformationEvents;
  1416. } FAX_SERVER_ACTIVITY, *PFAX_SERVER_ACTIVITY;
  1417. WINFAXAPI
  1418. BOOL
  1419. WINAPI
  1420. FaxGetServerActivity (
  1421. IN HANDLE hFaxHandle,
  1422. OUT PFAX_SERVER_ACTIVITY pServerActivity
  1423. );
  1424. //********************************************
  1425. //* Queue jobs
  1426. //********************************************
  1427. typedef enum
  1428. {
  1429. FAX_PRIORITY_TYPE_LOW,
  1430. FAX_PRIORITY_TYPE_NORMAL,
  1431. FAX_PRIORITY_TYPE_HIGH
  1432. } FAX_ENUM_PRIORITY_TYPE;
  1433. #define FAX_PRIORITY_TYPE_DEFAULT FAX_PRIORITY_TYPE_LOW
  1434. typedef enum
  1435. {
  1436. FAX_JOB_FIELD_JOB_ID = 0x00000001,
  1437. FAX_JOB_FIELD_TYPE = 0x00000002,
  1438. FAX_JOB_FIELD_QUEUE_STATUS = 0x00000004,
  1439. FAX_JOB_FIELD_STATUS_EX = 0x00000008,
  1440. FAX_JOB_FIELD_SIZE = 0x00000010,
  1441. FAX_JOB_FIELD_PAGE_COUNT = 0x00000020,
  1442. FAX_JOB_FIELD_CURRENT_PAGE = 0x00000040,
  1443. FAX_JOB_FIELD_RECIPIENT_PROFILE = 0x00000080,
  1444. FAX_JOB_FIELD_SCHEDULE_TIME = 0x00000100,
  1445. FAX_JOB_FIELD_ORIGINAL_SCHEDULE_TIME = 0x00000200,
  1446. FAX_JOB_FIELD_SUBMISSION_TIME = 0x00000400,
  1447. FAX_JOB_FIELD_TRANSMISSION_START_TIME = 0x00000800,
  1448. FAX_JOB_FIELD_TRANSMISSION_END_TIME = 0x00001000,
  1449. FAX_JOB_FIELD_PRIORITY = 0x00002000,
  1450. FAX_JOB_FIELD_RETRIES = 0x00004000,
  1451. FAX_JOB_FIELD_DELIVERY_REPORT_TYPE = 0x00008000,
  1452. FAX_JOB_FIELD_SENDER_PROFILE = 0x00010000,
  1453. FAX_JOB_FIELD_STATUS_SUB_STRUCT = 0x00020000,
  1454. FAX_JOB_FIELD_DEVICE_ID = 0x00040000,
  1455. FAX_JOB_FIELD_MESSAGE_ID = 0x00080000,
  1456. FAX_JOB_FIELD_BROADCAST_ID = 0x00010000
  1457. } FAX_ENUM_JOB_FIELDS;
  1458. typedef struct _FAX_JOB_STATUS%
  1459. {
  1460. DWORD dwSizeOfStruct;
  1461. DWORD dwValidityMask;
  1462. DWORD dwJobID;
  1463. DWORD dwJobType;
  1464. DWORD dwQueueStatus;
  1465. DWORD dwExtendedStatus;
  1466. LPCTSTR% lpctstrExtendedStatus;
  1467. DWORD dwSize;
  1468. DWORD dwPageCount;
  1469. DWORD dwCurrentPage;
  1470. LPCTSTR% lpctstrTsid;
  1471. LPCTSTR% lpctstrCsid;
  1472. SYSTEMTIME tmScheduleTime;
  1473. SYSTEMTIME tmTransmissionStartTime;
  1474. SYSTEMTIME tmTransmissionEndTime;
  1475. DWORD dwDeviceID;
  1476. LPCTSTR% lpctstrDeviceName;
  1477. DWORD dwRetries;
  1478. LPCTSTR% lpctstrCallerID;
  1479. LPCTSTR% lpctstrRoutingInfo;
  1480. DWORD dwAvailableJobOperations;
  1481. } FAX_JOB_STATUS%, *PFAX_JOB_STATUS%;
  1482. typedef struct _FAX_JOB_ENTRY_EX%
  1483. {
  1484. DWORD dwSizeOfStruct;
  1485. DWORD dwValidityMask;
  1486. DWORDLONG dwlMessageId;
  1487. DWORDLONG dwlBroadcastId;
  1488. LPCTSTR% lpctstrRecipientNumber;
  1489. LPCTSTR% lpctstrRecipientName;
  1490. LPCTSTR% lpctstrSenderUserName;
  1491. LPCTSTR% lpctstrBillingCode;
  1492. SYSTEMTIME tmOriginalScheduleTime;
  1493. SYSTEMTIME tmSubmissionTime;
  1494. FAX_ENUM_PRIORITY_TYPE Priority;
  1495. DWORD dwDeliveryReportType;
  1496. LPCTSTR% lpctstrDocumentName;
  1497. LPCTSTR% lpctstrSubject;
  1498. PFAX_JOB_STATUS% pStatus;
  1499. } FAX_JOB_ENTRY_EX%, *PFAX_JOB_ENTRY_EX%;
  1500. typedef struct _FAX_JOB_PARAM_EX%
  1501. {
  1502. DWORD dwSizeOfStruct;
  1503. DWORD dwScheduleAction;
  1504. SYSTEMTIME tmSchedule;
  1505. DWORD dwReceiptDeliveryType;
  1506. LPTSTR% lptstrReceiptDeliveryAddress;
  1507. FAX_ENUM_PRIORITY_TYPE Priority;
  1508. HCALL hCall;
  1509. DWORD_PTR dwReserved[4];
  1510. LPTSTR% lptstrDocumentName;
  1511. DWORD dwPageCount;
  1512. } FAX_JOB_PARAM_EX%, *PFAX_JOB_PARAM_EX%;
  1513. WINFAXAPI
  1514. BOOL
  1515. WINAPI FaxEnumJobsEx% (
  1516. IN HANDLE hFaxHandle,
  1517. IN DWORD dwJobTypes,
  1518. OUT PFAX_JOB_ENTRY_EX% *ppJobEntries,
  1519. OUT LPDWORD lpdwJobs
  1520. );
  1521. WINFAXAPI
  1522. BOOL
  1523. WINAPI
  1524. FaxGetJobEx% (
  1525. IN HANDLE hFaxHandle,
  1526. IN DWORDLONG dwlMessageID,
  1527. OUT PFAX_JOB_ENTRY_EX% *ppJobEntry
  1528. );
  1529. typedef const FAX_JOB_PARAM_EXW * LPCFAX_JOB_PARAM_EXW;
  1530. typedef const FAX_JOB_PARAM_EXA * LPCFAX_JOB_PARAM_EXA;
  1531. #ifdef UNICODE
  1532. typedef LPCFAX_JOB_PARAM_EXW LPCFAX_JOB_PARAM_EX;
  1533. #else
  1534. typedef LPCFAX_JOB_PARAM_EXA LPCFAX_JOB_PARAM_EX;
  1535. #endif
  1536. typedef enum
  1537. {
  1538. FAX_COVERPAGE_FMT_COV = 1,
  1539. FAX_COVERPAGE_FMT_COV_SUBJECT_ONLY
  1540. } FAX_ENUM_COVERPAGE_FORMATS;
  1541. typedef struct _FAX_COVERPAGE_INFO_EX%
  1542. {
  1543. DWORD dwSizeOfStruct;
  1544. DWORD dwCoverPageFormat;
  1545. LPTSTR% lptstrCoverPageFileName;
  1546. BOOL bServerBased;
  1547. LPTSTR% lptstrNote;
  1548. LPTSTR% lptstrSubject;
  1549. } FAX_COVERPAGE_INFO_EX%, *PFAX_COVERPAGE_INFO_EX%;
  1550. typedef const FAX_COVERPAGE_INFO_EXW * LPCFAX_COVERPAGE_INFO_EXW;
  1551. typedef const FAX_COVERPAGE_INFO_EXA * LPCFAX_COVERPAGE_INFO_EXA;
  1552. #ifdef UNICODE
  1553. typedef LPCFAX_COVERPAGE_INFO_EXW LPCFAX_COVERPAGE_INFO_EX;
  1554. #else
  1555. typedef LPCFAX_COVERPAGE_INFO_EXA LPCFAX_COVERPAGE_INFO_EX;
  1556. #endif
  1557. typedef struct _FAX_PERSONAL_PROFILE%
  1558. {
  1559. DWORD dwSizeOfStruct; // Size of this structure
  1560. LPTSTR% lptstrName; // Name of person
  1561. LPTSTR% lptstrFaxNumber; // Fax number
  1562. LPTSTR% lptstrCompany; // Company name
  1563. LPTSTR% lptstrStreetAddress; // Street address
  1564. LPTSTR% lptstrCity; // City
  1565. LPTSTR% lptstrState; // State
  1566. LPTSTR% lptstrZip; // Zip code
  1567. LPTSTR% lptstrCountry; // Country
  1568. LPTSTR% lptstrTitle; // Title
  1569. LPTSTR% lptstrDepartment; // Department
  1570. LPTSTR% lptstrOfficeLocation; // Office location
  1571. LPTSTR% lptstrHomePhone; // Phone number at home
  1572. LPTSTR% lptstrOfficePhone; // Phone number at office
  1573. LPTSTR% lptstrEmail; // Personal e-mail address
  1574. LPTSTR% lptstrBillingCode; // Billing code
  1575. LPTSTR% lptstrTSID; // Tsid
  1576. } FAX_PERSONAL_PROFILE%, *PFAX_PERSONAL_PROFILE%;
  1577. typedef const FAX_PERSONAL_PROFILEW * LPCFAX_PERSONAL_PROFILEW;
  1578. typedef const FAX_PERSONAL_PROFILEA * LPCFAX_PERSONAL_PROFILEA;
  1579. #ifdef UNICODE
  1580. typedef LPCFAX_PERSONAL_PROFILEW LPCFAX_PERSONAL_PROFILE;
  1581. #else
  1582. typedef LPCFAX_PERSONAL_PROFILEA LPCFAX_PERSONAL_PROFILE;
  1583. #endif
  1584. BOOL WINAPI FaxSendDocumentEx%
  1585. (
  1586. IN HANDLE hFaxHandle,
  1587. IN LPCTSTR% lpctstrFileName,
  1588. IN LPCFAX_COVERPAGE_INFO_EX% lpcCoverPageInfo,
  1589. IN LPCFAX_PERSONAL_PROFILE% lpcSenderProfile,
  1590. IN DWORD dwNumRecipients,
  1591. IN LPCFAX_PERSONAL_PROFILE% lpcRecipientList,
  1592. IN LPCFAX_JOB_PARAM_EX% lpJobParams,
  1593. OUT PDWORDLONG lpdwlMessageId,
  1594. OUT PDWORDLONG lpdwlRecipientMessageIds
  1595. );
  1596. typedef BOOL
  1597. (WINAPI *PFAXSENDDOCUMENTEX%)(
  1598. IN HANDLE hFaxHandle,
  1599. IN LPCTSTR% lpctstrFileName,
  1600. IN LPCFAX_COVERPAGE_INFO_EX% lpcCoverPageInfo,
  1601. IN LPCFAX_PERSONAL_PROFILE% lpcSenderProfile,
  1602. IN DWORD dwNumRecipients,
  1603. IN LPCFAX_PERSONAL_PROFILE% lpcRecipientList,
  1604. IN LPCFAX_JOB_PARAM_EX% lpcJobParams,
  1605. OUT PDWORDLONG lpdwlMessageId,
  1606. OUT PDWORDLONG lpdwlRecipientMessageIds
  1607. );
  1608. //********************************************
  1609. //* Archive jobs
  1610. //********************************************
  1611. typedef struct _FAX_MESSAGE%
  1612. {
  1613. DWORD dwSizeOfStruct;
  1614. DWORD dwValidityMask;
  1615. DWORDLONG dwlMessageId;
  1616. DWORDLONG dwlBroadcastId;
  1617. DWORD dwJobType;
  1618. DWORD dwQueueStatus;
  1619. DWORD dwExtendedStatus;
  1620. LPCTSTR% lpctstrExtendedStatus;
  1621. DWORD dwSize;
  1622. DWORD dwPageCount;
  1623. LPCTSTR% lpctstrRecipientNumber;
  1624. LPCTSTR% lpctstrRecipientName;
  1625. LPCTSTR% lpctstrSenderNumber;
  1626. LPCTSTR% lpctstrSenderName;
  1627. LPCTSTR% lpctstrTsid;
  1628. LPCTSTR% lpctstrCsid;
  1629. LPCTSTR% lpctstrSenderUserName;
  1630. LPCTSTR% lpctstrBillingCode;
  1631. SYSTEMTIME tmOriginalScheduleTime;
  1632. SYSTEMTIME tmSubmissionTime;
  1633. SYSTEMTIME tmTransmissionStartTime;
  1634. SYSTEMTIME tmTransmissionEndTime;
  1635. LPCTSTR% lpctstrDeviceName;
  1636. FAX_ENUM_PRIORITY_TYPE Priority;
  1637. DWORD dwRetries;
  1638. LPCTSTR% lpctstrDocumentName;
  1639. LPCTSTR% lpctstrSubject;
  1640. LPCTSTR% lpctstrCallerID;
  1641. LPCTSTR% lpctstrRoutingInfo;
  1642. } FAX_MESSAGE%, *PFAX_MESSAGE%;
  1643. WINFAXAPI
  1644. BOOL
  1645. WINAPI
  1646. FaxStartMessagesEnum (
  1647. IN HANDLE hFaxHandle,
  1648. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1649. OUT PHANDLE phEnum
  1650. );
  1651. WINFAXAPI
  1652. BOOL
  1653. WINAPI
  1654. FaxEndMessagesEnum (
  1655. IN HANDLE hEnum
  1656. );
  1657. WINFAXAPI
  1658. BOOL
  1659. WINAPI
  1660. FaxEnumMessages% (
  1661. IN HANDLE hEnum,
  1662. IN DWORD dwNumMessages,
  1663. OUT PFAX_MESSAGE% *ppMsgs,
  1664. OUT LPDWORD lpdwReturnedMsgs
  1665. );
  1666. WINFAXAPI
  1667. BOOL
  1668. WINAPI
  1669. FaxGetMessage% (
  1670. IN HANDLE hFaxHandle,
  1671. IN DWORDLONG dwlMessageId,
  1672. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1673. OUT PFAX_MESSAGE% *ppMsg
  1674. );
  1675. WINFAXAPI
  1676. BOOL
  1677. WINAPI
  1678. FaxRemoveMessage (
  1679. IN HANDLE hFaxHandle,
  1680. IN DWORDLONG dwlMessageId,
  1681. IN FAX_ENUM_MESSAGE_FOLDER Folder
  1682. );
  1683. WINFAXAPI
  1684. BOOL
  1685. WINAPI
  1686. FaxGetMessageTiff% (
  1687. IN HANDLE hFaxHandle,
  1688. IN DWORDLONG dwlMessageId,
  1689. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1690. IN LPCTSTR% lpctstrFilePath
  1691. );
  1692. //************************************
  1693. //* Non-RPC extended interfaces
  1694. //************************************
  1695. HRESULT WINAPI
  1696. FaxFreeSenderInformation(
  1697. PFAX_PERSONAL_PROFILE pfppSender
  1698. );
  1699. HRESULT WINAPI
  1700. FaxSetSenderInformation(
  1701. PFAX_PERSONAL_PROFILE pfppSender
  1702. );
  1703. HRESULT WINAPI
  1704. FaxGetSenderInformation(
  1705. PFAX_PERSONAL_PROFILE pfppSender
  1706. );
  1707. //********************************************
  1708. //* Security
  1709. //********************************************
  1710. //
  1711. // Specific access rights
  1712. //
  1713. typedef enum
  1714. {
  1715. FAX_ACCESS_SUBMIT = 0x0001,
  1716. FAX_ACCESS_SUBMIT_NORMAL = 0x0002,
  1717. FAX_ACCESS_SUBMIT_HIGH = 0x0004,
  1718. FAX_ACCESS_QUERY_JOBS = 0x0008,
  1719. FAX_ACCESS_MANAGE_JOBS = 0x0010,
  1720. FAX_ACCESS_QUERY_CONFIG = 0x0020,
  1721. FAX_ACCESS_MANAGE_CONFIG = 0x0040,
  1722. FAX_ACCESS_QUERY_IN_ARCHIVE = 0x0080,
  1723. FAX_ACCESS_MANAGE_IN_ARCHIVE = 0x0100,
  1724. FAX_ACCESS_QUERY_OUT_ARCHIVE = 0x0200,
  1725. FAX_ACCESS_MANAGE_OUT_ARCHIVE = 0x0400
  1726. } FAX_SPECIFIC_ACCESS_RIGHTS;
  1727. #define FAX_GENERIC_READ (FAX_ACCESS_QUERY_JOBS | FAX_ACCESS_QUERY_CONFIG | FAX_ACCESS_QUERY_IN_ARCHIVE | FAX_ACCESS_QUERY_OUT_ARCHIVE)
  1728. #define FAX_GENERIC_WRITE (FAX_ACCESS_MANAGE_JOBS | FAX_ACCESS_MANAGE_CONFIG | FAX_ACCESS_MANAGE_IN_ARCHIVE | FAX_ACCESS_MANAGE_OUT_ARCHIVE)
  1729. #define FAX_GENERIC_EXECUTE (FAX_ACCESS_SUBMIT)
  1730. #define FAX_GENERIC_ALL (FAX_ACCESS_SUBMIT | \
  1731. FAX_ACCESS_SUBMIT_NORMAL | \
  1732. FAX_ACCESS_SUBMIT_HIGH | \
  1733. FAX_ACCESS_QUERY_JOBS | \
  1734. FAX_ACCESS_MANAGE_JOBS | \
  1735. FAX_ACCESS_QUERY_CONFIG | \
  1736. FAX_ACCESS_MANAGE_CONFIG | \
  1737. FAX_ACCESS_QUERY_IN_ARCHIVE | \
  1738. FAX_ACCESS_MANAGE_IN_ARCHIVE | \
  1739. FAX_ACCESS_QUERY_OUT_ARCHIVE | \
  1740. FAX_ACCESS_MANAGE_OUT_ARCHIVE)
  1741. //
  1742. // Functions
  1743. //
  1744. //********************************************
  1745. //* Security
  1746. //********************************************
  1747. WINFAXAPI
  1748. BOOL
  1749. WINAPI
  1750. FaxGetSecurity (
  1751. IN HANDLE hFaxHandle,
  1752. OUT PSECURITY_DESCRIPTOR *ppSecDesc
  1753. );
  1754. WINFAXAPI
  1755. BOOL
  1756. WINAPI
  1757. FaxGetSecurityEx (
  1758. IN HANDLE hFaxHandle,
  1759. IN SECURITY_INFORMATION SecurityInformation,
  1760. OUT PSECURITY_DESCRIPTOR *ppSecDesc
  1761. );
  1762. WINFAXAPI
  1763. BOOL
  1764. WINAPI
  1765. FaxSetSecurity (
  1766. IN HANDLE hFaxHandle,
  1767. IN SECURITY_INFORMATION SecurityInformation,
  1768. IN CONST PSECURITY_DESCRIPTOR pSecDesc
  1769. );
  1770. WINFAXAPI
  1771. BOOL
  1772. WINAPI
  1773. FaxAccessCheckEx (
  1774. IN HANDLE FaxHandle,
  1775. IN DWORD AccessMask,
  1776. OUT LPDWORD lpdwRights
  1777. );
  1778. //********************************************
  1779. //* Extension data
  1780. //********************************************
  1781. WINFAXAPI
  1782. BOOL
  1783. WINAPI
  1784. FaxGetExtensionData% (
  1785. IN HANDLE hFaxHandle,
  1786. IN DWORD dwDeviceID,
  1787. IN LPCTSTR% lpctstrNameGUID,
  1788. OUT PVOID *ppData,
  1789. OUT LPDWORD lpdwDataSize
  1790. );
  1791. WINFAXAPI
  1792. BOOL
  1793. WINAPI
  1794. FaxSetExtensionData% (
  1795. IN HANDLE hFaxHandle,
  1796. IN DWORD dwDeviceID,
  1797. IN LPCTSTR% lpctstrNameGUID,
  1798. IN CONST PVOID pData,
  1799. IN CONST DWORD dwDataSize
  1800. );
  1801. //********************************************
  1802. //* FSP
  1803. //********************************************
  1804. typedef enum
  1805. {
  1806. FAX_PROVIDER_STATUS_SUCCESS, // Provider was successfully loaded
  1807. FAX_PROVIDER_STATUS_SERVER_ERROR,// An error occured on the server while loading provider.
  1808. FAX_PROVIDER_STATUS_BAD_GUID, // Provider's GUID is invalid
  1809. FAX_PROVIDER_STATUS_BAD_VERSION, // Provider's API version is invalid
  1810. FAX_PROVIDER_STATUS_CANT_LOAD, // Can't load provider's DLL
  1811. FAX_PROVIDER_STATUS_CANT_LINK, // Can't find required exported function(s) in provider's DLL
  1812. FAX_PROVIDER_STATUS_CANT_INIT // Failed while initializing provider
  1813. } FAX_ENUM_PROVIDER_STATUS;
  1814. typedef struct _FAX_DEVICE_PROVIDER_INFO%
  1815. {
  1816. DWORD dwSizeOfStruct;
  1817. LPCTSTR% lpctstrFriendlyName;
  1818. LPCTSTR% lpctstrImageName;
  1819. LPCTSTR% lpctstrProviderName;
  1820. LPCTSTR% lpctstrGUID;
  1821. DWORD dwCapabilities;
  1822. FAX_VERSION Version;
  1823. FAX_ENUM_PROVIDER_STATUS Status;
  1824. DWORD dwLastError;
  1825. } FAX_DEVICE_PROVIDER_INFO%, *PFAX_DEVICE_PROVIDER_INFO%;
  1826. WINFAXAPI
  1827. BOOL
  1828. WINAPI
  1829. FaxEnumerateProviders% (
  1830. IN HANDLE hFaxHandle,
  1831. OUT PFAX_DEVICE_PROVIDER_INFO% *ppProviders,
  1832. OUT LPDWORD lpdwNumProviders
  1833. );
  1834. //********************************************
  1835. //* Routing extensions
  1836. //********************************************
  1837. typedef struct _FAX_ROUTING_EXTENSION_INFO%
  1838. {
  1839. DWORD dwSizeOfStruct;
  1840. LPCTSTR% lpctstrFriendlyName;
  1841. LPCTSTR% lpctstrImageName;
  1842. LPCTSTR% lpctstrExtensionName;
  1843. FAX_VERSION Version;
  1844. FAX_ENUM_PROVIDER_STATUS Status;
  1845. DWORD dwLastError;
  1846. } FAX_ROUTING_EXTENSION_INFO%, *PFAX_ROUTING_EXTENSION_INFO%;
  1847. WINFAXAPI
  1848. BOOL
  1849. WINAPI
  1850. FaxEnumRoutingExtensions% (
  1851. IN HANDLE hFaxHandle,
  1852. OUT PFAX_ROUTING_EXTENSION_INFO% *ppRoutingExtensions,
  1853. OUT LPDWORD lpdwNumExtensions
  1854. );
  1855. //********************************************
  1856. //* Ports
  1857. //********************************************
  1858. typedef enum
  1859. {
  1860. FAX_DEVICE_STATUS_POWERED_OFF = 0x0001,
  1861. FAX_DEVICE_STATUS_SENDING = 0x0002,
  1862. FAX_DEVICE_STATUS_RECEIVING = 0x0004,
  1863. FAX_DEVICE_STATUS_RINGING = 0x0008
  1864. } FAX_ENUM_DEVICE_STATUS;
  1865. typedef enum
  1866. {
  1867. FAX_DEVICE_RECEIVE_MODE_OFF = 0, // Do not answer to incoming calls
  1868. FAX_DEVICE_RECEIVE_MODE_AUTO = 1, // Automatically answer to incoming calls after dwRings rings
  1869. FAX_DEVICE_RECEIVE_MODE_MANUAL = 2 // Manually answer to incoming calls - only FaxAnswerCall answers the call
  1870. } FAX_ENUM_DEVICE_RECEIVE_MODE;
  1871. typedef struct _FAX_PORT_INFO_EX%
  1872. {
  1873. DWORD dwSizeOfStruct; // For versioning
  1874. DWORD dwDeviceID; // Fax id
  1875. LPCTSTR% lpctstrDeviceName; // Name of the device
  1876. LPTSTR% lptstrDescription; // Descriptive string
  1877. LPCTSTR% lpctstrProviderName; // FSP's name
  1878. LPCTSTR% lpctstrProviderGUID; // FSP's GUID
  1879. BOOL bSend; // Is the device send-enabled?
  1880. FAX_ENUM_DEVICE_RECEIVE_MODE ReceiveMode; // The device receive mode. See FAX_ENUM_DEVICE_RECEIVE_MODE for details.
  1881. DWORD dwStatus; // Device status - a combination of values from FAX_ENUM_DEVICE_STATUS
  1882. DWORD dwRings; // Number of rings before answering an incoming call
  1883. LPTSTR% lptstrCsid; // Called Station Id
  1884. LPTSTR% lptstrTsid; // Transmitting Station Id
  1885. } FAX_PORT_INFO_EX%, *PFAX_PORT_INFO_EX%;
  1886. WINFAXAPI
  1887. DWORD
  1888. WINAPI
  1889. IsDeviceVirtual (
  1890. IN HANDLE hFaxHandle,
  1891. IN DWORD dwDeviceId,
  1892. OUT LPBOOL lpbVirtual
  1893. );
  1894. WINFAXAPI
  1895. BOOL
  1896. WINAPI
  1897. FaxGetPortEx% (
  1898. IN HANDLE hFaxHandle,
  1899. IN DWORD dwDeviceId,
  1900. OUT PFAX_PORT_INFO_EX% *ppPortInfo
  1901. );
  1902. WINFAXAPI
  1903. BOOL
  1904. WINAPI
  1905. FaxSetPortEx% (
  1906. IN HANDLE hFaxHandle,
  1907. IN DWORD dwDeviceId,
  1908. IN PFAX_PORT_INFO_EX% pPortInfo
  1909. );
  1910. WINFAXAPI
  1911. BOOL
  1912. WINAPI
  1913. FaxEnumPortsEx% (
  1914. IN HANDLE hFaxHandle,
  1915. OUT PFAX_PORT_INFO_EX% *ppPorts,
  1916. OUT LPDWORD lpdwNumPorts
  1917. );
  1918. //********************************************
  1919. //* Recipient and sender information
  1920. //********************************************
  1921. WINFAXAPI
  1922. BOOL
  1923. WINAPI
  1924. FaxGetRecipientInfo% (
  1925. IN HANDLE hFaxHandle,
  1926. IN DWORDLONG dwlMessageId,
  1927. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1928. OUT PFAX_PERSONAL_PROFILE% *lpPersonalProfile
  1929. );
  1930. WINFAXAPI
  1931. BOOL
  1932. WINAPI
  1933. FaxGetSenderInfo% (
  1934. IN HANDLE hFaxHandle,
  1935. IN DWORDLONG dwlMessageId,
  1936. IN FAX_ENUM_MESSAGE_FOLDER Folder,
  1937. OUT PFAX_PERSONAL_PROFILE% *lpPersonalProfile
  1938. );
  1939. //********************************************
  1940. //* Outbound routing groups
  1941. //********************************************
  1942. typedef enum
  1943. {
  1944. FAX_GROUP_STATUS_ALL_DEV_VALID,
  1945. FAX_GROUP_STATUS_EMPTY,
  1946. FAX_GROUP_STATUS_ALL_DEV_NOT_VALID,
  1947. FAX_GROUP_STATUS_SOME_DEV_NOT_VALID,
  1948. } FAX_ENUM_GROUP_STATUS;
  1949. typedef struct _FAX_OUTBOUND_ROUTING_GROUP%
  1950. {
  1951. DWORD dwSizeOfStruct;
  1952. LPCTSTR% lpctstrGroupName;
  1953. DWORD dwNumDevices;
  1954. LPDWORD lpdwDevices;
  1955. FAX_ENUM_GROUP_STATUS Status;
  1956. } FAX_OUTBOUND_ROUTING_GROUP%, *PFAX_OUTBOUND_ROUTING_GROUP%;
  1957. WINFAXAPI
  1958. BOOL
  1959. WINAPI
  1960. FaxEnumOutboundGroups% (
  1961. IN HANDLE hFaxHandle,
  1962. OUT PFAX_OUTBOUND_ROUTING_GROUP% *ppGroups,
  1963. OUT LPDWORD lpdwNumGroups
  1964. );
  1965. WINFAXAPI
  1966. BOOL
  1967. WINAPI
  1968. FaxSetOutboundGroup% (
  1969. IN HANDLE hFaxHandle,
  1970. IN PFAX_OUTBOUND_ROUTING_GROUP% pGroup
  1971. );
  1972. WINFAXAPI
  1973. BOOL
  1974. WINAPI
  1975. FaxAddOutboundGroup% (
  1976. IN HANDLE hFaxHandle,
  1977. IN LPCTSTR% lpctstrGroupName
  1978. );
  1979. WINFAXAPI
  1980. BOOL
  1981. WINAPI
  1982. FaxRemoveOutboundGroup% (
  1983. IN HANDLE hFaxHandle,
  1984. IN LPCTSTR% lpctstrGroupName
  1985. );
  1986. BOOL
  1987. WINAPI
  1988. FaxSetDeviceOrderInGroup% (
  1989. IN HANDLE hFaxHandle,
  1990. IN LPCTSTR% lpctstrGroupName,
  1991. IN DWORD dwDeviceId,
  1992. IN DWORD dwNewOrder
  1993. );
  1994. //********************************************
  1995. //* Outbound routing rules
  1996. //********************************************
  1997. typedef enum
  1998. {
  1999. FAX_RULE_STATUS_VALID,
  2000. FAX_RULE_STATUS_EMPTY_GROUP, // The rule's destination group has no devices
  2001. FAX_RULE_STATUS_ALL_GROUP_DEV_NOT_VALID, // The rule's destination group has valid devices
  2002. FAX_RULE_STATUS_SOME_GROUP_DEV_NOT_VALID, // The rule's destination group has some invalid devices
  2003. FAX_RULE_STATUS_BAD_DEVICE // The rule's destination device is not valid
  2004. } FAX_ENUM_RULE_STATUS;
  2005. typedef struct _FAX_OUTBOUND_ROUTING_RULE%
  2006. {
  2007. DWORD dwSizeOfStruct;
  2008. DWORD dwAreaCode;
  2009. DWORD dwCountryCode;
  2010. LPCTSTR% lpctstrCountryName;
  2011. union
  2012. {
  2013. DWORD dwDeviceId;
  2014. LPCTSTR% lpcstrGroupName;
  2015. } Destination;
  2016. BOOL bUseGroup;
  2017. FAX_ENUM_RULE_STATUS Status;
  2018. } FAX_OUTBOUND_ROUTING_RULE%, *PFAX_OUTBOUND_ROUTING_RULE%;
  2019. WINFAXAPI
  2020. BOOL
  2021. WINAPI
  2022. FaxEnumOutboundRules% (
  2023. IN HANDLE hFaxHandle,
  2024. OUT PFAX_OUTBOUND_ROUTING_RULE% *ppRules,
  2025. OUT LPDWORD lpdwNumRules
  2026. );
  2027. WINFAXAPI
  2028. BOOL
  2029. WINAPI
  2030. FaxSetOutboundRule% (
  2031. IN HANDLE hFaxHandle,
  2032. IN PFAX_OUTBOUND_ROUTING_RULE% pRule
  2033. );
  2034. WINFAXAPI
  2035. BOOL
  2036. WINAPI
  2037. FaxAddOutboundRule% (
  2038. IN HANDLE hFaxHandle,
  2039. IN DWORD dwAreaCode,
  2040. IN DWORD dwCountryCode,
  2041. IN DWORD dwDeviceID,
  2042. IN LPCTSTR% lpctstrGroupName,
  2043. IN BOOL bUseGroup
  2044. );
  2045. WINFAXAPI
  2046. BOOL
  2047. WINAPI
  2048. FaxRemoveOutboundRule (
  2049. IN HANDLE hFaxHandle,
  2050. IN DWORD dwAreaCode,
  2051. IN DWORD dwCountryCode
  2052. );
  2053. //********************************************
  2054. //* TAPI countries support
  2055. //********************************************
  2056. typedef struct _FAX_TAPI_LINECOUNTRY_ENTRY%
  2057. {
  2058. DWORD dwCountryID;
  2059. DWORD dwCountryCode;
  2060. LPCTSTR% lpctstrCountryName;
  2061. LPCTSTR% lpctstrLongDistanceRule;
  2062. } FAX_TAPI_LINECOUNTRY_ENTRY%, *PFAX_TAPI_LINECOUNTRY_ENTRY%;
  2063. typedef struct _FAX_TAPI_LINECOUNTRY_LIST%
  2064. {
  2065. DWORD dwNumCountries;
  2066. PFAX_TAPI_LINECOUNTRY_ENTRY% LineCountryEntries;
  2067. } FAX_TAPI_LINECOUNTRY_LIST%, *PFAX_TAPI_LINECOUNTRY_LIST%;
  2068. WINFAXAPI
  2069. BOOL
  2070. WINAPI
  2071. FaxGetCountryList% (
  2072. IN HANDLE hFaxHandle,
  2073. OUT PFAX_TAPI_LINECOUNTRY_LIST% *ppCountryListBuffer
  2074. );
  2075. //********************************************
  2076. //* FSP registration
  2077. //********************************************
  2078. WINFAXAPI
  2079. BOOL
  2080. WINAPI
  2081. FaxRegisterServiceProviderEx%(
  2082. IN HANDLE hFaxHandle,
  2083. IN LPCTSTR% lpctstrGUID,
  2084. IN LPCTSTR% lpctstrFriendlyName,
  2085. IN LPCTSTR% lpctstrImageName,
  2086. IN LPCTSTR% lpctstrTspName,
  2087. IN DWORD dwFSPIVersion,
  2088. IN DWORD dwCapabilities
  2089. );
  2090. WINFAXAPI
  2091. BOOL
  2092. WINAPI
  2093. FaxUnregisterServiceProviderEx%(
  2094. IN HANDLE hFaxHandle,
  2095. IN LPCTSTR% lpctstrGUID
  2096. );
  2097. //********************************************
  2098. //* Server events
  2099. //********************************************
  2100. typedef enum
  2101. {
  2102. FAX_EVENT_TYPE_LEGACY = 0x00000000,
  2103. FAX_EVENT_TYPE_IN_QUEUE = 0x00000001,
  2104. FAX_EVENT_TYPE_OUT_QUEUE = 0x00000002,
  2105. FAX_EVENT_TYPE_CONFIG = 0x00000004,
  2106. FAX_EVENT_TYPE_ACTIVITY = 0x00000008,
  2107. FAX_EVENT_TYPE_QUEUE_STATE = 0x00000010,
  2108. FAX_EVENT_TYPE_IN_ARCHIVE = 0x00000020,
  2109. FAX_EVENT_TYPE_OUT_ARCHIVE = 0x00000040,
  2110. FAX_EVENT_TYPE_FXSSVC_ENDED = 0x00000080,
  2111. FAX_EVENT_TYPE_DEVICE_STATUS = 0x00000100,
  2112. FAX_EVENT_TYPE_NEW_CALL = 0x00000200
  2113. } FAX_ENUM_EVENT_TYPE;
  2114. typedef enum
  2115. {
  2116. FAX_JOB_EVENT_TYPE_ADDED,
  2117. FAX_JOB_EVENT_TYPE_REMOVED,
  2118. FAX_JOB_EVENT_TYPE_STATUS
  2119. } FAX_ENUM_JOB_EVENT_TYPE;
  2120. typedef enum
  2121. {
  2122. FAX_CONFIG_TYPE_RECEIPTS,
  2123. FAX_CONFIG_TYPE_ACTIVITY_LOGGING,
  2124. FAX_CONFIG_TYPE_OUTBOX,
  2125. FAX_CONFIG_TYPE_SENTITEMS,
  2126. FAX_CONFIG_TYPE_INBOX,
  2127. FAX_CONFIG_TYPE_SECURITY,
  2128. FAX_CONFIG_TYPE_EVENTLOGS,
  2129. FAX_CONFIG_TYPE_DEVICES,
  2130. FAX_CONFIG_TYPE_OUT_GROUPS,
  2131. FAX_CONFIG_TYPE_OUT_RULES
  2132. } FAX_ENUM_CONFIG_TYPE;
  2133. typedef struct _FAX_EVENT_JOB%
  2134. {
  2135. DWORDLONG dwlMessageId;
  2136. FAX_ENUM_JOB_EVENT_TYPE Type;
  2137. PFAX_JOB_STATUS% pJobData;
  2138. } FAX_EVENT_JOB%, *PFAX_EVENT_JOB%;
  2139. typedef struct _FAX_EVENT_DEVICE_STATUS
  2140. {
  2141. DWORD dwDeviceId; // Id of the device whose status has just changed
  2142. DWORD dwNewStatus; // The new status - a combination of values from FAX_ENUM_DEVICE_STATUS
  2143. } FAX_EVENT_DEVICE_STATUS, *PFAX_EVENT_DEVICE_STATUS;
  2144. typedef struct _FAX_EVENT_NEW_CALL%
  2145. {
  2146. HCALL hCall;
  2147. DWORD dwDeviceId;
  2148. LPTSTR lptstrCallerId;
  2149. } FAX_EVENT_NEW_CALL%, *PFAX_EVENT_NEW_CALL%;
  2150. typedef struct _FAX_EVENT_EX%
  2151. {
  2152. DWORD dwSizeOfStruct;
  2153. FILETIME TimeStamp;
  2154. FAX_ENUM_EVENT_TYPE EventType;
  2155. union
  2156. {
  2157. FAX_EVENT_JOB% JobInfo;
  2158. FAX_ENUM_CONFIG_TYPE ConfigType;
  2159. FAX_SERVER_ACTIVITY ActivityInfo;
  2160. FAX_EVENT_NEW_CALL NewCall;
  2161. DWORD dwQueueStates;
  2162. FAX_EVENT_DEVICE_STATUS DeviceStatus;
  2163. } EventInfo;
  2164. } FAX_EVENT_EX%, *PFAX_EVENT_EX%;
  2165. //-------------------------------------------------------------------------------
  2166. // Printers Info
  2167. //-------------------------------------------------------------------------------
  2168. typedef struct _FAX_PRINTER_INFO%
  2169. {
  2170. LPTSTR% lptstrPrinterName;
  2171. LPTSTR% lptstrServerName;
  2172. LPTSTR% lptstrDriverName;
  2173. } FAX_PRINTER_INFO%, *PFAX_PRINTER_INFO%;
  2174. WINFAXAPI
  2175. BOOL
  2176. WINAPI
  2177. FaxGetServicePrinters%(
  2178. IN HANDLE hFaxHandle,
  2179. OUT PFAX_PRINTER_INFO% *ppPrinterInfo,
  2180. OUT LPDWORD lpdwPrintersReturned
  2181. );
  2182. typedef BOOL
  2183. (WINAPI *PFAXGETSERVICEPRINTERS%)(
  2184. IN HANDLE hFaxHandle,
  2185. OUT PFAX_PRINTER_INFO% *ppPrinterInfo,
  2186. OUT LPDWORD lpdwPrintersReturned
  2187. );
  2188. WINFAXAPI
  2189. BOOL
  2190. WINAPI
  2191. FaxRegisterForServerEvents (
  2192. IN HANDLE hFaxHandle,
  2193. IN DWORD dwEventTypes,
  2194. IN HANDLE hCompletionPort,
  2195. IN DWORD_PTR dwCompletionKey,
  2196. IN HWND hWnd,
  2197. IN DWORD dwMessage,
  2198. OUT LPHANDLE lphEvent
  2199. );
  2200. WINFAXAPI
  2201. BOOL
  2202. WINAPI
  2203. FaxUnregisterForServerEvents (
  2204. IN HANDLE hEvent
  2205. );
  2206. //********************************************
  2207. //* Manual answer support functions
  2208. //********************************************
  2209. WINFAXAPI
  2210. BOOL
  2211. WINAPI
  2212. FaxAnswerCall(
  2213. IN HANDLE hFaxHandle,
  2214. IN CONST DWORD dwDeviceId
  2215. );
  2216. //********************************************
  2217. //* Configuration Wizard support functions
  2218. //********************************************
  2219. WINFAXAPI
  2220. BOOL
  2221. WINAPI
  2222. FaxGetConfigWizardUsed (
  2223. OUT LPBOOL lpbConfigWizardUsed
  2224. );
  2225. WINFAXAPI
  2226. BOOL
  2227. WINAPI
  2228. FaxSetConfigWizardUsed (
  2229. IN HANDLE hFaxHandle,
  2230. OUT BOOL bConfigWizardUsed
  2231. );
  2232. //********************************************
  2233. //* Ivalidate archive folder
  2234. //********************************************
  2235. WINFAXAPI
  2236. BOOL
  2237. WINAPI
  2238. FaxRefreshArchive (
  2239. IN HANDLE hFaxHandle,
  2240. IN FAX_ENUM_MESSAGE_FOLDER Folder
  2241. );
  2242. WINFAXAPI
  2243. BOOL
  2244. FaxSetRecipientsLimit(
  2245. IN HANDLE hFaxHandle,
  2246. IN DWORD dwRecipientsLimit
  2247. );
  2248. WINFAXAPI
  2249. BOOL
  2250. WINAPI
  2251. FaxGetRecipientsLimit(
  2252. IN HANDLE hFaxHandle,
  2253. OUT LPDWORD lpdwRecipientsLimit
  2254. );
  2255. #include "FaxSuite.h"
  2256. WINFAXAPI
  2257. BOOL
  2258. FaxGetServerSKU(
  2259. IN HANDLE hFaxHandle,
  2260. OUT PRODUCT_SKU_TYPE* pServerSKU
  2261. );
  2262. //
  2263. // FaxCheckValidFaxFolder should be used to verify arbitrary folder paths before they are used
  2264. // as a parameter for the store-in-folder routing method.
  2265. // It should not be used to verify the fax queue folder or the fax archive folders.
  2266. //
  2267. WINFAXAPI
  2268. BOOL
  2269. FaxCheckValidFaxFolder(
  2270. IN HANDLE hFaxHandle,
  2271. IN LPCWSTR lpcwstrPath
  2272. );
  2273. ;end_internal
  2274. ;begin_both
  2275. #ifdef __cplusplus
  2276. }
  2277. #endif
  2278. #endif
  2279. ;end_both