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.

2494 lines
108 KiB

  1. #ifndef _SERVERDLL_INC
  2. #define _SERVERDLL_INC
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /***************************************************************************
  7. Name : lmi.h
  8. Comment : Defines the Logical Modem Interface.
  9. Created : 9/9/93
  10. Author : Sharad Mathur
  11. Contribs :
  12. Changes : 12/29/93: Changed UINTS to WORDS
  13. 12/29/93: Put min length restriction on String in LMI_AddModem
  14. 12/29/93: Changed display string comments to remove "Fax Modem
  15. on"
  16. 12/29/93: Changed NetAuthenticateDll API
  17. 8/4/94 : Defined FAXERROR
  18. 8/4/94 : Changed capabilities to bits & added new ones
  19. 8/4/94 : Changed SERVERSTATE to be a bitfield
  20. 8/4/94 : Changed NetReportRecv & LMI_ReportSends to return
  21. DWORD
  22. counts.
  23. 8/4/94 : Changed enum's to #define's
  24. 8/4/94 : Changed LPSTR to LPTSTR, & added fUnicode.
  25. 9/23/94 : Added Poll request support -
  26. LMIPOLLREQUEST, POLLTYPE, wszPollRequest(LMISENDJOB),
  27. dwPollContext(LMIRECVSTATUS), POLL_REQUEST capability
  28. 9/23/94 : Added Custom msg options support
  29. LMI_SetCustomMsgOptions,
  30. wrgbCustomOptionsOffset(LMISENDJOB),
  31. CUSTOM_MSG_OPTIONS capability.
  32. 9/23/94 : Added 4 ext error codes to T30_DIALFAIL.
  33. 9/23/94 : Added lpatError to LMI_CheckProvider.
  34. 9/26/94 : Added NRR_COMMITTED_RECEIVE to
  35. LMI_ReportReceives
  36. 10/6/94 : Added ABOVE64K_STRUCTURES to caps, and made total
  37. size & struct offsets in LMISENDJOB DWORDS.
  38. 10/6/94 : Made all structs DWORDS aligned.
  39. 10/6/94 : Added User request fields to LMI_ReportSends
  40. 10/6/94 : Added user request flags to LMI_GetQueueFile
  41. 10/6/94 : Changed dwNumEntries in LMIQUEUEFILEHEADER to dword
  42. 10/6/94 : Updated AtWork address definition to include \@ & |
  43. 10/7/94 : Consolidated all unsupported dialchar codes.
  44. 10/17/94: Added NCUDIAL_BADDIALSTRING
  45. 10/17/94: Moved lpatClientName from LMI_InitProvider to
  46. LMI_InitLogicalModem
  47. 10/17/94: Added LMIERR_PROVIDER_BUSY
  48. 03/16/95 (kentse) The big reorg. changed from Srvrdll to
  49. LMI. (A large change).
  50. 04/05/95 (kentse) Completed the big rewrite.
  51. ***************************************************************************/
  52. #define MAX_SERVERNAME_SIZE 32
  53. #define MAX_SUBJECT_SIZE 128
  54. typedef ATOM FAR* LPATOM;
  55. typedef UINT FAR* LPUINT;
  56. //////////////////////// OVERVIEWS ///////////////////////////////////////
  57. /****
  58. @doc EXTERNAL SRVRDLL OVERVIEW
  59. @topic Introduction to the Logical Modem Interface | The Logical Modem
  60. Interface (LMI) was developed to facilitate the easy creation of a fax
  61. service provider for a Microsoft Fax transport running on a PC. Microsoft
  62. Fax is supported in Windows 95 and will be supported in the shell update
  63. release of Windows NT 3.51. There is also support in Windows for
  64. Workgroups<tm> 3.11 (where Microsoft Fax was known as Microsoft At
  65. Work <tm>). A fax service provider written to the LMI will work on all
  66. these platforms. For this discussion of the LMI, no distinction is made
  67. between operating environments.
  68. The Logical Modem Interface divides Microsoft Fax support in Windows
  69. into two parts: a fax transport that sits above the LMI, and
  70. one or more LMI providers that sit underneath. The fax transport is
  71. a messaging provider integrated with mail (MAPI) that can
  72. expose faxing capabilities to the user in many ways. Most fundamentally,
  73. faxing capability is exposed through the Microsoft Mail or Microsoft
  74. Exchange Send Note form, where fax is treated as just another valid
  75. address type by the user. But faxing capability is also exposed to the user
  76. through a <lq>print to fax<rq> mechanism hooked into the printing system
  77. (this user interface is more typical for alternative fax packages).
  78. In the new Windows shell, fax is also exposed through a <lq>send fax
  79. wizard<rq>. Regardless of the method chosen by the user to compose a fax,
  80. once <lq>sent<rq> by the user the fax message ends up as a message in the
  81. mail store. In general, any outbound message in the store is extracted by MAPI,
  82. and, if addressed to one or more fax recipients, the message is handed over to
  83. the fax transport for delivery.
  84. The fax transport performs several types of processing on a fax message after
  85. receiving it from MAPI. The objective of this processing is to create a data
  86. stream that contains the actual bits that need to be sent across the wire. (It is
  87. assumed that in most cases, a fax will be sent over a PSTN connection. This need
  88. not always be so, such as in the case of a NetFax server.) The format of this
  89. data might be one of the standard MH, MR, or MMR formats; or it might be the
  90. Microsoft Fax linearized file format, which allows multiple, binary attachments.
  91. The transport intelligently decides which format or formats to generate (more than
  92. one may be generated) based partly on cached (or unknown) capabilities of the
  93. recipient, and partly on preferences expressed by the user. Especially in cases
  94. where the transport cannot decide the best format, it may generate several,
  95. postponing the actual decision of which to send until run time.
  96. Once the appropriate formats have been generated, the main work of the fax
  97. transport is done. From that point, responsibility for sending the fax belongs
  98. to the active LMI provider. The user could have several LMI providers
  99. installed, such as a local modem and a network fax service provider, but only
  100. one can be active at a time.
  101. The fax transport has no knowledge of any physical modem or phone line. It
  102. only knows about the existence of a <lq>logical modem<rq>. The transport can
  103. submit jobs to be sent over this modem without worrying about how they will be sent.
  104. An LMI provider can accept these jobs and complete them in any way, including
  105. by forwarding the data to a different machine (which could be running a custom
  106. operating system) where a physical fax modem is installed.
  107. Once it completes sending the fax, the LMI provider must return the results of
  108. the send to the sending fax transport. Because sending faxes and communicating
  109. between machines can be time-consuming, the interface is completely asynchronous.
  110. None of the calls into the interface require blocking of the fax transport while the
  111. LMI provider performs some operation. The LMI provider benefits from this division
  112. of labor because all of the intelligence is kept common in the fax transport,
  113. including all knowledge about keeping capabilities, rendering
  114. attachments to the message, getting data from OLE objects, and so on.
  115. The LMI is designed so that all structures and data passed
  116. through the interface are already marshaled into blocks of BYTES.
  117. This simplifies the implementation of the LMI provider in the case where the
  118. provider is used with a network front-end processor and where the actual fax
  119. call is not made in the same process context as the provider
  120. interface. The LMI provider must parse the structures, dial
  121. the numbers, and send the appropriate format across the connection. To
  122. communicate with other Microsoft Fax-enabled machines over a PSTN
  123. connection, the LMI provider must be able to talk the Microsoft Extended Fax
  124. Protocol (MEFP) on the wire. MEFP is a set of NSF extensions to the ITU T.30
  125. protocol; the details of this protocol are documented elsewhere. The current
  126. document assumes that the LMI provider can talk to Microsoft Fax clients and
  127. decipher their capabilities in order to make intelligent decisions about which
  128. format is to be sent.
  129. There is a wide range of functionality an LMI provider may choose
  130. to provide. At the simplest, an LMI provider can decide to only
  131. provide send-fax services, with no capability of queuing,
  132. scheduling, and so on. A more complex LMI provider can have
  133. it's own phone books, generate cover pages, print incoming faxes,
  134. do inbound routing of other faxes, do load balancing with multiple
  135. hardware phone lines, and much more. The LMI encourages vendors to
  136. differentiate their offerings. The same fax transport can talk to
  137. an LMI provider with any kind of functionality. The fax transport
  138. makes dynamic decisions based on capability flags that are part of
  139. the LMI.
  140. Except for a few configuration functions, the interface is guaranteed to be
  141. called from a single process context.
  142. However, the client software can consist of multiple threads,
  143. each of which may call portions of this interface.
  144. It is possible for a second API to be called while
  145. still in the middle of a previous call (the calls would be in different
  146. thread contexts). This is important. It means that the LMI provider must
  147. protect itself from reentrancy issues.
  148. A logical modem is treated as a single queue to which jobs can be sent. There is
  149. not necessarily a one-to-one correspondence between a logical modem and a
  150. physical modem. An implementation can hide several modems behind a single
  151. queue and do load balancing among the modems.
  152. Important: Unless explicitly stated otherwise, an LMI provider should not
  153. present any user interface in any interface calls. Many of these calls are
  154. made in the background and are not expected to put up UI (including
  155. message boxes).
  156. @topic Overview of the LMI Provider Interface | This document describes the
  157. services a fax provider must implement to act as a fax provider to a Microsoft
  158. Fax client through the LMI. The interface has several main components. The
  159. parts are installation, configuration, queue administration and status,
  160. sending faxes, receiving faxes, and uploading documents and cover pages.
  161. Each of these is covered in detail in the following sections.
  162. It is useful to present a high-level overview of how the fax transport
  163. calls into the Logical Modem Interface. At first, the transport's
  164. configuration user interface calls <f LMI_AddModem> and
  165. <f LMI_RemoveModem> to control which modems exist in the list
  166. of available modems. It also calls <f LMI_ExchangeCaps>
  167. to make any necessary configuration decisions. When the fax transport
  168. initializes, it calls <f LMI_InitProvider> and <f LMI_InitLogicalModem>.
  169. The transport can then send faxes with <f LMI_SendFax>. The transport
  170. polls for the status of sent faxes with <f LMI_ReportSend> and looks at the
  171. provider's queue with <f LMI_GetQueueFile>. To abort or reschedule
  172. a fax that has been sent but has not yet left the queue, the transport
  173. can call <f LMI_AbortSendJob> and <f LMI_RescheduleSendJob>.
  174. The transport polls for received faxes with <f LMI_ReportReceives>.
  175. Finally, the transport calls <f LMI_DeinitLogicalModem> and
  176. <f LMI_DeinitProvider> when it is time to shut down.
  177. A useful example to study for understanding the flow across the
  178. LMI is the simple case of a send on one machine leading to a
  179. receive on another. A send starts off as a note composed in a
  180. mail client by the user. In this example, the user types in some
  181. text and attaches a bitmap. The user addresses the note to
  182. a single fax recipient at the phone number 555-1234 and chooses
  183. to send the note in the best format possible at the cheap-rate time. When
  184. the note is ready, the user <lq>sends<rq> the note (this really
  185. just saves the message to the store).
  186. The message is then picked up from the store and is handed to
  187. the fax transport, because the message has a fax recipient. The
  188. fax transport looks into its capability database for the number
  189. 555-1234, but (in this example) finds no entry. Because the user chose
  190. to send the message in the best format possible, the fax transport converts the
  191. message into two formats: a rendered, MMR version (images only) and a
  192. linearized file-format version (binary file). For the rendered version, the
  193. transport itself renders the text; calls Paintbrush to render the bitmap
  194. file; and finally generates a file combining the rendered images, to which
  195. it attaches a linearized header. For the linearized version, the transport
  196. calls the linearizer, which assembles the binary attachments as-is into
  197. a file with a linearized header.
  198. After creating the two separate files, the fax transport calls
  199. <f LMI_SendFax> in the LMI provider. In the call, the transport passes
  200. in the details of the job as well as the file name for each of the
  201. two formats that were generated. In response to the call, the LMI provider
  202. examines the details of the send job. Seeing that the fax (in this example)
  203. is to be sent at cheap rates, it leaves the job on its internal queue. The fax
  204. transport periodically polls the LMI provider for the status of the fax.
  205. When cheap times roll around, the LMI provider connects to 555-1234
  206. using a local modem and sends the appropriate format (the MMR file if the
  207. receiver is a G3 fax machine, or the linearized file if the receiver uses
  208. Microsoft Fax). The next time the fax transport calls <f LMI_ReportSend>
  209. after the fax is sent over the wire, the LMI provider returns the final status of
  210. the send job. Upon receipt of this status, the fax transport passes it on to the
  211. user, typically generating a Non-Delivery Report (NDR) if there was an
  212. error, or moving the message into the Sent Mail folder if the send was
  213. successful.
  214. Received faxes are available immediately to the LMI provider on the remote
  215. machine, since it is the one picking up the phone. The LMI provider then
  216. has to decide to which client the message needs to be routed. For reception of
  217. G3 faxes, intelligent decisions are not possible since there is no structured
  218. routing information; routing to some default client is probably best. For
  219. Microsoft Fax messages, the LMI provider can interpret the linearized header
  220. (using some helper functions) and extract the Microsoft
  221. Fax address of the recipient. If this address contains a routing name,
  222. the name can be matched to a list of clients and the fax can be easily routed.
  223. Once the LMI provider has decided on the recipient client, it waits for that
  224. client's fax transport to regularly poll for new faxes. When polled (by a call
  225. to <f LMI_ReportReceives>), the provider creates a file with the received data
  226. in an appropriate format. If the fax was received from a G3 fax machine, the
  227. provider can use helper functions to construct a file starting with a linearized header,
  228. followed by AWG3 page headers, finally followed by the data. For linearized file-format
  229. faxes, the exact data received is passed in. Finally, the client fax transport parses the
  230. data file (of whichever format) and creates a new message in the mail client Inbox
  231. containing the data in a format the user can view.
  232. @topic Installation |
  233. Installing a new LMI provider module is a two step process. First, the
  234. installation program must create an entry in the MSATWORK.INF file
  235. as defined below.
  236. MSATWORK.INF file format:
  237. [External Devices]<nl>
  238. \<device name\>=\<description\><nl>
  239. .<nl>
  240. .<nl>
  241. \<device name\>=\<description\>
  242. [\<device name\>]<nl>
  243. Display Name=\<name to show devices list box\><nl>
  244. DLL Name=\<name of the DLL for this device\><nl>
  245. Flags=\<see below\><nl>
  246. [\<device name\>]<nl>
  247. Display Name=\<name to show devices list box\><nl>
  248. DLL Name=\<name of the DLL for this device\><nl>
  249. Flags=\<see below\>
  250. Explanation:
  251. \<device name\>: Name of the section of the below device.<nl>
  252. \<description\>: Description of the device, for INF-file purposes
  253. only, not used anywhere else.<nl>
  254. Display Name: Name of the device. This name will be displayed
  255. in the AddDevice dialog listbox.<nl>
  256. DLL Name: Name of the DLL that services this device.<nl>
  257. Flags: Currently will be zero. Can be used for various device
  258. capabilities, like whether this device allows setup, etc.
  259. Example:
  260. [External Devices]<nl>
  261. IFAX=An intelligent fax machine<nl>
  262. AcmeFax=A future fax provider
  263. [IFAX]<nl>
  264. Display Name=Intelligent fax machine<nl>
  265. DLL Name=ifax32.dll<nl>
  266. Flags=0
  267. [AcmeFax]<nl>
  268. DLL Name=acme32.dll
  269. Next, when the user installs a new fax modem from the
  270. configuration interface, the user is presented with a list of all strings
  271. from the Display Name section of the MSATWORK.INF file. When the
  272. user chooses Display Name, <f LMI_AddModem> is called to allow the
  273. LMI provider to put up a dialog box that asks the user to choose a
  274. logical modem from that LMI provider.
  275. <f LMI_AddModem> returns a string representing the logical modem
  276. the user has selected. This string is then displayed in the list of
  277. currently available modems. The user can choose the current default
  278. fax modem from this list.
  279. @topic Configuration |
  280. The user is allowed to configure any of the available
  281. fax modems (logical modems). <f LMI_ConfigureModem> is called for
  282. the appropriate LMI provider. This function allows the user
  283. to do whatever remote configuration options are permitted. These may
  284. be divided into user-configurable and administrator-configurable
  285. options. In general, there should be very few user configurable
  286. options. For administrator options, this function should
  287. probably use some kind of password protection.
  288. @topic Initialization |
  289. When the fax transport starts, the <f LMI_InitProvider> function
  290. is called for the appropriate LMI provider. Then, the
  291. <f LMI_InitLogicalModem> function is called for the modem the
  292. client wants to use. This function intializes the logical
  293. modem and return to the client a handle to the modem, as well as the
  294. modems capabilities. The capabilities include support for advanced
  295. features and are used by the client to decide what kind of
  296. operations are supported by the LMI provider. An example of an
  297. important capability is whether or not the modem is Microsoft Fax
  298. enabled. The phone number of the modem is some other
  299. information returned by this call. Several logical modems may be
  300. initialized at the same time. All operations on a modem use the
  301. handle returned by the <f LMI_InitLogicalModem> call.
  302. @topic Queue Management |
  303. To allow the user to see up-to-date status for all the jobs of an
  304. LMI provider, functions have been defined to let the client
  305. monitor and administer the provider's queue.
  306. <f LMI_GetQueueFile> is called whenever the user wants to see the
  307. queue. This function gives access to a specific set of information
  308. about each job in the provider's queue. The information is
  309. displayed in a uniform manner by the fax transport. To allow
  310. value-added, extended-status displays, arbitrary binary
  311. information can also be passed back as part of the status. If
  312. the user wants detailed status on a particular job,
  313. <f LMI_DisplayCustomStatus> is called with this binary
  314. information to display more detailed status. If the user wants
  315. to cancel or reschedule jobs, the functions <f LMI_AbortSendJob>
  316. and <f LMI_RescheduleSendJob> may be called.
  317. @topic Sending Faxes |
  318. When a fax is to be sent, the transport assumes all responsibility
  319. for rendering the appropriate formats for transmission. The transport
  320. maintains a cache of the capabilities for all fax machines it has
  321. talked to before and uses the database to attempt intelligent decisions
  322. about the most efficient format to be sent. The transport also takes
  323. into account explicit user preferences.
  324. There are three different formats that can be sent. The first is
  325. for sending to standard fax machines and consists of MH, MR or
  326. MMR data. The second format is a linearized EFAX message containing
  327. only image data. The third format is a linearized EFAX message containing
  328. binary data. All three formats are always preceded by a linearized header
  329. describing the file. See <lq>Microsoft At Work Linearized File Format<rq>
  330. for details of this header. Details of the fax file format are in <lq>AWG3 File
  331. Format<rq>.
  332. When the fax has been sent, the LMI provider reports the final
  333. status for the job via <f LMI_ReportSend>. This function is
  334. polled periodically by the fax transport. Along with the final
  335. status, the Provider must return the newly found capabilities of
  336. all the recipients of the fax. The client can also ask for
  337. attention using the <f LMI_CheckProvider> function.
  338. Poll requests are also submitted using LMI_SendFax. Fields in the LMISENDJOB
  339. structure provide the information for the poll request.
  340. @topic Receiving Faxes|
  341. All received faxes need to be routed by the fax transport to the
  342. appropriate LMI provider. The Microsoft At Work fax transport
  343. polls for received faxes using the <f LMI_ReportReceives>
  344. function.
  345. As with sent faxes, received faxes can be in any one of three
  346. formats. The header for the file describes the format and gives
  347. information about the recipients of this message. All formats
  348. MUST have a linearized header describing the format and contents
  349. of the message. See
  350. <lq>Microsoft At Work Linearized File Format<rq>
  351. for details of this header. Details of the Fax file format are
  352. in <lq>AWG3 File Format<rq>.
  353. ****/
  354. /********
  355. @doc EXTERNAL SRVRDLL DATATYPES
  356. @topic Microsoft At Work Address |
  357. This section describes the Microsoft At Work address format. In
  358. its most common form, this consists of a name and a phone number.
  359. The phone number is assumed to begin at the last @ in the address.
  360. In its more complex forms, the name could contain more routing
  361. information.
  362. Ideally, the phone number in the address is in the canonical form.
  363. This consists of
  364. +\<country code\>[\<area code\>]\<local number\>[\|\<suffix\>].
  365. Other important things to note: An @ can be escaped by using a
  366. backslash, and a suffix may be added to the canonical number
  367. by using a \| symbol after the number and following that with the
  368. suffix.
  369. @ex Some Examples: |
  370. A simple Micsosoft At Work Address might look like
  371. JohnDoe@+1(206)5551212|$999
  372. which would indicate that after dialing the number, we should wait
  373. for a beep and dial a 999. THe receiving number would then route
  374. to JohnDoe. If the number is an IFAX machine, John would have an
  375. account with the login JohnDoe, or if the number was a PC, JohnDoe
  376. would be the email alias for his account.
  377. In general, the <name> part of the address must be interpreted by
  378. the receiving machine and can contain any routing information
  379. necessary for inbound routing by this machine.
  380. *********/
  381. /****
  382. @doc EXTERNAL SRVRDLL OVERVIEW
  383. @topic Constants|
  384. The following section contains a list of predefined return codes,
  385. error codes, and other predefined values used throughout this
  386. document.
  387. ****/
  388. /********
  389. @doc EXTERNAL SRVRDLL DATATYPES
  390. @type NONE | LMI_RETURN | Return codes for LMI provider API's.
  391. @emem LMI_SUCCESS | No error - function was successful.
  392. @emem LMIERR_CONNECT_FAILED | Connection to Provider failed. Client
  393. should go offline.
  394. @emem LMIERR_NOT_SUPPORTED | Some function/parameter was not
  395. supported by this LMI provider.
  396. @emem LMIERR_OPERATION_FAILED | Generic failure code.
  397. @emem LMIERR_OP_CANCELLED | Operation canceled by user.
  398. @emem LMIERR_PROVIDER_BUSY | The Provider was temporarily unavailable to
  399. accept requests. This might be useful for Providers which have
  400. limits on the number of connections supported. The clients response
  401. to this error code should be to try and retry the operation if
  402. possible, particularly for API's like <f LMI_SendFax>. However,
  403. some clients may treat this as a failure.
  404. @emem LMIERR_SERVER_RESOURCES_LOW | The Provider failed due to a low
  405. resource situation on a server.
  406. ********/
  407. typedef DWORD LMI_RETURN;
  408. #define LMI_SUCCESS 0
  409. #define LMIERR_CONNECT_FAILED 1
  410. #define LMIERR_NOT_SUPPORTED 2
  411. #define LMIERR_OPERATION_FAILED 3
  412. #define LMIERR_OP_CANCELLED 4
  413. #define LMIERR_PROVIDER_BUSY 5
  414. #define LMIERR_SERVER_RESOURCES_LOW 6
  415. /********
  416. @doc EXTERNAL SRVRDLL DATATYPES
  417. @type NONE | FAXERROR |
  418. DWORD Error status codes returned in the
  419. <t LMIFORMAT>, <t LMIRECIPSTATUS>, <t LMISENDSTATUS>, and
  420. <t LMIRECVSTATUS> structures. This error consists of three parts:
  421. an error code, an extended error code, and error specific data
  422. (in some cases). The extended error code must be set to
  423. T30_UNKNOWN if the means for setting a more meaningful error are
  424. not available. A value of zero in the data field implies that
  425. there is no valid data for this error. In those cases where the
  426. extended error or data fields are unused, they must be set to zero.
  427. This is to allow these fields to be used in the future.
  428. @emem Error Code | The low BYTE of the low word of the error is the
  429. error code. Use the macro GetErrCode(error) to extract this
  430. BYTE. The error codes defined are:
  431. @flag T30_CALLFAIL | An error occured during actual
  432. transmission of the fax. Detailed error status can be determined
  433. from the extended error field.
  434. @flag T30_DIALFAIL | An error occured during dialing
  435. the fax number. Detailed error status can be determined from
  436. the extended error field.
  437. @flag T30_ANSWERFAIL | An error occured during answering of a phone
  438. call. Detailed error status can be determined from the extended
  439. error field.
  440. @flag T30_NOMODEM | The Provider could not find any hardware modem
  441. to send the fax over. This would typically indicate that the user
  442. had physically removed some hardware from the machine.
  443. @flag T30_FILE_ERROR | An error occured trying to read or parse the
  444. format files which were passed in. Detailed error status may
  445. be found in the extended error.
  446. @flag T30_MODEMERROR | An error occured while trying to talk with
  447. the hardware modem.
  448. @flag T30_PORTBUSY | The port on which the hardware modem was
  449. installed cannot be opened. Extended error status contains more
  450. details.
  451. @flag T30_MODEMDEAD | The hardware modem has stopped responding to
  452. any AT commands. This typically requires some human intervention,
  453. such as turning the power off and back on.
  454. @flag RES_NOMEMORY | The Provider ran out of memory resources.
  455. @flag RES_LOWDISK | The Provider ran out of disk space.
  456. @flag USER_ABORT | The job was cancelled on a user request.
  457. @flag RENDERING_FAILURE | For Provider's that do any rendering, this
  458. indicates the class of failures which result in the inability to
  459. render a final format to be sent. Extended errors give more
  460. details.
  461. @flag RES_LOW_SERVER | The Provider failed due to a low resource
  462. problem on a server.
  463. @flag CUSTOM_ERROR | If the Provider happens to get an error
  464. which does not fall into any of the classes specifically
  465. defined here, then it can pass back a custom error. In this
  466. case the data field contains a global atom
  467. which identifies a string describing the error in terms
  468. understandable to the user. NOTE: This error is not supported
  469. by Windows 95, but will be in a later release.
  470. @flag GENERAL_FAILURE | Indicates a serious internal error in the
  471. software.
  472. @emem Extended error codes for T30_DIALFAIL | Any of the following could
  473. be the reason for a dial failure:
  474. @flag NCUDIAL_ERROR | Detailed error is unknown.
  475. @flag NCUDIAL_BUSY | The called number was busy.
  476. @flag NCUDIAL_NOANSWER | The dialed number did not answer.
  477. @flag NCUDIAL_NODIALTONE | No dialtone could be detected.
  478. @flag NCUDIAL_MODEMERROR | There was some hardware problem in
  479. the modem while trying to dial.
  480. @flag NCUDIAL_BADDIALSTRING | The dial string was badly formed. In
  481. general, logical modems should try to be as robust as possible,
  482. ignoring characters which are not understood. This error code
  483. should only be used for cases where the string is so obviously
  484. malformed that there is no point even attempting to dial.
  485. @emem Extended error codes for T30_ANSWERFAIL | The provider does not have
  486. to report receives which failed in the answering phase itself.
  487. However, if it chooses to do so, the following codes apply:
  488. @flag NCUANSWER_ERROR | Detailed error is unknown.
  489. @flag NCUANSWER_NORING | No ring was detected.
  490. @flag NCUANSWER_MODEMERROR | There was some hardware problem in
  491. the modem while trying to answer.
  492. @emem Extended error codes for T30_PORTBUSY | The port could be busy for
  493. two reasons:
  494. @flag PORTBUSY_SELFUSE | The port is already being used by us. A common
  495. case causing this error is if a receive is in progress. The
  496. client will typically retry the call at a later time,
  497. transparently to the user.
  498. @flag PORTBUSY_OTHERAPP | The device or port is used by some other
  499. application.
  500. @emem Extended error codes for T30_CALLFAIL | This is likely to be the
  501. most common error, and very detailed error codes are defined for
  502. it. The extended error can be any of the following:
  503. @flag T30FAILS_T1 | Send T1 timeout (No NSF/DIS Received).
  504. @flag T30FAILS_TCF_DCN | Received DCN after TCF.
  505. @flag T30FAILS_3TCFS_NOREPLY | No reply to three attempts at training
  506. (TCF).
  507. @flag T30FAILS_3TCFS_DISDTC | Remote does not see our TCFs.
  508. @flag T30FAILS_TCF_UNKNOWN | Got garbage response to TCF.
  509. @flag T30FAILS_SENDMODE_PHASEC | Modem error or timeout at start of
  510. page.
  511. @flag T30FAILS_MODEMSEND_PHASEC | Modem error or timeout within page.
  512. @flag T30FAILS_MODEMSEND_ENDPHASEC | Modem error or timeout at end of
  513. page.
  514. @flag T30FAILSE_SENDMODE_PHASEC | Modem error or timeout at start of
  515. ECM page.
  516. @flag T30FAILSE_MODEMSEND_PHASEC | Modem error or timeout within ECM
  517. page.
  518. @flag T30FAILSE_MODEMSEND_ENDPHASEC | Modem error or timeout at end of
  519. ECM page.
  520. @flag T30FAILSE_BADPPR | Bad PPR received from receiver.
  521. @flag T30FAILS_3POSTPAGE_NOREPLY | No response after page: Probably
  522. receiver hungup during page transmit.
  523. @flag T30FAILS_POSTPAGE_DCN | Received DCN after page.
  524. @flag T30FAILSE_3POSTPAGE_NOREPLY | No response after page. Probably
  525. receiver hungup during page transmit.
  526. @flag T30FAILSE_POSTPAGE_DCN | Received DCN after ECM page.
  527. @flag T30FAILSE_POSTPAGE_UNKNOWN | Received garbage after ECM page.
  528. @flag T30FAILSE_RR_T5 | Receiver was not ready for more than 60 seconds
  529. during ECM flow-control.
  530. @flag T30FAILSE_RR_DCN | Received DCN after RR during ECM flow-control.
  531. @flag T30FAILSE_RR_3xT4 | No response from receiver during ECM
  532. flow-control.
  533. @flag T30FAILSE_CTC_3xT4 | No response from receiver after CTC
  534. (ECM baud-rate fallback).
  535. @flag T30FAILSE_CTC_UNKNOWN | Garbage response from receiver after CTC
  536. (ECM baud-rate fallback).
  537. @flag T30FAILR_PHASEB_DCN | Receiver: Sender decided we're incompatible.
  538. @flag T30FAILR_T1 | Receiver: Caller is not a fax machine or hung up.
  539. @flag T30FAILR_UNKNOWN_DCN1 | Receiver: Received DCN when command was
  540. expected.
  541. @flag T30FAILR_T2 | Receiver: No command was received for seven seconds.
  542. @flag T30FAILR_UNKNOWN_UNKNOWN2 | Receiver: Received garbage when
  543. command was expected.
  544. @flag T30FAILR_MODEMRECV_PHASEC | Receiver: Page not received, modem
  545. error or timeout at start of page.
  546. @flag T30FAILRE_MODEMRECV_PHASEC | Receiver: Data not received, modem
  547. error or timeout during page.
  548. @flag T30FAILRE_PPS_RNR_LOOP | Receiver: Timeout during ECM flow
  549. control after PPS.
  550. @flag T30FAILRE_EOR_RNR_LOOP | Receiver: Timeout during ECM flow
  551. control after EOR.
  552. @flag T30FAIL_NODEA_UNKNOWN | Sender: Garbage frames instead of DIS/DTC.
  553. @flag T30FAILS_POSTPAGE_UNKNOWN | Sender: Unknown response after page.
  554. @flag T30FAILS_POSTPAGE_OVER | Sender: We've sent a DCN (decided to
  555. end call).
  556. @flag T30FAILS_4PPR_ERRORS | Sender: Too many line errors in ECM mode.
  557. @flag T30FAILS_FTT_FALLBACK | Sender: Receiver doesn't like our
  558. training at all speeds.
  559. @flag T30FAILS_RTN_FALLBACK | Sender: Too many line errors in non-ECM
  560. mode even at 2400.
  561. @flag T30FAILS_4PPR_FALLBACK | Sender: Too many line errors in ECM mode
  562. even at 2400.
  563. @flag T30FAILS_MG3_NOFILE | Negotiation failed: Remote was G3 and there
  564. was no AWG3 format to send.
  565. @flag T30FAILS_NEGOT_ENCODING | Negotiation failed: Encoding mismatch.
  566. @flag T30FAILS_NEGOT_WIDTH | Negotiation failed: Paper Size Not
  567. Supported.
  568. @flag T30FAILS_NEGOT_LENGTH | Negotiation failed: Paper Size Not
  569. Supported.
  570. @flag T30FAILS_NEGOT_RES | Negotiation failed: Resolution Not Supported.
  571. @flag T30FAILS_EFX_BADFILE | Bad Linearized file was passed.
  572. @flag T30FAILS_MG3_BADFILE | Bad AWG3 file was passed in.
  573. @flag T30FAIL_ABORT | User abort
  574. @flag T30FAILS_SECURITY_NEGOT | Negotiation failed: Remote machine does
  575. not support security. If set, the error data contains the
  576. security version number supported by the recipient.
  577. @flag T30FAILS_NEGOT_MSGPROTOCOL | Negotiation failed: Remote machine
  578. does not support a compatible message protocol. If set, the
  579. error data contains the message protocol version number
  580. supported by the recipient.
  581. @flag T30FAILS_NEGOT_SECURITY | Negotiation failed: Remote machine does not support
  582. security. If set, the error data contains the security version number supported
  583. by the recipient.
  584. @flag T30FAILS_NEGOT_BINARYDATA | Negotiation failed: Remote machine
  585. does not support receiving binary data.
  586. @flag T30FAILS_NEGOT_COMPRESSION | Negotiation failed: Remote machine
  587. does not support a compatible version of compression. If set,
  588. the error data contains the compression version supported by
  589. the recipient.
  590. @flag T30FAILS_NEGOT_POLLING | Negotiation failed: Remote machine does
  591. not support polling.
  592. @flag T30FAILS_NEGOT_POLLBYNAME | Negotiation failed: Remote machine
  593. does not support poll by name.
  594. @flag T30FAILS_NEGOT_POLLBYRECIP | Negotiation failed: Remote machine
  595. does not support poll by recipient name.
  596. @flag T30FAILS_NEGOT_FILEPOLL | Negotiation failed: Remote machine
  597. does not support poll by filename.
  598. @emem Error data values for T30_CALLFAIL | Error data must be zero for negotiation failures. For all other failures, the error data may be set
  599. to one of the following fields:
  600. @flag T30_SENTNONE | Indicates that no pages were sent at all.
  601. @flag T30_SENTSOME | Indicates that some pages were successfuly
  602. transmitted and acknowledged by the remote machine.
  603. @flag T30_SENTALL | Indicates that all pages were successfuly sent.
  604. This should not really happen; it would generally indicate a
  605. successful transmission.
  606. @emem Extended error codes for T30_FILE_ERROR | This error indicates a
  607. problem in one of the format files sent across the interface by
  608. the client. Different possible extended error codes are:
  609. @flag AWG3_INVALID_LINHDR | The linearized header at the head of the
  610. AWG3 file was invalid.
  611. @flag AWG3_INVALID_AWG3HDR | An invalid AWG3 header was found in the
  612. file.
  613. @flag LIN_INVALIDHDR | A linearized file had an invalid header.
  614. ********/
  615. typedef DWORD FAXERROR;
  616. #define GetErrCode(fe) (LOBYTE(LOWORD(fe)))
  617. #define GetExtErrCode(fe) (HIBYTE(LOWORD(fe)))
  618. #define GetErrData(fe) (HIWORD(fe))
  619. #define FormFaxError(ErrCode,ExtErrCode,ErrData) MAKELONG(MAKEWORD(ErrCode,ExtErrCode),ErrData)
  620. // Error codes
  621. #define T30_CALLFAIL 2
  622. #define T30_DIALFAIL 4
  623. #define T30_ANSWERFAIL 5
  624. #define T30_NOMODEM 9
  625. #define T30_FILE_ERROR 11
  626. #define T30_MODEMERROR 15
  627. #define T30_PORTBUSY 16
  628. #define T30_MODEMDEAD 17
  629. #define RES_NOMEMORY 64
  630. #define RES_LOWDISK 65
  631. #define USER_ABORT 66
  632. #define RENDERING_FAILURE 67
  633. #define RES_LOW_SERVER 68
  634. #define CUSTOM_ERROR 254
  635. #define GENERAL_FAILURE 255
  636. // Extended Error codes
  637. #define T30_UNKNOWN 0
  638. // RENDERING_FAILURE
  639. #define ATTACH_NOT_PRINTABLE 1
  640. #define COVER_TEMPLATE_INVALID 2
  641. // T30_FILE_ERROR
  642. #define AWG3_INVALID_LINHDR 1
  643. #define AWG3_INVALID_AWG3HDR 2
  644. #define LIN_INVALIDHDR 3
  645. // T30_DIALFAIL
  646. #define NCUDIAL_ERROR 0
  647. #define NCUDIAL_BUSY 2
  648. #define NCUDIAL_NOANSWER 3
  649. #define NCUDIAL_NODIALTONE 4
  650. #define NCUDIAL_MODEMERROR 5
  651. #define NCUDIAL_UNSUPPORTED_DIALCHAR 6
  652. #define NCUDIAL_BADDIALSTRING 7
  653. // Extended error code for T30_ANSWERFAIL
  654. #define NCUANSWER_ERROR 0
  655. #define NCUANSWER_NORING 8
  656. #define NCUANSWER_MODEMERROR 5
  657. // Extended error code for T30_PORTBUSY
  658. #define PORTBUSY_SELFUSE 0
  659. #define PORTBUSY_OTHERAPP 1
  660. // Includes T30FAIL.H so that the values here (which should be a subset of
  661. // those in T30FAIL.H) are kept in sync.
  662. #include <t30fail.h>
  663. // Extended error code for T30_CALLFAIL
  664. #define T30FAILS_T1 6 // Send T1 timeout (No NSF/DIS Recvd)
  665. #define T30FAILS_TCF_DCN 7 // Recvd DCN after TCF (weird...)
  666. #define T30FAILS_3TCFS_NOREPLY 8 // No reply to 3 attempts at training (TCF)
  667. #define T30FAILS_3TCFS_DISDTC 9 // Remote does not see our TCFs for some reason
  668. #define T30FAILS_TCF_UNKNOWN 10 // Got garbage response to TCF
  669. #define T30FAILS_SENDMODE_PHASEC 11 // Modem Error/Timeout at start of page
  670. #define T30FAILS_MODEMSEND_PHASEC 12 // Modem Error/Timeout within page
  671. #define T30FAILS_MODEMSEND_ENDPHASEC 14 // Modem Error/Timeout at end of page
  672. #define T30FAILSE_SENDMODE_PHASEC 15 // Modem Error/Timeout at start of ECM page
  673. #define T30FAILSE_MODEMSEND_PHASEC 17 // Modem Error/Timeout within ECM page
  674. #define T30FAILSE_MODEMSEND_ENDPHASEC 19 // Modem Error/Timeout at end of ECM page
  675. #define T30FAILSE_BADPPR 20 // Bad PPR recvd from Recvr (bug on recvr)
  676. #define T30FAILS_3POSTPAGE_NOREPLY 21 // No response after page: Probably Recvr hungup during page transmit
  677. #define T30FAILS_POSTPAGE_DCN 22 // Recvd DCN after page. (weird...)
  678. #define T30FAILSE_3POSTPAGE_NOREPLY 23 // No response after page: Probably Recvr hungup during page transmit
  679. #define T30FAILSE_POSTPAGE_DCN 24 // Recvd DCN after ECM page. (weird...)
  680. #define T30FAILSE_POSTPAGE_UNKNOWN 25 // Recvd garbage after ECM page.
  681. #define T30FAILSE_RR_T5 26 // Recvr was not ready for more than 60secs during ECM flow-control
  682. #define T30FAILSE_RR_DCN 27 // Recvd DCN after RR during ECM flow-control(weird...)
  683. #define T30FAILSE_RR_3xT4 28 // No response from Recvr during ECM flow-control
  684. #define T30FAILSE_CTC_3xT4 29 // No response from Recvr after CTC (ECM baud-rate fallback)
  685. #define T30FAILSE_CTC_UNKNOWN 30 // Garbage response from Recvr after CTC (ECM baud-rate fallback)
  686. #define T30FAILR_PHASEB_DCN 35 // Recvr: Sender decided we're incompatible
  687. #define T30FAILR_T1 36 // Recvr: Caller is not a fax machine or hung up
  688. #define T30FAILR_UNKNOWN_DCN1 37 // Recvr: Recvd DCN when command was expected(1)
  689. #define T30FAILR_T2 38 // Recvr: No command was recvd for 7 seconds
  690. #define T30FAILR_UNKNOWN_UNKNOWN2 40 // Recvr: Recvd grabge when command was expected
  691. #define T30FAILR_MODEMRECV_PHASEC 41 // Recvr: Page not received, modem error or timeout at start of page
  692. #define T30FAILRE_MODEMRECV_PHASEC 42 // Recvr: Data not received, modem error or
  693. #define T30FAILRE_PPS_RNR_LOOP 43 // Recvr: Timeout during ECM flow control after PPS (bug)
  694. #define T30FAILRE_EOR_RNR_LOOP 44 // Recvr: Timeout during ECM flow control after EOR (bug)
  695. #define T30FAIL_NODEA_UNKNOWN 45 // Sender: Garbage frames instead of DIS/DTC
  696. #define T30FAILS_POSTPAGE_UNKNOWN 47 // Sender: Unknown response after page
  697. #define T30FAILS_POSTPAGE_OVER 48 // Sender: We've sent a DCN (decided to end call)
  698. #define T30FAILS_4PPR_ERRORS 50 // Sender: Too many line errors in ECM mode
  699. #define T30FAILS_FTT_FALLBACK 51 // Sender: Recvr doesn't like our training at all speeds
  700. #define T30FAILS_RTN_FALLBACK 52 // Sender: Too many line errors in non-ECM mode even at 2400
  701. #define T30FAILS_4PPR_FALLBACK 53 // Sender: Too many line errors in ECM mode even at 2400
  702. #define T30FAILS_MG3_NOFILE 63 // Negotiation failed: Remote in G3-only and no MG3 file *** Email Form Not Supported ***
  703. #define T30FAILS_NEGOT_ENCODING 64 // Negotiation failed: Encoding mismatch
  704. #define T30FAILS_NEGOT_WIDTH 66 // Negotiation failed: Send image too wide *** Paper Size Not Supported ***
  705. #define T30FAILS_NEGOT_LENGTH 67 // Negotiation failed: Send image too long *** Paper Size Not Supported ***
  706. #define T30FAILS_NEGOT_RES 68 // Negotiation failed: Resolution mismatch *** Resolution Not Supported ***
  707. #define T30FAILS_EFX_BADFILE 69 // Bad EFX file
  708. #define T30FAILS_MG3_BADFILE 71 // Bad MG3 file
  709. #define T30FAIL_ABORT 87 // User abort
  710. #define T30FAILS_SECURITY_NEGOT 110// Negotiation failed: Remote in G3-only and no MG3 file *** Email Form Not Supported ***
  711. // New failure codes
  712. #define T30FAILS_NEGOT_MSGPROTOCOL 128
  713. #define T30FAILS_NEGOT_SECURITY 129
  714. #define T30FAILS_NEGOT_BINARYDATA 130
  715. #define T30FAILS_NEGOT_COMPRESSION 131
  716. #define T30FAILS_NEGOT_COVERATTACH 132
  717. #define T30FAILS_NEGOT_ADDRATTACH 133
  718. #define T30FAILS_NEGOT_METAFILE 134
  719. #define T30FAILS_NEGOT_POLLING 135
  720. #define T30FAILS_NEGOT_POLLBYNAME 136
  721. #define T30FAILS_NEGOT_POLLBYRECIP 137
  722. #define T30FAILS_NEGOT_FILEPOLL 138
  723. #define T30FAILS_NEGOT_RELAY 139
  724. // Data word
  725. // Data for T30_CALLFAIL - non negotiation errors
  726. #define T30_UNKNOWN 0
  727. #define T30_SENTALL 1
  728. #define T30_SENTNONE 2
  729. #define T30_SENTSOME 3
  730. /********
  731. @doc EXTERNAL SRVRDLL DATATYPES
  732. @type NONE | FORMATTYPE | These are all the different kinds of formats
  733. that can be rendered for sending. It is typedef'd to a WORD.
  734. @emem LMIFORMAT_G3 | A standard T4/T6 encoded file, with a linearizer
  735. header put on top of it. See <lq>AWG3 File Format<rq> for details.
  736. @emem LMIFORMAT_LIN_IMAGE | A Linearized Microsoft At Work rendered
  737. image file.
  738. @emem LMIFORMAT_LIN_BINARY | A linearized binary file.
  739. ********/
  740. typedef WORD FORMATTYPE;
  741. #define LMIFORMAT_G3 1
  742. #define LMIFORMAT_LIN_IMAGE 2
  743. #define LMIFORMAT_LIN_BINARY 3
  744. #define LMIFORMAT_STORE_REF 4
  745. /********
  746. @doc EXTERNAL SRVRDLL DATATYPES
  747. @type NONE | POLLTYPE | These are all the different kinds of poll
  748. requests that can be sent. It is typedef'd to a WORD.
  749. @emem POLLREQ_ADDRESS | Polls for a document for a particular
  750. address. The Poll name is the address for which messages are
  751. desired, and a password can also be used. This feature
  752. is unimplemented and should not be used.
  753. @emem POLLREQ_FILE | Polls for a directory or file on the recipient
  754. system. The poll name contains the file system path to be accessed,
  755. and a password can also be used. This feature is unimplemented and
  756. should not be used.
  757. @emem POLLREQ_MSGNAME | Polls for a particular message name.
  758. The poll name contains the message name wanted,
  759. and a password can also be used.
  760. @emem POLLREQ_G3 | Standard G3 compliant poll request. Polls for
  761. any file which has been stored at the recipient machine. Neither
  762. pollname or password are currently supported.
  763. All poll types except POLLREQ G3 require both sender and receiver to be
  764. Microsoft Extended Fax Protocol (MEFP)-enabled.
  765. ********/
  766. typedef WORD POLLTYPE;
  767. #define POLLREQ_ADDRESS 1
  768. #define POLLREQ_FILE 2
  769. #define POLLREQ_MSGNAME 3
  770. #define POLLREQ_G3 4
  771. /********
  772. @doc EXTERNAL SRVRDLL DATATYPES
  773. @type NONE |SCHEDTYPE | Kinds of possible scheduling. Typedef'd to
  774. a WORD.
  775. @emem SCHED_ASAP | Schedule immediately.
  776. @emem SCHED_BEFORE | Schedule immediately, and fail if the specified
  777. time is past.
  778. @emem SCHED_AFTER | Schedule any time after the specified time is past.
  779. @emem SCHED_CHEAPTIMES | Schedule only between cheap time periods
  780. as specified by the Provider's local settings. Only the time of
  781. day, as specified by the start time and stop time elements of the
  782. <t SENDJOBTIME> structure, have any meaning. In fact, the day,
  783. date, month, and year are not guaranteed to be filled in.
  784. ********/
  785. typedef WORD SCHEDTYPE;
  786. #define SCHED_ASAP 1
  787. #define SCHED_BEFORE 2
  788. #define SCHED_AFTER 3
  789. #define SCHED_CHEAPTIMES 4
  790. /********
  791. @doc EXTERNAL SRVRDLL
  792. @type NONE | PROVIDERSTATE | A DWORD which describes the state of the Provider.
  793. Can consist of a combination of the following flags:
  794. @emem PROVIDER_OK | Standard OK state - no action is required.
  795. @emem PROVIDER_OFFLINE | Provider is offline - client should do
  796. the same. Offline indicates that the Provider is no longer
  797. actively able to send or receive jobs.
  798. @emem PROVIDER_NO_RESPONSE | No response from Provider. Client
  799. should go offline.
  800. @emem PROVIDER_BADERROR | Bad error at Provider. Client should go
  801. offline.
  802. @emem PROVIDER_RECEIVES_WAITING | Client should poll for receives.
  803. @emem PROVIDER_SENDS_COMPLETED | Client should poll for completed
  804. send status.
  805. ********/
  806. typedef DWORD PROVIDERSTATE;
  807. #define PROVIDER_OK 0x0000
  808. #define PROVIDER_OFFLINE 0x0001
  809. #define PROVIDER_NO_RESPONSE 0x0002
  810. #define PROVIDER_BADERROR 0x0004
  811. #define PROVIDER_RECEIVES_WAITING 0x0008
  812. #define PROVIDER_SENDS_COMPLETED 0x0010
  813. /********
  814. @doc EXTERNAL SRVRDLL
  815. @type NONE | JOBSTATE | A WORD identifying the state of a fax job.
  816. @emem jstNewMsg | Just received from mail spooler.
  817. @emem jstProcessingRecipients | Deciding what needs to be sent.
  818. @emem jstRendering | Being rendered (Used internally by client).
  819. @emem jstReadyToSend | Waiting to be schedulable.
  820. @emem jstSchedulable | Ready to be transmitted.
  821. @emem jstTransmitting | Being transmitted.
  822. @emem jstWaitingForServer | Given to network Provider (Used internally
  823. by client).
  824. @emem jstWaitingForClient | Waiting for client to take back.
  825. ********/
  826. typedef WORD JOBSTATE;
  827. #define jstNewMsg 0
  828. #define jstProcessingRecipients 1
  829. #define jstRendering 2
  830. #define jstReadyToSend 3
  831. #define jstSchedulable 4
  832. #define jstTransmitting 5
  833. #define jstAllDone 6
  834. #define jstWaitingForServer 7
  835. #define jstWaitingForClient 8
  836. /****
  837. @doc EXTERNAL SRVRDLL OVERVIEW
  838. @topic Data Structures |
  839. Most structures defined here are in a packed format; that is,
  840. there are no pointers to external objects. This is done so
  841. they can be easily stored in a file or transmitted as a block
  842. across the network.
  843. Most structures
  844. have two size fields. The HeaderSize field gives the defined
  845. size of the structure, which is used for versioning the structure.
  846. If the structure is expanded in the future, this size can be
  847. used to maintain backward compatibility. The TotalSize field
  848. indicates the size of the whole structure along with all its data.
  849. All strings and other variable-length data items such as
  850. structures are represented in the structure by an offset from the
  851. beginning of the structure. The actual data for these elements
  852. begins at that offset. The length of the data is indicated by
  853. the item itself. If it is a string, it is null-terminated. If
  854. it is another structure, the size fields will convey this
  855. information.
  856. All files referenced in the structures are created in the spool
  857. directory specified in LMI_InitProvider.
  858. ****/
  859. /********
  860. @doc EXTERNAL SRVRDLL DATATYPES
  861. @types LMICUSTOMOPTION | Overlay of LMI Custom Option data. For
  862. MAPI 1.0, Win32 implementations, this structure is found
  863. in the MAPI message property PR_FAX_LMI_CUSTOM_OPTION
  864. (property tag value 0x4513.)
  865. @field DWORD | dwTotalSize | Total number of BYTES occupied by the
  866. structure along with its concomitant variable sized data.
  867. @field WORD | wHeaderSize | Gives the size for the fixed
  868. size header portion of the structure.
  869. @field WORD | wNumRecords | Number of records in the Custom Option
  870. data. This is also eqaul to the size of the dwOffsetTable.
  871. @field DWORD | dwOffsetTable[] | Table of offsets to the records
  872. of type LMICUSTOMOPTIONRECORD. All offsets are from the
  873. top of the LMICUSTOMOPTION structure. The records should
  874. directly follow this array.
  875. ********/
  876. #ifndef RC_INVOKED
  877. #pragma warning (disable: 4200)
  878. #endif
  879. typedef struct _LMICUSTOMOPTION {
  880. DWORD dwTotalSize;
  881. WORD wHeaderSize;
  882. WORD wNumRecords;
  883. DWORD dwOffsetTable[0];
  884. } LMICUSTOMOPTION, FAR *LPLMICUSTOMOPTION;
  885. /********
  886. @doc EXTERNAL SRVRDLL DATATYPES
  887. @types LMICUSTOMOPTIONRECORD | Record overlay of LMI Custom Option data.
  888. @field DWORD | dwTotalSize | Total number of BYTES occupied by the
  889. structure along with its concomitant variable sized data.
  890. @field WORD | wHeaderSize | Gives the size for the fixed
  891. size header portion of the structure.
  892. @field WORD | wPad | Keep DWORD alignment.
  893. @field CHAR | szUniqueName[32] | Unique name specified by
  894. provider. This is used for identification of the
  895. provider's record within the LMICUSTOMOPTION and should
  896. contain some encoding of the provider developer company.
  897. eg, "Microsoft:Netfax". The string MUST be null
  898. terminated so that providers may do strcmp's to detect
  899. their own section.
  900. @field BYTE | lpData[] | Here's the data.
  901. ********/
  902. typedef struct _LMICUSTOMOPTIONRECORD {
  903. DWORD dwTotalSize;
  904. WORD wHeaderSize;
  905. WORD wPad;
  906. CHAR szUniqueName[32];
  907. BYTE lpData[];
  908. } LMICUSTOMOPTIONRECORD, FAR *LPLMICUSTOMOPTIONRECORD;
  909. #ifndef RC_INVOKED
  910. #pragma warning (default: 4200)
  911. #endif
  912. /********
  913. @doc EXTERNAL SRVRDLL DATATYPES
  914. @types LMIFORMAT | Describes a format.
  915. @field WORD | wHeaderSize | Gives the size for the fixed
  916. size header portion of the structure.
  917. @field WORD | wTotalSize | Total number of BYTES occupied by the
  918. structure along with its concomitant variable sized data.
  919. @field FAXERROR | feError | Indicates if there were any errors while
  920. trying to generate this format. If this field is not set to
  921. zero, the format file pointed to by the szFileName field may be
  922. invalid and should not be used. This error value might need to be
  923. propagated into the <e LMIRECIPSTATUS.feError> field for recipients
  924. which fail as a result of this format not being ready.
  925. @field CHAR | szFileName[16] | The filename containing the actual
  926. format data.
  927. @field FORMATTYPE | ftFormatType | Which format this represents.
  928. @field WORD | wPad | Keep DWORD alignment.
  929. ********/
  930. typedef struct _LMIFORMAT {
  931. WORD wHeaderSize;
  932. WORD wTotalSize;
  933. FAXERROR feError;
  934. CHAR szFileName[16];
  935. FORMATTYPE ftFormatType;
  936. WORD wPad;
  937. } LMIFORMAT, FAR *LPLMIFORMAT;
  938. #define MAXFORMATSIZE (sizeof(LMIFORMAT))
  939. /********
  940. @doc EXTERNAL SRVRDLL DATATYPES
  941. @types LMIPOLLREQUEST | Describes a poll request message.
  942. @field WORD | wHeaderSize | Gives the size for the fixed
  943. size header portion of the structure.
  944. @field WORD | wTotalSize | Total number of BYTES occupied by the
  945. structure along with its concomitant variable sized data.
  946. @field WORD | wszRecipName | The name of this recipient. This
  947. is present only if this recipient is from a Provider implemented
  948. address book. In this case <e LMIRECIPIENT.wszAddressOffset> is zero.
  949. @field WORD | wszAddressOffset | The Microsoft At Work address for this
  950. recipient. Not present for recipients implemented in the
  951. Provider's address book. See <t Microsoft At Work Address> for
  952. details.
  953. @field DWORD | dwPollContext |
  954. The provider should report this value in the dwPollContext field
  955. of the LMIRECVSTATUS structure for all the messages received as a
  956. result of this poll request. This enables the client to associate the
  957. received messages (reported to the client via LMI_ReportReceives)
  958. with a particular poll request. A value of zero is valid, but not
  959. useful, because all non-polled receives reported by LMI_ReportReceives
  960. have zero as the dwPollContext in their LMIRECVSTATUS structure.
  961. @field POLLTYPE | ptPollType | What type of a poll request this is.
  962. @field WORD | wszPollNameOffset | The name to be sent along with the
  963. poll request. The specific semantic meaning depends on the poll
  964. type.
  965. @field WORD | wszPollPasswordOffset | Offset to the password to be sent
  966. along with the poll request.
  967. @field WORD | wPad | Keep DWORD alignment.
  968. ********/
  969. typedef struct _LMIPOLLREQUEST {
  970. WORD wHeaderSize;
  971. WORD wTotalSize;
  972. WORD wszRecipName;
  973. WORD wszAddressOffset;
  974. DWORD dwPollContext;
  975. POLLTYPE ptPollType;
  976. WORD wszPollNameOffset;
  977. WORD wszPollPasswordOffset;
  978. WORD wPad;
  979. } LMIPOLLREQUEST, FAR *LPLMIPOLLREQUEST;
  980. /********
  981. @doc EXTERNAL SRVRDLL
  982. @types LMIQUEUEDATA | Represents queue information about a single job.
  983. @field WORD | wHeaderSize | Gives the size for the fixed
  984. size header portion of the structure.
  985. @field WORD | wTotalSize | Total number of BYTES occupied by the
  986. structure along with its concomitant variable sized data.
  987. @field DWORD | dwUniqueID | This can be used by the Provider to
  988. pass in a context. Along with <e LMIQUEUEDATA.dwUniqueID2> and
  989. <e LMIQUEUEDATA.wszSenderMachineNameOffset> this
  990. must uniquely identify this job.
  991. @field DWORD | dwUniqueID2 | See <e LMIQUEUEDATA.dwUniqueID>.
  992. @field WORD | wszSenderMachineNameOffset | Points to a string which
  993. identifies the machine originating this job. Used for display in
  994. the queue. Also uniquely identifies the job along with the unique
  995. ID's. This should be the same as the string pointed to by the
  996. <e LMISENDJOB.wszSenderMachineNameOffset> field in <t LMISENDJOB>.
  997. @field WORD | wszSubjectOffset | Offset to the subject of this
  998. message. This should be the same as the string pointed to by the
  999. <e LMISENDJOB.wszSubjectOffset> field in <t LMISENDJOB>.
  1000. @field DWORD | dwSize | This should be the same as what was passed
  1001. in as <e LMISENDJOB.dwTotalFileSize> in <t LMISENDJOB>.
  1002. @field WORD | wNumRecipients | This should be the same as what was passed
  1003. in as <e LMISENDJOB.wNumRecipients> in <t LMISENDJOB>.
  1004. @field JOBSTATE | jstState | Current overall status for this job.
  1005. @field WORD | wNumRecipDone | Number of recipients for which transmission
  1006. has been completed, either succesfully or unsuccesfully.
  1007. @field WORD | wtmSendTimeOffset | Current scheduling state for this
  1008. job. Offset to a <t SENDJOBTIME> structure.
  1009. @field WORD | wrgbCustomStatusOffset | Offset to Provider defined custom
  1010. status information. This is passed to the
  1011. <f LMI_DisplayCustomStatus> function when the user asks to see
  1012. detailed status for this job.
  1013. @field WORD | wCustomDataSize | Size of the custom data pointed to by
  1014. the <e LMISENDJOB.wrgbCustomStatusOffset> field.
  1015. ********/
  1016. typedef struct _LMIQUEUEDATA {
  1017. WORD wHeaderSize;
  1018. WORD wTotalSize;
  1019. DWORD dwUniqueID;
  1020. DWORD dwUniqueID2;
  1021. WORD wszSenderMachineNameOffset;
  1022. WORD wszSubjectOffset;
  1023. DWORD dwSize;
  1024. WORD wNumRecipients;
  1025. JOBSTATE jstState;
  1026. WORD wNumRecipDone;
  1027. WORD wtmSendTimeOffset;
  1028. WORD wrgbCustomStatusOffset;
  1029. WORD wCustomDataSize;
  1030. } LMIQUEUEDATA, NEAR *NPLMIQUEUEDATA, FAR *LPLMIQUEUEDATA;
  1031. /********
  1032. @doc EXTERNAL SRVRDLL
  1033. @types LMIQUEUEFILEHEADER | A queue file consists of this header followed
  1034. by the queue data.
  1035. @field DWORD | dwSig | This must be set to SIG_QUEUEFILE.
  1036. @field DWORD | dwSize | Must be set to the total file size.
  1037. @field DWORD | dwNumEntries | Number of queue entries in the file. The
  1038. header is followed by this many <t LMIQUEUEDATA> structures.
  1039. ********/
  1040. #define SIG_QUEUEFILE 0x56873
  1041. typedef struct _LMIQUEUEFILEHEADER {
  1042. DWORD dwSig; // Should always be NQFH
  1043. DWORD dwSize; // Total file size
  1044. DWORD dwNumEntries; // Num of entries in the file
  1045. } LMIQUEUEFILEHEADER;
  1046. /********
  1047. @doc EXTERNAL SRVRDLL DATATYPES
  1048. @types LMIRECIPIENT | Describes a recipient.
  1049. @field WORD | wHeaderSize | Gives the size for the fixed
  1050. size header portion of the structure.
  1051. @field WORD | wTotalSize | Total number of BYTES occupied by the
  1052. structure along with its concomitant variable sized data.
  1053. @field WORD | wszRecipName | The name of this recipient. This
  1054. is present only if this recipient is from a Provider implemented
  1055. address book. In this case <e LMIRECIPIENT.wszAddressOffset> is
  1056. zero and <e LMIRECIPIENT.szCoverFile> is a reference to a template
  1057. on the Provider.
  1058. @field WORD | wszAddressOffset | The Microsoft At Work address for this
  1059. recipient. Not present for recipients implemented in the
  1060. Provider's address book. See <lq>Microsoft At Work Address<rq> for
  1061. details.
  1062. @field CHAR | szCoverFile[16] | The filename containing the cover
  1063. page data if any for this recipient. This could be a reference to
  1064. a previously uploaded template if this is a recipient from the
  1065. Provider's address book. If the first word of this character array
  1066. is 0 but the second word is non-null, then the second word represent
  1067. a WORD offset into the LMIRECIPIENT structure where the fully
  1068. qualified path may be found.
  1069. @field CHAR | szEncryptFile[16] | If one of the linearized formats
  1070. pointed to by this recipient structure is a public key encrypted
  1071. message being sent to multiple recipients, then this field contains
  1072. the filename for a linearized format of the message encrypted with
  1073. this recipients public key. This field will not be valid under any
  1074. other circumstance.
  1075. @field WORD | wG3FormatIndex | If non-zero, this specifies a 1-based
  1076. index into the format structure array. It implies that this
  1077. recipient can accept this version of the G3 format. Note that
  1078. there may still be some run time conversions necessary on this
  1079. format at the time of sending. For instance, the format may be
  1080. MMR, whereas on calling it may be discovered that the recipient
  1081. only accepts MH. In this case, the Provider is responsible
  1082. for converting this on the fly.
  1083. @field WORD | wLinImageFormatIndex | Index into the format array. Pointer
  1084. to a linearized image format which can be sent to this recipient.
  1085. @field WORD | wLinBinaryFormatIndex | Index into the format array. Pointer
  1086. to a linearized binary format which can be sent to this recipient.
  1087. @field WORD | wPad | Keep DWORD alignment.
  1088. ********/
  1089. typedef struct _LMIRECIPIENT {
  1090. WORD wHeaderSize;
  1091. WORD wTotalSize;
  1092. WORD wszRecipName;
  1093. WORD wszAddressOffset;
  1094. CHAR szCoverFile[16];
  1095. CHAR szEncryptFile[16];
  1096. WORD wG3FormatIndex;
  1097. WORD wLinImageFormatIndex;
  1098. WORD wLinBinaryFormatIndex;
  1099. WORD wPad;
  1100. } LMIRECIPIENT, FAR *LPLMIRECIPIENT;
  1101. #define MAXRECIPIENTSIZE (sizeof(LMIRECIPIENT) + MAX_ADDRESS_LENGTH)
  1102. /*******
  1103. @doc EXTERNAL SRVRDLL DATATYPES
  1104. @types LMIRECIPSTATUS | Used to convey information for the final
  1105. status of the completed send for a recipient.
  1106. @field WORD | wHeaderSize | Gives the size for the fixed
  1107. size header portion of the structure.
  1108. @field WORD | wTotalSize | Total number of BYTES occupied by the
  1109. structure along with its concomitant variable sized data.
  1110. @field WORD | wrcCapsOffset | An offset to a <t MACHINECAPS> structure
  1111. containing the updated capabilites for this recipient.
  1112. @field FORMATTYPE | ftSentFormat | The format type which was finally sent
  1113. to this recipient.
  1114. @field FAXERROR | feError | The final status for this recipient.
  1115. @field SYSTEMTIME | dtTransmitTime | The time at which the fax was last
  1116. attempted to be sent.
  1117. @field DWORD | dwConnectTime | Connect time for the transmission in
  1118. seconds.
  1119. *******/
  1120. typedef struct _LMIRECIPSTATUS {
  1121. WORD wHeaderSize;
  1122. WORD wTotalSize;
  1123. WORD wrcCapsOffset;
  1124. FORMATTYPE ftSentFormat;
  1125. FAXERROR feError;
  1126. DWORD dwConnectTime;
  1127. SYSTEMTIME dtTransmitTime;
  1128. } LMIRECIPSTATUS, FAR *LPLMIRECIPSTATUS;
  1129. /********
  1130. @doc EXTERNAL SRVRDLL
  1131. @types LMIRECVSTATUS | Gives the status for a received fax.
  1132. @field WORD | wHeaderSize | Gives the size for the fixed
  1133. size header portion of the structure.
  1134. @field WORD | wTotalSize | Total number of BYTES occupied by the
  1135. structure along with its concomitant variable sized data.
  1136. @field FAXERROR | feError | The final status for this receive.
  1137. @field SYSTEMTIME | dtRecvTime | Should be filled with the time at
  1138. which the fax was received.
  1139. @field DWORD | dwConnectTime | The connect time for the
  1140. transmission in seconds.
  1141. @field DWORD | dwPollContext | If this receive was actually in response
  1142. to a poll request, then this will be set to the same value which
  1143. was passed in in the <t LMIPOLLREQUEST> structure sent along with
  1144. the poll request.
  1145. @field ATOM | atFile | The filename containing the received fax file. This
  1146. file should be in the spool directory agreed upon in the
  1147. <f LMI_InitLogicalModem> call.
  1148. @field WORD | wPad | Keep DWORD alignment.
  1149. ********/
  1150. typedef struct _LMIRECVSTATUS {
  1151. WORD wHeaderSize;
  1152. WORD wTotalSize;
  1153. FAXERROR feError;
  1154. SYSTEMTIME dtRecvTime;
  1155. DWORD dwConnectTime;
  1156. DWORD dwPollContext;
  1157. ATOM atFile;
  1158. WORD wPad;
  1159. } LMIRECVSTATUS, FAR *LPLMIRECVSTATUS;
  1160. /********
  1161. @doc EXTERNAL SRVRDLL DATATYPES
  1162. @types LMISENDJOB | Describes a new fax job. A fax job specifies a send to
  1163. one or more recipients.
  1164. @field DWORD | dwTotalSize | Total number of BYTES occupied by the
  1165. structure along with its concomitant variable sized data.
  1166. @field WORD | wHeaderSize | Gives the size for the fixed
  1167. size header portion of the structure.
  1168. @field WORD | fUnicode | Indicates whether the string pointed to by
  1169. <e LMISENDJOB.wszSenderMachineNameOffset> is a Unicode string or
  1170. not.
  1171. @field WORD | wszSenderMachineNameOffset | Points to a string which
  1172. identifies the machine originating this job. Used for display in
  1173. the queue. Also uniquely identifies the job along with the unique
  1174. ID's.
  1175. @field WORD | wszSubjectOffset | Subject of the message. Used for display
  1176. purposes in the queue.
  1177. @field DWORD | dwUniqueID | Used by the client to uniquely identify
  1178. this send fax job along with <e LMISENDJOB.dwUniqueID2>.
  1179. @field DWORD | dwUniqueID2 | Used along with <e LMISENDJOB.dwUniqueID> to
  1180. identify this job.
  1181. @field DWORD | dwBillingCode | Billing code for this job. This is to allow
  1182. Providers to keep accurate billing logs.
  1183. @field DWORD | dwTotalFileSize | An approximation for the total size
  1184. of the data required to be transmitted for this message for all
  1185. recipients combined. Meant for display purposes in the queue to allow some
  1186. idea of how long the job is likely to take.
  1187. @field WORD | wtmSendTimeOffset | Offset to a <t SENDJOBTIME> scheduling
  1188. structure.
  1189. @field WORD | wprPollRequestOffset | Offset to a poll request structure.
  1190. See <t LMIPOLLREQUEST> for details. If this offset is set, there
  1191. are no recipient or format structures associated with this job. In
  1192. other words, the rgwStructOffsets field will be zero.
  1193. @field WORD | wrgbCustomOptionOffset | Offset to custom message options
  1194. set for this message. This is an offset to data returned by a
  1195. call to <f LMI_SetCustomMsgOptions>. The first DWORD of the data
  1196. indicates the size of the data.
  1197. @field WORD | wNumRecipients | The number of recipients for this job.
  1198. @field WORD | wNumFormats | The number of rendered formats associated
  1199. with this job.
  1200. @field WORD | wPad | Keep DWORD alignment.
  1201. @field DWORD | rgdwStructOffsets[] | Array of size
  1202. <e LMISENDJOB.wNumFormats> and <e LMISENDJOB.wNumRecipients>
  1203. offsets to format and recipient structures. The <t LMISENDJOB>
  1204. structure is followed by all these structures. The <t LMIFORMAT>
  1205. structures come first.
  1206. ********/
  1207. #ifndef RC_INVOKED
  1208. #pragma warning (disable: 4200)
  1209. #endif
  1210. // The basic fax job structure for any send
  1211. typedef struct _LMISENDJOB {
  1212. DWORD dwTotalSize;
  1213. WORD wHeaderSize;
  1214. WORD fUnicode;
  1215. WORD wszSenderMachineNameOffset;
  1216. WORD wszSubjectOffset;
  1217. DWORD dwUniqueID;
  1218. DWORD dwUniqueID2;
  1219. DWORD dwBillingCode;
  1220. DWORD dwTotalFileSize;
  1221. WORD wtmSendTimeOffset;
  1222. WORD wprPollRequestOffset;
  1223. WORD wrgbCustomOptOffset;
  1224. WORD wNumRecipients;
  1225. WORD wNumFormats;
  1226. WORD wPad;
  1227. DWORD rgdwStructOffsets[];
  1228. } LMISENDJOB, FAR *LPLMISENDJOB;
  1229. #ifndef RC_INVOKED
  1230. #pragma warning (default: 4200)
  1231. #endif
  1232. /********
  1233. @doc EXTERNAL SRVRDLL DATATYPES
  1234. @types LMISENDSTATUS | Conveys back status information at the end of a
  1235. send job.
  1236. @field WORD | wHeaderSize | Gives the size for the fixed
  1237. size header portion of the structure.
  1238. @field WORD | wTotalSize | Total number of BYTES occupied by the
  1239. structure along with its concomitant variable sized data.
  1240. @field FAXERROR | feJobError | Indicates any global error which
  1241. caused all recipients to fail, such as cancellation by the user, or
  1242. an out of memory situation. This should only be set if none of
  1243. the recipients for this message were succesfully contacted.
  1244. @field DWORD | dwUniqueID | Used by the client to uniquely identify
  1245. this send fax job along with <e LMISENDSTATUS.dwUniqueID2>.
  1246. This should be the same as the one passed in the <t LMISENDJOB>
  1247. structure.
  1248. @field DWORD | dwUniqueID2 | Used along with <e LMISENDSTATUS.dwUniqueID>
  1249. to identify this job. Should be the same as the one passed in the
  1250. <t LMISENDJOB> structure.
  1251. @field WORD | fUnicode | Indicates that the
  1252. <e LMISENDSTATUS.szSenderMachineName> field contains a unicode
  1253. string.
  1254. @field WORD | wPad | Keep DWORD alignment.
  1255. @field CHAR | szSenderMachineName[MAX_SERVERNAME_SIZE * 2] | Points to a
  1256. string which identifies the machine originating this job.
  1257. This should be the same as the one passed in the <t LMISENDJOB>
  1258. structure.
  1259. @field LMIRECIPSTATUS | rgnrsRecipStatus[] | An array of recipient status
  1260. structures, one for each recipient of the message. These structures
  1261. are not required if <e LMISENDSTATUS.feJobError> is set. If present,
  1262. the order of recipients in this array must be the same as the order in
  1263. which they were submitted in the <t LMISENDJOB> structure.
  1264. ********/
  1265. #ifndef RC_INVOKED
  1266. #pragma warning (disable: 4200)
  1267. #endif
  1268. typedef struct _LMISENDSTATUS {
  1269. WORD wHeaderSize;
  1270. WORD wTotalSize;
  1271. FAXERROR feJobError;
  1272. DWORD dwUniqueID;
  1273. DWORD dwUniqueID2;
  1274. WORD fUnicode;
  1275. WORD wPad;
  1276. CHAR szSenderMachineName[MAX_SERVERNAME_SIZE*2];
  1277. LMIRECIPSTATUS rgnrsRecipStatus[];
  1278. } LMISENDSTATUS, FAR *LPLMISENDSTATUS;
  1279. #ifndef RC_INVOKED
  1280. #pragma warning (default: 4200)
  1281. #endif
  1282. /*******
  1283. @doc EXTERNAL SRVRDLL DATATYPES
  1284. @types MACHINECAPS | This structure describes the capabilites for a
  1285. fax machine. It is used to return updated capabilities for
  1286. any fax machine contacted and allows intelligent preprocessing
  1287. the next time a fax is sent to the same number.
  1288. @field WORD | wHeaderSize | Gives the size for the fixed size header
  1289. portion of the structure.
  1290. @field WORD | wTotalSize | Total number of BYTES occupied by the
  1291. structure along with its concomitant variable sized data.
  1292. @field WORD | wbDISCapsOffset | Offset to a DIS frame containing
  1293. capabilities of the machine. The format of the frame is defined
  1294. by the <t FR> structure.
  1295. @field WORD | wbNSFCapsOffset | Offset to a sequence of encrypted
  1296. Microsoft At Work NSF frames containing At Work capabilities for
  1297. the machine. The format of each frame is defined by the <t FR>
  1298. structure. A frame with a null type and 0 length terminates the
  1299. sequence. Valid for any Microsoft At Work enabled Provider.
  1300. *******/
  1301. typedef struct {
  1302. WORD wHeaderSize;
  1303. WORD wTotalSize;
  1304. WORD wbDISCapsOffset;
  1305. WORD wbNSFCapsOffset;
  1306. } MACHINECAPS, FAR *LPMACHINECAPS;
  1307. /********
  1308. @doc EXTERNAL SRVRDLL INITIALIZATION
  1309. @types MODEMCAPS | Specifies all the capabilities for a logical modem. When
  1310. specified by the client (for example in LMI_ExchangeCaps), the
  1311. structure represents the capabilities which are supported
  1312. by the client.
  1313. @field WORD | wHeaderSize | Size of this structure.
  1314. @field WORD | wTotalSize | Total size with concomitant data.
  1315. @field DWORD | dwGenCaps | Lists general capabilities. The following flags
  1316. can be set:
  1317. @flag OWN_ADDRESS_BOOK | Indicates that the modem can maintain it's own
  1318. address book.
  1319. @flag ADVANCED_STORE | Indicates that the modem can manage its own
  1320. store and upload messages to it.
  1321. @flag COVER_PAGE_RENDERER | Indicates that the modem can render
  1322. Microsoft At Work cover page templates.
  1323. @flag REAL_TIME_STATUS | Indicates that real time status updates for
  1324. the current job are supported.
  1325. @flag MULTIPLE_RECIPIENTS | Indicatest that messages can be sent to
  1326. multiple recipients.
  1327. @flag PER_RECIP_COVER | Indicates that per recipient cover pages are
  1328. supported. If this is not set, the <e LMIRECIPIENT.szCoverFile>
  1329. field of the <t LMIRECIPIENT> structure will not be used.
  1330. @flag PER_RECIP_ENCRYPTION | Indicates that key encrypted sends to
  1331. multiple recipients are supported. If this is not set,
  1332. the <e LMIRECIPIENT.szEncryptFile> field of
  1333. the <t LMIRECIPIENT> structure will never be used.
  1334. @flag CUSTOM_MSG_OPTIONS | Indicates that the modem supports setting of
  1335. custom per message options. If not set, the function
  1336. <f LMI_SetCustomMsgOptions> need not be implemented.
  1337. @flag POLL_REQUEST | Indicates that poll requests using T30 fields
  1338. is supported. If not, the <t LMIPOLLREQUEST> structure should
  1339. not be used.
  1340. @flag ABOVE64K_STRUCTURES | Indicates that the <t LMISENDJOB> structure
  1341. can have a total size > 64K. For x86 based systems, this allows
  1342. far pointers to be used instead of huge pointers.
  1343. @flag ALLOW_SHARING | Indicates that this device can be shared.
  1344. @flag PRECIOUS_RESOURCE | Indicates that this device is a precious
  1345. resource on the local machine which may need to be shared with
  1346. other MAPI providers. For example, a modem which may be used
  1347. by another provider to access dial-up services for mail delivery.
  1348. The MAPI transport will use this flag to determine if it should
  1349. support MAPI's FlushQueues semantics.
  1350. @field DWORD | dwSchedCaps | Lists scheduling related capabilities. The
  1351. following flags are defined:
  1352. @flag SUPPORT_QUEUEING | Indicates whether the modem can queue up
  1353. multiple jobs at a time, or can only process them one at a time.
  1354. @flag ALLOW_SCHED_ASAP | Indicates that jobs can be scheduled as ASAP.
  1355. @flag ALLOW_SCHED_AFTER | Indicates that jobs can be scheduled as
  1356. SCHED_AFTER.
  1357. @flag ALLOW_SCHED_BEFORE | Indicates that jobs can be scheduled as
  1358. SCHED_BEFORE.
  1359. @flag ALLOW_SCHED_CHEAPTIMES | Indicates that jobs can be scheduled
  1360. for cheap times. This capability assumes that the cheap times are
  1361. defined by the Provider.
  1362. @flag ALLOW_CLIENT_CHEAPTIMES | Allows the client to set the cheap
  1363. times independently for each job.
  1364. @flag USE_UTC_TIMES | Indicates that the times indicated in the
  1365. <t SENDJOBTIME> structure are in UTC and not in local time. If
  1366. any of the client or the Provider do not support this capability
  1367. the times will revert to being local times.
  1368. @field WORD | wmcOffset | Offset to <t MACHINECAPS> structure which should
  1369. be filled in with all the capabilities which this modem has:
  1370. essentially what it would send back to a caller in the
  1371. DIS and NSF frames.
  1372. @field WORD | wMaxRetries | Indicates the maximum number of retries
  1373. permitted for a send. The client should not set the
  1374. <e SENDJOBTIME.wNumRetries> field of the <t SENDJOBTIME> structure
  1375. to a number greater than this.
  1376. @field WORD | wMinTimeBetweenRetries | Specifies the minimum amount of
  1377. time that can be specified between retries. The client should never
  1378. set the <e SENDJOBTIME.wMinBetweenRetries> field of the
  1379. <t SENDJOBTIME> structure to anything less than this.
  1380. @field WORD | wPad | Keep DWORD alignment.
  1381. ********/
  1382. typedef struct {
  1383. WORD wHeaderSize;
  1384. WORD wTotalSize;
  1385. DWORD dwGenCaps;
  1386. DWORD dwSchedCaps;
  1387. WORD wmcOffset;
  1388. WORD wMaxRetries;
  1389. WORD wMinTimeBetweenRetries;
  1390. WORD wPad;
  1391. } MODEMCAPS, FAR *LPMODEMCAPS;
  1392. // General caps
  1393. #define OWN_ADDRESS_BOOK 0x0001
  1394. #define ADVANCED_STORE 0x0002
  1395. #define COVER_PAGE_RENDERER 0x0004
  1396. #define REAL_TIME_STATUS 0x0008
  1397. #define MULTIPLE_RECIPIENTS 0x0010
  1398. #define PER_RECIP_COVER 0x0020
  1399. #define PER_RECIP_ENCRYPTION 0x0040
  1400. #define CUSTOM_MSG_OPTIONS 0x0080
  1401. #define POLL_REQUEST 0x0100
  1402. #define ABOVE64K_STRUCTURES 0x0200
  1403. #define ALLOW_SHARING 0x0400
  1404. #define ALLOW_RESHARING 0x0800
  1405. #define PRECIOUS_RESOURCE 0x1000
  1406. // Sched caps
  1407. #define SUPPORT_QUEUEING 0x0001
  1408. #define ALLOW_SCHED_ASAP 0x0002
  1409. #define ALLOW_SCHED_AFTER 0x0004
  1410. #define ALLOW_SCHED_BEFORE 0x0008
  1411. #define ALLOW_SCHED_CHEAPTIMES 0x0010
  1412. #define ALLOW_CLIENT_CHEAPTIMES 0x0020
  1413. #define USE_UTC_TIMES 0x0040
  1414. /********
  1415. @doc EXTERNAL SRVRDLL DATATYPES
  1416. @types SENDJOBTIME | Contains all the scheduling informations for a job.
  1417. @field WORD | wHeaderSize | Size of this structure.
  1418. @field WORD | wNumRetries | Maximum number of retries for busy numbers.
  1419. @field WORD | wMinBetweenRetries | Minutes to be allowed to elapse between successive
  1420. retries.
  1421. @field SCHEDTYPE | stSchedType | Type of scheduling required for this job.
  1422. @field SYSTEMTIME | dtStartTime | Time after which job is schedulable.
  1423. @field SYSTEMTIME | dtStopTime | Time after which job is not schedulable.
  1424. ********/
  1425. typedef struct {
  1426. WORD wHeaderSize;
  1427. WORD wNumRetries;
  1428. WORD wMinBetweenRetries;
  1429. SCHEDTYPE stSchedType;
  1430. SYSTEMTIME dtStopTime;
  1431. SYSTEMTIME dtStartTime;
  1432. } SENDJOBTIME, FAR *LPSENDJOBTIME;
  1433. /****
  1434. @doc EXTERNAL SRVRDLL
  1435. @topic The Logical Modem Interface |
  1436. The following section details the functions that make up the
  1437. Logical Modem Interface.
  1438. ****/
  1439. /********
  1440. @doc EXTERNAL SRVRDLL
  1441. @api LMI_RETURN | LMI_AbortSendJob | Aborts the specified send job
  1442. from the Provider's queue.
  1443. @parm DWORD | dwLogicalModem | The logical modem from whose queue the
  1444. job is to be cancelled.
  1445. @parm LPTSTR | lpszSenderMachineName | String identifying the sender
  1446. machine name. This parameter, along with the <p dwUniqueID> and
  1447. <p dwUniqueID2> uniquely identify this job for the Provider.
  1448. These all must be same as the values passed in the
  1449. <t LMISENDJOB> structure passed into <f LMI_SendFax>.
  1450. @parm DWORD | dwUniqueID | See <p lpszSenderMachineName>.
  1451. @parm DWORD | dwUniqueID2 | See <p lpszSenderMachineName>.
  1452. @rdesc LMI_SUCCESS on success.
  1453. @comm The abort can be performed asynchronously by the Provider. Return
  1454. from this function does not imply any guarantees as to the time
  1455. within which the job will be aborted. The provider reports
  1456. the final state of the job via LMI_ReportSend. The client will ensure
  1457. that this function is only called to abort jobs which were
  1458. initiated on its machine.
  1459. ********/
  1460. LMI_RETURN FAR PASCAL LMI_AbortSendJob(DWORD dwLogicalModem,
  1461. LPTSTR lpszSenderMachineName,
  1462. DWORD dwUniqueID,
  1463. DWORD dwUniqueID2);
  1464. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_AbortSendJob)(DWORD dwLogicalModem,
  1465. LPTSTR lpszSenderMachineName,
  1466. DWORD dwUniqueID,
  1467. DWORD dwUniqueID2);
  1468. /********
  1469. @doc EXTERNAL SRVRDLL INSTALLATION
  1470. @func LMI_RETURN | LMI_AddModem | Called to add a new logical modem to
  1471. the list of current modems.
  1472. @parm HWND | hDlg | The window handle of the parent dialog box. This
  1473. should be used as the parent for any new dialog boxes which are
  1474. displayed.
  1475. @parm LPTSTR | modembuf | Pointer to the buffer where the call
  1476. should return a zero-terminated string uniquely identifying the
  1477. logical modem the user selected. <p buflen> gives the maximum
  1478. length this string can be (including the zero termination).
  1479. @parm WORD | buflen | Length of the buffer pointed to by
  1480. <p modembuf>. This is guaranteed to be at least 64 BYTES.
  1481. @rdesc The dialog should handle notifying the user of errors if it can
  1482. put its first dialog up.
  1483. @comm This function is called to put up a dialog box allowing the user
  1484. to select a logical modem to add to the list of current modems.
  1485. The function should return a displayable string that is shown
  1486. in the user list. This is also the string which is passed in to
  1487. identify the modem in the <f LMI_InitLogicalModem> call.
  1488. ********/
  1489. LMI_RETURN FAR PASCAL LMI_AddModem(HWND hDlg,
  1490. LPTSTR modembuf,
  1491. WORD buflen);
  1492. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_AddModem)(HWND hDlg,
  1493. LPTSTR modembuf,
  1494. WORD buflen);
  1495. /********
  1496. @doc EXTERNAL SRVRDLL
  1497. @api PROVIDERSTATE | LMI_CheckProvider | Pings the Provider to see if it
  1498. is alive.
  1499. @rdesc Returns state of Provider. This return value can be used to make
  1500. the client poll the Provider for events.
  1501. @comm This can be called periodically by the client and should be
  1502. implemented in as efficient a manner as possible. It can be
  1503. used by the client to decide whether it needs to go offline
  1504. among other things.
  1505. It is not mandatory for this to return a completely accurate
  1506. state of the Provider. If finding this information is very
  1507. expensive, the Provider can, at its discretion, do this less
  1508. frequently, and return the stale state in the intermediate polls.
  1509. @parm DWORD | dwLogicalModem | Handle representing the logical modem to
  1510. be checked.
  1511. @parm LPATOM | lpatError | If there was an error and the Provider is
  1512. having problems, a global atom containing a descriptive string
  1513. for this error can be returned here. Any string returned will be
  1514. displayed to the user at the client's discretion. The atom will
  1515. be freed by the client.
  1516. ********/
  1517. PROVIDERSTATE FAR PASCAL LMI_CheckProvider(DWORD dwLogicalModem,
  1518. LPATOM lpatError);
  1519. typedef PROVIDERSTATE (FAR PASCAL FAR *LPLMI_CheckProvider) (DWORD dwLogicalModem,
  1520. LPATOM lpatError);
  1521. /*******
  1522. @doc EXTERNAL SRVRDLL CONFIGURATION
  1523. @api LMI_RETURN | LMI_ConfigureModem | Called to let the user
  1524. configure a logical modem.
  1525. @parm HWND | hDlg | The window handle of the parent dialog box. This
  1526. should be used as the parent for any new dialog boxes which are
  1527. displayed.
  1528. @parm LPTSTR | lpszModem | Pointer to string representing the logical
  1529. modem to be configured. This is the same string which was
  1530. returned by <f LMI_AddModem>.
  1531. @rdesc Returns LMI_SUCCESS if successful.
  1532. *******/
  1533. LMI_RETURN FAR PASCAL LMI_ConfigureModem(HWND hDlg,
  1534. LPTSTR lpszModem);
  1535. /********
  1536. @doc EXTERNAL SRVRDLL
  1537. @api LMI_RETURN | LMI_DeinitLogicalModem | Deinitializes the
  1538. specified logical modem.
  1539. @parm DWORD | dwLogicalModem | Handle representing the logical modem to
  1540. be deinitialized.
  1541. @rdesc LMI_SUCCESS if successful.
  1542. ********/
  1543. LMI_RETURN FAR PASCAL LMI_DeinitLogicalModem (DWORD dwLogicalModem);
  1544. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_DeinitLogicalModem) (DWORD
  1545. dwLogicalModem);
  1546. /********
  1547. @doc EXTERNAL SRVRDLL
  1548. @api LMI_RETURN | LMI_DeinitProvider| Deinitializes the LMI provider.
  1549. @rdesc LMI_SUCCESS if successful.
  1550. ********/
  1551. LMI_RETURN FAR PASCAL LMI_DeinitProvider (VOID);
  1552. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_DeinitProvider) (VOID);
  1553. /********
  1554. @doc EXTERNAL SRVRDLL
  1555. @api LMI_RETURN | LMI_DisplayCustomStatus | Displays extended status
  1556. information for a job.
  1557. @parm HWND | hwndParent | Parent window handle which should be used for
  1558. displaying any dialogs.
  1559. @parm LPBYTE | lpbCustomData | Pointer to the start of the custom
  1560. data associated with this job.
  1561. @parm WORD | wCustomDataSize | Size in BYTES of the data pointed to
  1562. by <p lpbCustomData>.
  1563. *********/
  1564. LMI_RETURN FAR PASCAL LMI_DisplayCustomStatus(HWND hwndParent,
  1565. LPBYTE lpbCustomData,
  1566. WORD wCustomDataSize);
  1567. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_DisplayCustomStatus)(HWND hwndParent,
  1568. LPBYTE lpbCustomData,
  1569. WORD wCustomDataSize);
  1570. /********
  1571. @doc EXTERNAL SRVRDLL
  1572. @api LMI_RETURN | LMI_ExchangeCaps | Allows the client and the Provider
  1573. to exchangde <t MODEMCAPS> structures without having to initialize
  1574. the Provider or a logical modem. This is one of two calls which
  1575. can be made without an initialized modem.
  1576. @parm LPTSTR | lpszLogicalModem | Pointer to string identifying logical
  1577. modem the caps belong to.
  1578. @parm LPMODEMCAPS | lpmcClient | Pointer to a <t MODEMCAPS> structure
  1579. that describes the capabilities of the client. This should be used
  1580. by the Provider to decide which formats can be understood by the
  1581. client. For instance, if the client only understands MH, then
  1582. the Provider would need to convert any received faxes into MH
  1583. before reporting them in <f LMI_ReportReceives>. Similarly, this
  1584. can indicate to the Provider whether or not features such as
  1585. uploading of messages and Provider address books are supported by
  1586. this particular client implementation. If this pointer is null,
  1587. it should be ignored.
  1588. @parm LPMODEMCAPS | lpmcProvider | Points to a <t MODEMCAPS> structure
  1589. which should be filled in with the capabilities of this Provider.
  1590. The size of the memory pointed to by this structure is filled in
  1591. the wTotalSize field of the structure. If this pointer is null,
  1592. no capabilities need to be returned.
  1593. @rdesc LMI_SUCCESS on success.
  1594. @comm It is perfectly valid for a Provider to return LMIERR_NOT_SUPPORTED
  1595. for this call. A Provider may need to do this if it cannot
  1596. determine the modem capabilities without actually initializing
  1597. the modem.
  1598. ********/
  1599. LMI_RETURN FAR PASCAL LMI_ExchangeCaps (LPTSTR lpszLogicalModem,
  1600. LPMODEMCAPS lpmcClient,
  1601. LPMODEMCAPS lpmcProvider);
  1602. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_ExchangeCaps)(LPTSTR lpszLogicalModem,
  1603. LPMODEMCAPS lpmcClient,
  1604. LPMODEMCAPS lpmcProvider);
  1605. /********
  1606. @doc EXTERNAL SRVRDLL
  1607. @api DWORD | LMI_GetQueueFile | Retrieves the name of the queue file
  1608. for a logical modem from the Provider.
  1609. @parm DWORD | dwLogicalModem | A handle to the logical modem for which
  1610. the queue is desired. If a valid handle is supplied, the
  1611. <p lpszLogicalModemName> parameter should
  1612. be NULL.
  1613. @parm LPTSTR | lpszLogicalModemName | A string identifying the logical
  1614. modem for which the user wants to see the queue, if this modem
  1615. has not been initialized previously. This is one of two APIs which
  1616. can be called without initializing a modem. If this parameter is
  1617. used, the <p dwLogicalModem> parameter should be ignored.
  1618. @parm LPATOM | lpatFileName | The function should return a global
  1619. atom containing a fully qualified path name to the queue file.
  1620. This does not have to be on the local disk. The pathname should
  1621. be such that it can be passed to a Windows CreateFile call.
  1622. @parm WORD | wFlags | Can be any combination of the following flags:
  1623. @flag NGQ_USER_REQUEST | Implies that the queue update request
  1624. is being made due to an explicit user refresh request. Transports
  1625. which have expensive updates can use this to divide the normal
  1626. refresh rate while making sure that explicit requeusts do not
  1627. get ignored.
  1628. @rdesc LMI_SUCCESS on success.
  1629. @comm Ideally the client should be able to retrieve the queue for any
  1630. logical modem supported by this Provider, not necessarily the
  1631. one which is currently initialized. This allows the client to
  1632. choose a new modem intelligently if needed.
  1633. ********/
  1634. #define NGQ_USER_REQUEST 0x0001
  1635. LMI_RETURN FAR PASCAL LMI_GetQueueFile (DWORD dwLogicalModem,
  1636. LPTSTR lpszLogicalModemName,
  1637. LPATOM lpatFileName,
  1638. WORD wFlags);
  1639. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_GetQueueFile)(DWORD dwLogicalModem,
  1640. LPTSTR lpszLogicalModemName,
  1641. LPATOM lpatFileName,
  1642. WORD wFlags);
  1643. /********
  1644. @doc EXTERNAL SRVRDLL
  1645. @api LMI_RETURN | LMI_InitLogicalModem | Used to initialize a particular
  1646. logical modem.
  1647. @parm LPTSTR | lpszLogicalModem | String identifying the logical modem
  1648. to be initialized.
  1649. @parm LPDWORD | lpdwLogicalModem | A DWORD handle representing this
  1650. logical modem should be returned in this pointer if the function
  1651. is successful. The handle is valid until the client calls
  1652. LMI_DeinitLogicalModem with this handle.
  1653. @parm LPATOM | lpatClientName | A global atom containing an ASCII name
  1654. identifying this client must be returned here. This string is
  1655. used in the queue displays to identify jobs from this client on
  1656. the Provider. It is used by clients to restrict the jobs which
  1657. can be cancelled or rescheduled from their machines, so it
  1658. should be unique enough to prevent security holes. All string
  1659. comparisons using this name should be case-insensitive because case
  1660. is not necessarily preserved when using atoms.
  1661. @parm LPATOM | lpatPhone | A global atom containing the canonical phone
  1662. number for this logical modem. This is used to construct the
  1663. client's Microsoft At Work Address, and is the number put into
  1664. the FROM field of any messages sent. This needs to be filled in
  1665. if a non-null pointer is passed in.
  1666. @parm LPMODEMCAPS | lpmc | Points to a <t MODEMCAPS> structure which
  1667. should be filled in with the capabilities of this logical modem.
  1668. The size of the memory pointed to by this structure is filled in
  1669. the wTotalSize field of the structure. If this pointer is null,
  1670. no capabilities need to be returned.
  1671. @rdesc LMI_SUCCESS if successful. A handle to the logical modem should
  1672. be returned in <p lpdwLogicalModem>.
  1673. @comm Initializes a logical modem for further operations. The Provider
  1674. should use this to set up any necessary connections, and to make
  1675. sure that the Provider is up and running. The handle returned by
  1676. this function is used by any subsequent functions invoked for
  1677. this modem. Multiple modems may be initialized at the same time.
  1678. The handle returned may be used in multiple process contexts, so
  1679. the implementor should make sure any memory it references can be
  1680. accessed in different process contexts.
  1681. ********/
  1682. LMI_RETURN FAR PASCAL LMI_InitLogicalModem (LPTSTR lpszLogicalModem,
  1683. LPDWORD lpdwLogicalModem,
  1684. LPATOM lpatClientName,
  1685. LPATOM lpatPhone,
  1686. LPMODEMCAPS lpmc);
  1687. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_InitLogicalModem) (LPTSTR lpszLogicalModem,
  1688. LPDWORD lpdwLogicalModem,
  1689. LPATOM lpatClientName,
  1690. LPATOM lpatPhone,
  1691. LPMODEMCAPS lpmc);
  1692. /********
  1693. @doc EXTERNAL SRVRDLL
  1694. @api LMI_RETURN | LMI_InitProvider | Used to initialize the LMI provider.
  1695. @parm LPTSTR | lpszCurSpoolDir | Pointer to the current spool directory.
  1696. The spool directory is where all intermediate format files get
  1697. created, and where the client expects received fax files.
  1698. @parm LPMODEMCAPS | lpmcClient | Pointer to a <t MODEMCAPS> structure that
  1699. describes the capabilities of the client. This should be used by
  1700. the Provider to decide which formats can be understood by the
  1701. client. For instance, if the client only understands MH, then
  1702. the Provider would need to convert any received faxes into MH
  1703. before reporting them in <f LMI_ReportReceives>. Similarly, this
  1704. can indicate to the Provider whether or not features such as
  1705. uploading of messages and Provider address books are supported by
  1706. this particular client implementation.
  1707. @parm LPTSTR | lpszDefRecipAdd | For incoming G3 faxes for which the
  1708. recipient is unknown, this address should be used. This typically
  1709. happens for faxes received from G3 machines without a programmed
  1710. CSI. In this case, this address should be put inside the
  1711. linearized header on the AWG3 file. If this address ends in an
  1712. <lq>@<rq> the Provider should append the phone number of the modem on
  1713. which the fax was received, as well as any locally-obtained
  1714. subaddressing information, using the Microsoft Fax Address format.
  1715. For example, if the provider detects a DID string \<did\>, it
  1716. should append <lq>\<local-phone-number>\|\<did\><rq> after the
  1717. <lq>@<rq> sign.
  1718. @parm LPTSTR | lpszDefRecipName | Friendly name to be used for the
  1719. default recipient. Goes along with <p lpszDefRecipAdd> to form
  1720. an address pair.
  1721. @rdesc LMI_SUCCESS if successful.
  1722. @comm This call is made once per session. It is guaranteed to be the
  1723. first call made to the Provider.
  1724. ********/
  1725. LMI_RETURN FAR PASCAL LMI_InitProvider (LPTSTR lpszCurSpoolDir,
  1726. LPMODEMCAPS lpmc,
  1727. LPTSTR lpszDefRecipAdd,
  1728. LPSTR lpszDefRecipName);
  1729. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_InitProvider) (LPTSTR lpszCurSpoolDir,
  1730. LPMODEMCAPS lpmc,
  1731. LPTSTR lpszDefRecipAdd,
  1732. LPSTR lpszDefRecipName);
  1733. /********
  1734. @doc EXTERNAL SRVRDLL INSTALLATION
  1735. @func LMI_RETURN | LMI_RemoveModem | Called when a logical modem is removed
  1736. from the list of current modems.
  1737. @parm LPTSTR | lpszModem | Pointer to the string identifying the
  1738. logical modem being removed.
  1739. @rdesc Returns LMI_SUCCESS if successful.
  1740. @comm This call should be used to delete any context which has been
  1741. cached for this logical modem. For instance, if in the
  1742. <f LMI_AddModem> call, a lot of connection information had been
  1743. stored in an ini file with the key being returned as the logical
  1744. modem name, then this call would be used to delete this
  1745. information.
  1746. ********/
  1747. LMI_RETURN FAR PASCAL LMI_RemoveModem(LPTSTR lpszModem);
  1748. typedef LMI_RETURN (FAR PASCAL FAR * LPLMI_RemoveModem)(LPTSTR lpszModem);
  1749. /********
  1750. @doc EXTERNAL SRVRDLL
  1751. @api DWORD | LMI_ReportReceives | Lets LMI provider report back
  1752. received faxes.
  1753. @parm DWORD | dwLogicalModem | Handle representing the logical modem
  1754. to be checked. If this is null, all logical modems owned by this
  1755. Provider should be checked.
  1756. @parm WORD | wFlags | Can consist of a combination of the following
  1757. flags:
  1758. @flag NRR_USER_REQUEST | This flag will be set if new faxes are
  1759. being checked for on an explicit user request. This is meant for
  1760. transports which tend to reduce the number of times they actually
  1761. check for receives to reduce overhead. Providers should make
  1762. sure to do the checks when this flag is set.
  1763. @flag NRR_RETRIEVE_DATA | Set if the client wishes to process the 1st receive
  1764. in the queue. If set, the provider fills out a LMIRECVSTATUS
  1765. structure and specifies a pointer to it in *lplpnrtStatus. If
  1766. the client makes successive calls specifying NRR_RETRIEVE_DATA (but not
  1767. NRR_COMMITTED_RECV), information on the same receive (the 1st one
  1768. on the queue) should be returned. Each time, a fresh atom needs to
  1769. be allocated for the atFile field in LMIRECVSTATUS, and the client
  1770. is responsible for freeing this atom. If this flag is not set,
  1771. indicates that the client wants to
  1772. simply find out if there are any receives waiting, and the provider
  1773. should ignore lplpnrtStaus.
  1774. @flag NRR_COMMITTED_RECV | Indicates that the previous receive
  1775. has been committed to permanent storage by the client and can be
  1776. deleted by the Provider from its queue. It also indicates that
  1777. the memory used for the LMIRECVSTATUS structure for that job can
  1778. be freed or reused. Until this point, the Provider must not
  1779. remove the received fax from its internal permanent storage.
  1780. This helps avoid a fax being lost if the power goes off in the
  1781. middle of the handoff. In the worst case, it causes two copies of
  1782. the received fax to be processed instead of none.
  1783. If this flag is specified, NRR_RETRIEVE_DATA is irrelevant and if
  1784. specified should be ignored by the provider.
  1785. @parm LPDWORD | lpdwNumRecvs | Pointer to a DWORD which should be
  1786. filled in with the number of new received faxes which are waiting
  1787. to be picked up. If NRR_RETRIEVE_DATA is set in wFlags, the
  1788. received fax being returned in the current call should not be
  1789. included in this count.
  1790. @parm LPLMIRECVSTATUS FAR* | lplpnrtStatus | Pointer to a pointer
  1791. which should be set to point to a <t LMIRECVSTATUS> structure.
  1792. The client assumes this pointer to point into accesible memory which is
  1793. valid until the next call made with the flag
  1794. NRR_COMMITTED_RECEIVE set. There can never be more than one
  1795. pending receive, so a single piece of memory can be reused.
  1796. This should be set only if <p wFlags> has the RETRIEVE_DATA flag
  1797. set. The atom passed in this structure will be freed by the
  1798. client. It should be set to null if there are no receives.
  1799. @rdesc Returns LMI_SUCCESS if succesful.
  1800. @comm It is possible for receives to be routed independent of this API
  1801. directly to the client's mail store. This would happen if the
  1802. client and Provider could communicate using another mail transport
  1803. (such as Microsoft SFS) to do this more easily.
  1804. ********/
  1805. #define NRR_USER_REQUEST 0x0001
  1806. #define NRR_RETRIEVE_DATA 0x0002
  1807. #define NRR_COMMITTED_RECV 0x0004
  1808. LMI_RETURN FAR PASCAL LMI_ReportReceives(DWORD dwLogicalModem,
  1809. WORD wFlags,
  1810. LPDWORD lpdwNumRecvs,
  1811. LPLMIRECVSTATUS FAR *lplpnrtStatus);
  1812. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_ReportReceives)(DWORD dwLogicalModem,
  1813. WORD wFlags,
  1814. LPDWORD lpdwNumRecvs,
  1815. LPLMIRECVSTATUS FAR *lplpnrtStatus);
  1816. /********
  1817. @doc EXTERNAL SRVRDLL
  1818. @api LMI_RETURN | LMI_ReportSend | Reports status of completed send jobs.
  1819. @parm DWORD | dwLogicalModem | Handle representing the logical modem
  1820. to be checked. If this is null, all logical modems owned by this
  1821. Provider should be checked.
  1822. @parm WORD | wFlags | Can consist of a combination of the following
  1823. flags:
  1824. @flag NRS_USER_REQUEST | This flag will be set if the fax status
  1825. is being checked for on an explicit user request. This is meant
  1826. for transports which tend to reduce the number of times they
  1827. actually check for receives to reduce overhead. Such transports
  1828. should make sure to do the checks when this flag is set.
  1829. @flag NRS_RETRIEVE_DATA | If set, indicates that the client wishes to
  1830. process the status for the first one in the queue. If not set,
  1831. indicates that the client wants to
  1832. simply find out if there are any jobs completed.
  1833. @parm LPDWORD | lpdwNumDone | Pointer to a DWORD which should be filled
  1834. in with the number of jobs which have been completed and are
  1835. waiting to be picked up. If NRS_RETRIEVE_DATA flag is set, then
  1836. this should be filled in with the number of jobs left not
  1837. counting the one being returned in this call.
  1838. @parm LPLMISENDSTATUS FAR* | lplpnstStatus | Pointer to a pointer which
  1839. should be set to point to a <t LMISENDSTATUS> structure. The
  1840. client assumes this pointer to be valid until the next call it
  1841. makes to this function. It should be set to null if there are no
  1842. completed sends. It should only be filled in if NRS_RETRIEVE_DATA
  1843. is set in wFlags.
  1844. @rdesc Returns LMI_SUCCESS if succesful.
  1845. ********/
  1846. #define NRS_USER_REQUEST 0x0001
  1847. #define NRS_RETRIEVE_DATA 0x0002
  1848. LMI_RETURN FAR PASCAL LMI_ReportSend(DWORD dwLogicalModem,
  1849. WORD wFlags,
  1850. LPDWORD lpdwNumDone,
  1851. LPLMISENDSTATUS FAR *lplpnstStatus);
  1852. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_ReportSend)(DWORD dwLogicalModem,
  1853. WORD wFlags,
  1854. LPDWORD lpdwNumDone,
  1855. LPLMISENDSTATUS FAR *lplpnstStatus);
  1856. /********
  1857. @doc EXTERNAL SRVRDLL
  1858. @api LMI_RETURN | LMI_RescheduleSendJob | Reschedules the specified
  1859. send job from the Provider's queue.
  1860. @parm DWORD | dwLogicalModem | The logical modem in whose queue the
  1861. job to be rescheduled lives. This does not have to be the
  1862. currently active modem.
  1863. @parm LPTSTR | lpszSenderMachineName | Pointer to a string identifying
  1864. the sender machine name. This parameter, along with the
  1865. <p dwUniqueID> and <p dwUniqueID2> uniquely identify this job for
  1866. the Provider. These all must be same as the values passed in the
  1867. <t LMISENDJOB> structure passed into <f LMI_SendFax>.
  1868. @parm DWORD | dwUniqueID | See <p lpszSenderMachineName>.
  1869. @parm DWORD | dwUniqueID2 | See <p lpszSenderMachineName>.
  1870. @parm LPSENDJOBTIME | lpsjtNewTime | Pointer to a new <t SENDJOBTIME>
  1871. structure containing the reschedule information.
  1872. @rdesc LMI_SUCCESS on success.
  1873. @comm The reschedule can be performed asyncronously by the Provider.
  1874. Return from this function does not imply any guarantee as to the
  1875. time within which the job will be rescheduled. The client will
  1876. ensure that this function is only called to reschedule jobs which
  1877. were initiated on its machine.
  1878. ********/
  1879. LMI_RETURN FAR PASCAL LMI_RescheduleSendJob (DWORD dwLogicalModem,
  1880. LPTSTR lpszSenderMachineName,
  1881. DWORD dwUniqueID,
  1882. DWORD dwUniqueID2,
  1883. LPSENDJOBTIME lpsjtNewTime);
  1884. typedef LMI_RETURN (FAR PASCAL FAR *LPLMI_RescheduleSendJob) (DWORD dwLogicalModem,
  1885. LPTSTR lpszSenderMachineName,
  1886. DWORD dwUniqueID,
  1887. DWORD dwUniqueID2,
  1888. LPSENDJOBTIME lpsjtNewTime);
  1889. /*******
  1890. @doc EXTERNAL SRVRDLL
  1891. @api LMI_RETURN | LMI_SendFax | Accepts a job for sending. Job is already
  1892. completely rendered.
  1893. @parm DWORD | dwLogicalModem | Handle representing the logical modem
  1894. from which this should be sent.
  1895. @parm LPLMISENDJOB | lpnj | Points to a <t LMISENDJOB> structure
  1896. containing all the pertinent information about this job. The
  1897. structure is allocated by the client and is freed on return of
  1898. this call.
  1899. @rdesc Returns LMI_SUCCESS if the job is accepted. A successful return
  1900. of this function implies that the job has been queued for
  1901. subsequent processing and transmission. This function should
  1902. fail only if there is a general failure in the provider or a
  1903. parameter validation failure. Processing or transmission failures
  1904. should be returned in the appropriate <f LMI_ReportSend> call.
  1905. *******/
  1906. LMI_RETURN FAR PASCAL LMI_SendFax (DWORD dwLogicalModem,
  1907. LPLMISENDJOB lpnj);
  1908. typedef LMI_RETURN (FAR PASCAL FAR * LPLMI_SendFax) (DWORD dwLogicalModem,
  1909. LPLMISENDJOB lpnj);
  1910. /*******
  1911. @doc EXTERNAL SRVRDLL
  1912. @api LPBYTE | LMI_SetCustomMsgOptions | This function is called to
  1913. allow the user to set custom per message options.
  1914. @parm DWORD | dwLogicalModem | Handle representing the logical modem
  1915. which is currently in use.
  1916. @parm LPBYTE | lpbOld | Pointer to a previously returned piece of
  1917. memory which needs to be freed. If this parameter is being used
  1918. the function should simply free the memory and return without
  1919. putting up any UI.
  1920. @rdesc Returns a pointer to a memory block containing all the custom
  1921. information which has been set. The first DWORD of the block
  1922. MUST contain the total size of the memory being used. This data
  1923. will be passed along with the <t LMISENDJOB> structure when this
  1924. message is finally submitted. The memory will be freed by
  1925. calling this same API again with the memory pointer passed in as
  1926. a parameter.
  1927. @comm This function can be used to enable all kinds of advance options
  1928. to the user. One example of this could be usage of TAPI locations
  1929. and credit cards for calls. If the Provider can support these, it
  1930. can allow the user to setup credit card calls and then use these
  1931. when resolving the phone numbers into dialable strings. If the
  1932. Provider is using the TAPI translation services, the user could
  1933. select a specific outbound device or line for the call, and
  1934. do a credit card ID override on cards setup on the Provider TAPI
  1935. setup.
  1936. *******/
  1937. LPBYTE FAR PASCAL LMI_SetCustomMsgOptions(DWORD dwLogicalModem,
  1938. LPBYTE lpbOld);
  1939. typedef LPBYTE (FAR PASCAL FAR *LPLMI_SetCustomMsgOptions)(DWORD dwLogicalModem,
  1940. LPBYTE lpbOld);
  1941. #ifdef __cplusplus
  1942. } // extern "C" {
  1943. #endif
  1944. #endif