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.

1235 lines
26 KiB

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /*++
  5. Copyright (c) 1996 Microsoft Corporation
  6. Module Name:
  7. umdmmini.h
  8. Abstract:
  9. Nt 5.0 unimodem miniport interface
  10. The miniport driver is guarenteed that only one action command will
  11. be austanding at one time. If an action command is called, no more
  12. commands will be issued until the miniport indicates that it has
  13. complete processing of the current command.
  14. UmAbortCurrentCommand() may be called while a command is currently executing
  15. to infor the miniport that the TSP would like it to complete the current command
  16. so that it may issue some other command. The miniport may complete the as soon
  17. as is apropreate.
  18. The Overlapped callback and Timer callbacks are not synchronized by the TSP
  19. and may be called at anytime. It is the responsibily of the mini dirver to
  20. protect its data structures from re-entrancy issues.
  21. Author:
  22. Brian Lieuallen BrianL 09/10/96
  23. Environment:
  24. User Mode Operating Systems : NT
  25. Revision History:
  26. --*/
  27. #define ERROR_UNIMODEM_RESPONSE_TIMEOUT (20000)
  28. #define ERROR_UNIMODEM_RESPONSE_ERROR (20001)
  29. #define ERROR_UNIMODEM_RESPONSE_NOCARRIER (20002)
  30. #define ERROR_UNIMODEM_RESPONSE_NODIALTONE (20003)
  31. #define ERROR_UNIMODEM_RESPONSE_BUSY (20004)
  32. #define ERROR_UNIMODEM_RESPONSE_NOANSWER (20005)
  33. #define ERROR_UNIMODEM_RESPONSE_BAD (20006)
  34. #define ERROR_UNIMODEM_MODEM_EVENT_TIMEOUT (20007)
  35. #define ERROR_UNIMODEM_INUSE (20008)
  36. #define ERROR_UNIMODEM_MISSING_REG_KEY (20009)
  37. #define ERROR_UNIMODEM_NOT_IN_VOICE_MODE (20010)
  38. #define ERROR_UNIMODEM_NOT_VOICE_MODEM (20011)
  39. #define ERROR_UNIMODEM_BAD_WAVE_REQUEST (20012)
  40. #define ERROR_UNIMODEM_GENERAL_FAILURE (20013)
  41. #define ERROR_UNIMODEM_RESPONSE_BLACKLISTED (20014)
  42. #define ERROR_UNIMODEM_RESPONSE_DELAYED (20015)
  43. #define ERROR_UNIMODEM_BAD_COMMCONFIG (20016)
  44. #define ERROR_UNIMODEM_BAD_TIMEOUT (20017)
  45. #define ERROR_UNIMODEM_BAD_FLAGS (20018)
  46. #define ERROR_UNIMODEM_BAD_PASSTHOUGH_MODE (20019)
  47. #define ERROR_UNIMODEM_DIAGNOSTICS_NOT_SUPPORTED (20020)
  48. //
  49. // Callback from unimodem miniport to client.
  50. //
  51. // uses for completion of outstanding commands and notification
  52. // of unsolisited events
  53. //
  54. // Parameters:
  55. //
  56. // Conetext - Opaque value passed to OpenModem
  57. // MessageType - Identifies type of callback
  58. // dwParam1 - message specific
  59. // dwParam2 - message specific
  60. //
  61. // Completion of a pending command
  62. //
  63. // dwParam1 is the Final status
  64. //
  65. // dwParam2 if a data connection, may point to a UM_NEGOTIATED_OPTIONS structure
  66. // only valid during call
  67. //
  68. #define MODEM_ASYNC_COMPLETION (0x01)
  69. #define MODEM_RING (0x02)
  70. #define MODEM_DISCONNECT (0x03)
  71. #define MODEM_HARDWARE_FAILURE (0x04)
  72. //
  73. // the some unrecogized data has been received from the modem
  74. //
  75. // dwParam is a pointer to the SZ string.
  76. //
  77. #define MODEM_UNRECOGIZED_DATA (0x05)
  78. //
  79. // dtmf detected, dwParam1 id the ascii value of the detect tone 0-9,a-d,#,*
  80. //
  81. #define MODEM_DTMF_START_DETECTED (0x06)
  82. #define MODEM_DTMF_STOP_DETECTED (0x07)
  83. //
  84. // handset state change
  85. //
  86. // dwParam1 = 0 for on hook or 1 for offhook
  87. //
  88. #define MODEM_HANDSET_CHANGE (0x0a)
  89. //
  90. // reports the distinctive time times
  91. //
  92. // dwParam1 id the ring time in ms
  93. //
  94. #define MODEM_RING_ON_TIME (0x0b)
  95. #define MODEM_RING_OFF_TIME (0x0c)
  96. //
  97. // caller id info recieved
  98. //
  99. // dwParam1 is pointer to SZ that represents the name/number
  100. //
  101. #define MODEM_CALLER_ID_DATE (0x0d)
  102. #define MODEM_CALLER_ID_TIME (0x0e)
  103. #define MODEM_CALLER_ID_NUMBER (0x0f)
  104. #define MODEM_CALLER_ID_NAME (0x10)
  105. #define MODEM_CALLER_ID_MESG (0x11)
  106. #define MODEM_CALLER_ID_OUTSIDE "O"
  107. #define MODEM_CALLER_ID_PRIVATE "P"
  108. #define MODEM_POWER_RESUME (0x12)
  109. //
  110. // return good response string
  111. //
  112. // dwParam1 id a resonse type defined below
  113. // dwparam2 is a PSZ to the response string.
  114. //
  115. #define MODEM_GOOD_RESPONSE (0x13)
  116. #define MODEM_USER_REMOVE (0x14)
  117. #define MODEM_DLE_START (0x20)
  118. #define MODEM_HANDSET_OFFHOOK (MODEM_DLE_START + 0)
  119. #define MODEM_HANDSET_ONHOOK (MODEM_DLE_START + 1)
  120. #define MODEM_DLE_RING (MODEM_DLE_START + 2)
  121. #define MODEM_RINGBACK (MODEM_DLE_START + 3)
  122. #define MODEM_2100HZ_ANSWER_TONE (MODEM_DLE_START + 4)
  123. #define MODEM_BUSY (MODEM_DLE_START + 5)
  124. #define MODEM_FAX_TONE (MODEM_DLE_START + 6)
  125. #define MODEM_DIAL_TONE (MODEM_DLE_START + 7)
  126. #define MODEM_SILENCE (MODEM_DLE_START + 8)
  127. #define MODEM_QUIET (MODEM_DLE_START + 9)
  128. #define MODEM_1300HZ_CALLING_TONE (MODEM_DLE_START + 10)
  129. #define MODEM_2225HZ_ANSWER_TONE (MODEM_DLE_START + 11)
  130. #define MODEM_LOOP_CURRENT_INTERRRUPT (MODEM_DLE_START + 12)
  131. #define MODEM_LOOP_CURRENT_REVERSAL (MODEM_DLE_START + 13)
  132. typedef VOID (*LPUMNOTIFICATIONPROC)(
  133. HANDLE Context,
  134. DWORD MessageType,
  135. ULONG_PTR dwParam1,
  136. ULONG_PTR dwParam2
  137. );
  138. typedef VOID (OVERLAPPEDCOMPLETION)(
  139. struct _UM_OVER_STRUCT *UmOverlapped
  140. );
  141. //
  142. // Extended definition for overlapped structirs returned from the completion
  143. // port.
  144. //
  145. //
  146. typedef struct _UM_OVER_STRUCT {
  147. //
  148. // standard overlapped strunct
  149. //
  150. OVERLAPPED Overlapped;
  151. struct _UM_OVER_STRUCT *Next;
  152. PVOID OverlappedPool;
  153. HANDLE FileHandle;
  154. //
  155. // private completion routine filled in prior to the i/o operation being submitted
  156. // to the I/o function (ReadFile). Will be called when the i/o is removed from completion
  157. // port by unimodem class driver
  158. //
  159. // OVERLAPPEDCOMPLETION *PrivateCompleteionHandler;
  160. LPOVERLAPPED_COMPLETION_ROUTINE PrivateCompleteionHandler;
  161. //
  162. // Private context supplied for use of callback function
  163. //
  164. HANDLE Context1;
  165. //
  166. // Private context supplied for use of callback function
  167. //
  168. HANDLE Context2;
  169. } UM_OVER_STRUCT, *PUM_OVER_STRUCT;
  170. //
  171. // Command Option structure
  172. //
  173. #define UM_BASE_OPTION_CLASS (0x00)
  174. typedef struct _UM_COMMAND_OPTION {
  175. //
  176. // specifies which option class
  177. //
  178. // UM_BASE_OPTION_CLASS
  179. //
  180. DWORD dwOptionClass;
  181. //
  182. // Commands specific option flags
  183. //
  184. DWORD dwFlags;
  185. //
  186. // link to next option class
  187. //
  188. struct _UM_COMMAND_OPTION *Next;
  189. //
  190. // count in bytes of any additional ddata immediatly following this structure
  191. //
  192. DWORD cbOptionDataSize;
  193. } UM_COMMAND_OPTION, *PUM_COMMAND_OPTION;
  194. //
  195. // Negotiated connection options
  196. //
  197. typedef struct _UM_NEGOTIATED_OPTIONS {
  198. //
  199. // DCE rate
  200. //
  201. DWORD DCERate;
  202. //
  203. // compression, errorcontrol
  204. //
  205. DWORD ConnectionOptions;
  206. } UM_NEGOTIATED_OPTIONS, *PUM_NEGOTIATED_OPTIONS;
  207. #define RESPONSE_OK 0x0
  208. #define RESPONSE_LOOP 0x1
  209. #define RESPONSE_CONNECT 0x2
  210. #define RESPONSE_ERROR 0x3
  211. #define RESPONSE_NOCARRIER 0x4
  212. #define RESPONSE_NODIALTONE 0x5
  213. #define RESPONSE_BUSY 0x6
  214. #define RESPONSE_NOANSWER 0x7
  215. #define RESPONSE_RING 0x8
  216. #define RESPONSE_DRON 0x11
  217. #define RESPONSE_DROF 0x12
  218. #define RESPONSE_DATE 0x13
  219. #define RESPONSE_TIME 0x14
  220. #define RESPONSE_NMBR 0x15
  221. #define RESPONSE_NAME 0x16
  222. #define RESPONSE_MESG 0x17
  223. #define RESPONSE_RINGA 0x18
  224. #define RESPONSE_RINGB 0x19
  225. #define RESPONSE_RINGC 0x1A
  226. #define RESPONSE_SIERRA_DLE 0x1b
  227. #define RESPONSE_BLACKLISTED 0x1c
  228. #define RESPONSE_DELAYED 0x1d
  229. #define RESPONSE_DIAG 0x1e
  230. #define RESPONSE_V8 0x1f
  231. #define RESPONSE_VARIABLE_FLAG 0x80
  232. #define RESPONSE_START RESPONSE_OK
  233. #define RESPONSE_END RESPONSE_V8
  234. typedef
  235. HANDLE
  236. (*PFNUMINITIALIZEMODEMDRIVER)(
  237. void *ValidationObject
  238. );
  239. HANDLE WINAPI
  240. UmInitializeModemDriver(
  241. void *ValidationObject
  242. );
  243. /*++
  244. Routine Description:
  245. This routine is called to initialize the modem driver.
  246. It maybe called multiple times. After the first call a reference count will simply
  247. be incremented. UmDeinitializeModemDriver() must be call and equal number of times.
  248. Arguments:
  249. ValidationObject - opaque handle to a validation object which much
  250. be processed properly to "prove" that this is a
  251. Microsoft(tm)-certified driver.
  252. Return Value:
  253. returns a handle to Driver instance which is passed to UmOpenModem()
  254. or NULL for failure
  255. --*/
  256. typedef
  257. VOID
  258. (*PFNUMDEINITIALIZEMODEMDRIVER) (
  259. HANDLE ModemDriverHandle
  260. );
  261. VOID WINAPI
  262. UmDeinitializeModemDriver(
  263. HANDLE DriverInstanceHandle
  264. );
  265. /*++
  266. Routine Description:
  267. This routine is called to de-initialize the modem driver.
  268. Must be called the same number of time as UmInitializeModemDriver()
  269. Arguments:
  270. DriverInstanceHandle - Handle returned by UmInitialmodemDriver
  271. Return Value:
  272. None
  273. --*/
  274. typedef
  275. HANDLE
  276. (*PFNUMOPENMODEM) (
  277. HANDLE ModemDriverHandle,
  278. HANDLE ExtensionBindingHandle,
  279. HKEY ModemRegistry,
  280. HANDLE CompletionPort,
  281. LPUMNOTIFICATIONPROC AsyncNotificationProc,
  282. HANDLE AsyncNotifcationContext,
  283. DWORD DebugDeviceId,
  284. HANDLE *CommPortHandle
  285. );
  286. HANDLE WINAPI
  287. UmOpenModem(
  288. HANDLE ModemDriverHandle,
  289. HANDLE ExtensionBindingHandle,
  290. HKEY ModemRegistry,
  291. HANDLE CompletionPort,
  292. LPUMNOTIFICATIONPROC AsyncNotificationProc,
  293. HANDLE AsyncNotificationContext,
  294. DWORD DebugDeviceId,
  295. HANDLE *CommPortHandle
  296. );
  297. /*++
  298. Routine Description:
  299. This routine is called to open a device supported by the miniport.
  300. The driver will determine it phyical device/kernel mode driver by
  301. accessing the registry key supplied.
  302. Arguments:
  303. ModemDriverHandle - Returned from UmInitializemodem()
  304. ExtensionBindingHandle - Reserved, must be NULL.
  305. ModemRegistry - An open registry key to specific devices registry info
  306. CompletionPort - Handle to a completeion port that the miniport may associate to
  307. anydevice file handles that it opens
  308. AsyncNotificationProc - Address of a callback function to recieve async notifications
  309. AsyncNotificationContext - Context value passed as first parameter callback function
  310. DebugDeviceId - instance of device to be used in displaying debug info
  311. CommPortHandle - Pointer to a handle that will receive the file handle of the open comm port
  312. Return Value:
  313. NULL for failure or
  314. Handle to be used in subsequent calls to other miniport functinos.
  315. --*/
  316. typedef
  317. VOID
  318. (*PFNUMCLOSEMODEM)(
  319. HANDLE ModemHandle
  320. );
  321. VOID WINAPI
  322. UmCloseModem(
  323. HANDLE ModemHandle
  324. );
  325. /*++
  326. Routine Description:
  327. This routine is called to close a modem handle retuned by OpenModem
  328. Arguments:
  329. ModemHandle - Handle returned by OpenModem
  330. Return Value:
  331. None
  332. --*/
  333. typedef
  334. VOID
  335. (*PFNUMABORTCURRENTMODEMCOMMAND)(
  336. HANDLE ModemHandle
  337. );
  338. VOID WINAPI
  339. UmAbortCurrentModemCommand(
  340. HANDLE ModemHandle
  341. );
  342. /*++
  343. Routine Description:
  344. This routine is called to abort a current pending command being handled by the miniport.
  345. This routine should attempt to get the current command to complete as soon as possible.
  346. This service is advisory. It is meant to tell the driver that port driver wants to cancel
  347. the current operation. The Port driver must still wait for the async completion of the
  348. command being canceled, and that commands way infact return successfully. The miniport
  349. should abort in such a way that the device is in a known state and can accept future commands
  350. Arguments:
  351. ModemHandle - Handle returned by OpenModem
  352. Return Value:
  353. None
  354. --*/
  355. typedef
  356. DWORD
  357. (*PFNUMINITMODEM)(
  358. HANDLE ModemHandle,
  359. PUM_COMMAND_OPTION CommandOptionList,
  360. LPCOMMCONFIG CommConfig
  361. );
  362. DWORD WINAPI
  363. UmInitModem(
  364. HANDLE ModemHandle,
  365. PUM_COMMAND_OPTION CommandOptionList,
  366. LPCOMMCONFIG CommConfig
  367. );
  368. /*++
  369. Routine Description:
  370. This routine is called to initialize the modem to a known state using the parameters
  371. supplied in the CommConfig structure. If some settings do not apply to the actual hardware
  372. then they can be ignored.
  373. Arguments:
  374. ModemHandle - Handle returned by OpenModem
  375. CommandsOptionList - List option blocks, only flags used
  376. Flags - Optional init parameters. Not currently used and must be zero
  377. CommConfig - CommConig structure with MODEMSETTINGS structure.
  378. Return Value:
  379. ERROR_SUCCESS if successfull
  380. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  381. or other specific error
  382. --*/
  383. #define MONITOR_FLAG_CALLERID (1 << 0)
  384. #define MONITOR_FLAG_DISTINCTIVE_RING (1 << 1)
  385. #define MONITOR_VOICE_MODE (1 << 2)
  386. typedef
  387. DWORD
  388. (*PFNUMMONITORMODEM)(
  389. HANDLE ModemHandle,
  390. DWORD MonitorFlags,
  391. PUM_COMMAND_OPTION CommandOptionList
  392. );
  393. DWORD WINAPI
  394. UmMonitorModem(
  395. HANDLE ModemHandle,
  396. DWORD MonitorFlags,
  397. PUM_COMMAND_OPTION CommandOptionList
  398. );
  399. /*++
  400. Routine Description:
  401. This routine is called to clause the modem to monitor for incomming calls.
  402. The successful completion of the function simply indicated the monitoring was
  403. correctly initiated, not that a ring as appeared. Rings are indicated through
  404. the async completion rountine separatly.
  405. Arguments:
  406. ModemHandle - Handle returned by OpenModem
  407. MonitorFlags - Specifies options, may be zero of more the following
  408. MONITOR_FLAG_CALLERID - enable caller ID reporting
  409. MONITOR_FLAG_DISTINCTIVE_RING - enable distinctive ring reporting
  410. CommandsOptionList - None currently supported, should be NULL
  411. Return Value:
  412. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  413. or other specific error
  414. --*/
  415. #define ANSWER_FLAG_DATA (1 << 0)
  416. #define ANSWER_FLAG_VOICE (1 << 1)
  417. #define ANSWER_FLAG_VOICE_TO_DATA (1 << 2)
  418. typedef
  419. DWORD
  420. (*PFNUMANSWERMODEM) (
  421. HANDLE ModemHandle,
  422. PUM_COMMAND_OPTION CommandOptionList,
  423. DWORD AnswerFlags
  424. );
  425. DWORD WINAPI
  426. UmAnswerModem(
  427. HANDLE ModemHandle,
  428. PUM_COMMAND_OPTION CommandOptionList,
  429. DWORD AnswerFlags
  430. );
  431. /*++
  432. Routine Description:
  433. This routine is called to answer an incomming call,
  434. Arguments:
  435. ModemHandle - Handle returned by OpenModem
  436. CommandsOptionList - List option blocks, only flags used
  437. Flags - One of the following
  438. ANSWER_FLAG_DATA - Answer as data call
  439. ANSWER_FLAG_VOICE - Answer as interactiver voice
  440. Return Value:
  441. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  442. or other specific error
  443. --*/
  444. //
  445. // dial as data
  446. //
  447. #define DIAL_FLAG_DATA (1 << 0)
  448. //
  449. // dial as interactive voice, return success immedialy after digits are dialed
  450. //
  451. #define DIAL_FLAG_INTERACTIVE_VOICE (1 << 1)
  452. //
  453. // dial as automated voice, return success only after ring back goes away
  454. //
  455. #define DIAL_FLAG_AUTOMATED_VOICE (1 << 2)
  456. //
  457. // uses DTMF, otherwise use pulse
  458. //
  459. #define DIAL_FLAG_TONE (1 << 3)
  460. //
  461. // Enable blind dial
  462. //
  463. #define DIAL_FLAG_BLIND (1 << 4)
  464. //
  465. // orginate the call, don't inlcude a semicolon at end of dial string, no lineDials()
  466. //
  467. #define DIAL_FLAG_ORIGINATE (1 << 5)
  468. //
  469. // set on the first call to DialModem() for a voice call. If additional calls(lineDial)
  470. // are made then this flag should be clear
  471. //
  472. #define DIAL_FLAG_VOICE_INITIALIZE (1 << 6)
  473. typedef
  474. DWORD
  475. (*PFNUMDIALMODEM)(
  476. HANDLE ModemHandle,
  477. PUM_COMMAND_OPTION CommandOptionList,
  478. LPSTR szNumber,
  479. DWORD DialFlags
  480. );
  481. DWORD WINAPI
  482. UmDialModem(
  483. HANDLE ModemHandle,
  484. PUM_COMMAND_OPTION CommandOptionList,
  485. LPSTR szNumber,
  486. DWORD DialFlags
  487. );
  488. /*++
  489. Routine Description:
  490. This routine is called to dial a call
  491. Arguments:
  492. ModemHandle - Handle returned by OpenModem
  493. CommandsOptionList - List option blocks, only flags used
  494. Return Value:
  495. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  496. or other specific error
  497. --*/
  498. //
  499. // the call is a connected data call, driver will lower DTR or +++ ect.
  500. //
  501. #define HANGUP_FLAGS_CONNECTED_DATA_CALL (1 << 0)
  502. //
  503. // issue special voice hangup command if present, used for sierra modems
  504. //
  505. #define HANGUP_FLAGS_VOICE_CALL (1 << 1)
  506. typedef
  507. DWORD // WINAPI
  508. (*PFNUMHANGUPMODEM)(
  509. HANDLE ModemHandle,
  510. PUM_COMMAND_OPTION CommandOptionList,
  511. DWORD HangupFlags
  512. );
  513. DWORD WINAPI
  514. UmHangupModem(
  515. HANDLE ModemHandle,
  516. PUM_COMMAND_OPTION CommandOptionList,
  517. DWORD HangupFlags
  518. );
  519. /*++
  520. Routine Description:
  521. This routine is called to hangup a call
  522. Arguments:
  523. ModemHandle - Handle returned by OpenModem
  524. CommandsOptionList - List option blocks, only flags used
  525. Flags - see above
  526. Return Value:
  527. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  528. or other specific error
  529. --*/
  530. typedef
  531. HANDLE
  532. (*PFNUMDUPLICATEDEVICEHANDLE)(
  533. HANDLE ModemHandle,
  534. HANDLE ProcessHandle
  535. );
  536. HANDLE WINAPI
  537. UmDuplicateDeviceHandle(
  538. HANDLE ModemHandle,
  539. HANDLE ProcessHandle
  540. );
  541. /*++
  542. Routine Description:
  543. This routine is called to duplicate the actual device handle that the miniport is using
  544. to communicate to the deivce. CloseHandle() must be called on the handle before a new
  545. call may be placed.
  546. Arguments:
  547. ModemHandle - Handle returned by OpenModem
  548. ProcessHandle - Handle of process wanting handle
  549. Return Value:
  550. Valid handle of NULL if failure
  551. --*/
  552. #define PASSTHROUUGH_MODE_OFF (0x00)
  553. #define PASSTHROUUGH_MODE_ON (0x01)
  554. #define PASSTHROUUGH_MODE_ON_DCD_SNIFF (0x02)
  555. typedef
  556. DWORD
  557. (*PFNUMSETPASSTHROUGHMODE)(
  558. HANDLE ModemHandle,
  559. DWORD PasssthroughMode
  560. );
  561. DWORD WINAPI
  562. UmSetPassthroughMode(
  563. HANDLE ModemHandle,
  564. DWORD PasssthroughMode
  565. );
  566. /*++
  567. Routine Description:
  568. This routine is called to set the passsthrough mode
  569. Arguments:
  570. ModemHandle - Handle returned by OpenModem
  571. Return Value:
  572. ERROR_SUCCESS or other specific error
  573. --*/
  574. typedef
  575. DWORD
  576. (*PFNUMGENERATEDIGIT)(
  577. HANDLE ModemHandle,
  578. PUM_COMMAND_OPTION CommandOptionList,
  579. LPSTR DigitString
  580. );
  581. DWORD WINAPI
  582. UmGenerateDigit(
  583. HANDLE ModemHandle,
  584. PUM_COMMAND_OPTION CommandOptionList,
  585. LPSTR DigitString
  586. );
  587. /*++
  588. Routine Description:
  589. This routine is called to generate DTMF tones once a call is connected
  590. Arguments:
  591. ModemHandle - Handle returned by OpenModem
  592. CommandsOptionList - List option blocks, only flags used
  593. Flags - Optional init parameters. Not currently used and must be zero
  594. DigitString - Digits to dial
  595. Return Value:
  596. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  597. or other specific error
  598. --*/
  599. typedef
  600. DWORD
  601. (*PFNUMSETSPEAKERPHONESTATE)(
  602. HANDLE ModemHandle,
  603. PUM_COMMAND_OPTION CommandOptionList,
  604. DWORD CurrentMode,
  605. DWORD NewMode,
  606. DWORD Volume,
  607. DWORD Gain
  608. );
  609. DWORD WINAPI
  610. UmSetSpeakerPhoneState(
  611. HANDLE ModemHandle,
  612. PUM_COMMAND_OPTION CommandOptionList,
  613. DWORD CurrentMode,
  614. DWORD NewMode,
  615. DWORD Volume,
  616. DWORD Gain
  617. );
  618. /*++
  619. Routine Description:
  620. This routine is called to set the state of the speaker phone. The new speaker phone state will
  621. be set based on the new mode. Current mode may be used to determine how to get from current
  622. state to the new state. If CurrentState and NewState are the same then the volume and gain
  623. will be adjusted.
  624. Arguments:
  625. ModemHandle - Handle returned by OpenModem
  626. CommandsOptionList - List option blocks, only flags used
  627. Flags - Optional init parameters. Not currently used and must be zero
  628. CurrentMode - TAPI constant representing the current speaker phone state
  629. NewMode - TAPI constant represent the new desired state
  630. Volume - Speaker phone volume
  631. Gain - Speaker phone volume
  632. Return Value:
  633. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  634. or other specific error
  635. --*/
  636. typedef
  637. DWORD
  638. (*PFNUMISSUECOMMAND)(
  639. HANDLE ModemHandle,
  640. PUM_COMMAND_OPTION CommandOptionList,
  641. LPSTR ComandToIssue,
  642. LPSTR TerminationSequnace,
  643. DWORD MaxResponseWaitTime
  644. );
  645. DWORD WINAPI
  646. UmIssueCommand(
  647. HANDLE ModemHandle,
  648. PUM_COMMAND_OPTION CommandOptionList,
  649. LPSTR ComandToIssue,
  650. LPSTR TerminationSequnace,
  651. DWORD MaxResponseWaitTime
  652. );
  653. /*++
  654. Routine Description:
  655. This routine is called to issue an arbartary commadn to the modem
  656. Arguments:
  657. ModemHandle - Handle returned by OpenModem
  658. CommandsOptionList - List option blocks, only flags used
  659. Flags - Optional init parameters. Not currently used and must be zero
  660. CommandToIssue - Null terminated Command to be sent to the modem
  661. TerminationSequence - Null terminated string to look for to indicate the end of a response
  662. MaxResponseWaitTime - Time in MS to wait for a response match
  663. Return Value:
  664. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  665. or other specific error
  666. --*/
  667. //
  668. // Start playback
  669. //
  670. #define WAVE_ACTION_START_PLAYBACK (0x00)
  671. //
  672. // Start RECORD
  673. //
  674. #define WAVE_ACTION_START_RECORD (0x01)
  675. //
  676. // Start DUPLEX
  677. //
  678. #define WAVE_ACTION_START_DUPLEX (0x02)
  679. //
  680. // Stop streaming
  681. //
  682. #define WAVE_ACTION_STOP_STREAMING (0x04)
  683. //
  684. // Abort streaming
  685. //
  686. #define WAVE_ACTION_ABORT_STREAMING (0x05)
  687. //
  688. // enable wave actions to handset
  689. //
  690. #define WAVE_ACTION_OPEN_HANDSET (0x06)
  691. //
  692. // disable handset actions
  693. //
  694. #define WAVE_ACTION_CLOSE_HANDSET (0x07)
  695. //
  696. // Set if the audiocommand are for the handset instead of the line
  697. //
  698. #define WAVE_ACTION_USE_HANDSET (1 << 31)
  699. typedef
  700. DWORD
  701. (*PFNUMWAVEACTION)(
  702. HANDLE ModemHandle,
  703. PUM_COMMAND_OPTION CommandOptionList,
  704. DWORD WaveActionFlags
  705. );
  706. DWORD WINAPI
  707. UmWaveAction(
  708. HANDLE ModemHandle,
  709. PUM_COMMAND_OPTION CommandOptionList,
  710. DWORD WaveAction
  711. );
  712. /*++
  713. Routine Description:
  714. Executes a specific wave related action
  715. Arguments:
  716. ModemHandle - Handle returned by OpenModem
  717. CommandsOptionList - List option blocks, only flags used
  718. Flags - see above
  719. WaveAction - Specifies actions to take
  720. Return Value:
  721. ERROR_IO_PENDING If pending, will be completed later with a call to the AsyncHandler
  722. or other specific error
  723. --*/
  724. // Prefix Text by a date and time stamp.
  725. #define LOG_FLAG_PREFIX_TIMESTAMP (1<<0)
  726. typedef
  727. VOID
  728. (*PFNUMLOGSTRINGA)(
  729. HANDLE ModemHandle,
  730. DWORD LogFlags,
  731. LPCSTR Text
  732. );
  733. VOID WINAPI
  734. UmLogStringA(
  735. HANDLE ModemHandle,
  736. DWORD LogFlags,
  737. LPCSTR Text
  738. );
  739. /*++
  740. Routine description:
  741. This routine is called to add arbitrary ASCII text to the log.
  742. If logging is not enabled, no action is performed. The format and
  743. location of the log is mini-driver specific. This function completes
  744. synchronously and the caller is free to reuse the Text buffer after
  745. the call returns.
  746. Arguments:
  747. ModemHandle - Handle returned by OpenModem
  748. Flags see above
  749. Text ASCII text to be added to the log.
  750. Return Value:
  751. None
  752. --*/
  753. typedef
  754. DWORD
  755. (*PFNUMGETDIAGNOSTICS)(
  756. HANDLE ModemHandle,
  757. DWORD DiagnosticType, // Reserved, must be zero.
  758. BYTE *Buffer,
  759. DWORD BufferSize,
  760. LPDWORD UsedSize
  761. );
  762. DWORD WINAPI
  763. UmGetDiagnostics(
  764. HANDLE ModemHandle,
  765. DWORD DiagnosticType, // Reserved, must be zero.
  766. BYTE *Buffer,
  767. DWORD BufferSize,
  768. LPDWORD UsedSize
  769. );
  770. /*++
  771. Routine description:
  772. This routine requests raw diagnostic information on the last call from
  773. the modem and if it is successful copies up-to BufferSize bytes of this
  774. information into the supplied buffer, Buffer, and sets *UsedSize to the number
  775. of bytes actually copied.
  776. Note that is *UsedSize == BufferSize on successful return, it is likely but not
  777. certain that there is more information than could be copied over.
  778. The latter information is lost.
  779. The format of this information is the ascii tagged format documented in the
  780. documentation for the AT#UD command. The minidriver presents a single string
  781. containing all the tags, stripping out any AT-specific prefix (such as "DIAG")
  782. that modems may prepend for multi-line reporting of diagnostic information.
  783. The TSP should be able to deal with malformed tags, unknown tags, an possibly
  784. non-printable characters, including possibly embedded null characters in the
  785. buffer. The buffer is not null terminated.
  786. The recommended point to call this function is after completion of
  787. UmHangupModem. This function should not be called when there is a call
  788. in progress. If this function is called when a call is in progress the result
  789. and side-effects are undefined, and could include failure of the call.
  790. The TSP should not expect information about a call to be preserved after
  791. UmInitModem, UmCloseModem and UmOpenModem.
  792. Return Value:
  793. ERROR_SUCCESS if successful.
  794. ERROR_IO_PENDING if pending, will be called by a later call to AsyncHandler.
  795. The TSP must guarantee that the locations pointed to by UsedSize
  796. and Buffer are valid until the async completion. The TSP can use
  797. UmAbortCurrentCommand to abort the the UmGetDiagnostics command,
  798. but must still guarantee the locations are valid until async
  799. completion of UmGetDiagnostics.
  800. Other return values represent other failures.
  801. --*/
  802. typedef
  803. VOID
  804. (*PFNUMLOGDIAGNOSTICS)(
  805. HANDLE ModemHandle,
  806. LPVARSTRING VarString
  807. );
  808. VOID WINAPI
  809. UmLogDiagnostics(
  810. HANDLE ModemHandle,
  811. LPVARSTRING VarString
  812. );
  813. /*++
  814. Routine description:
  815. This routine is called to write the translated diagnostic info to the
  816. minidriver log
  817. Arguments:
  818. ModemHandle - Handle returned by OpenModem
  819. Flags see above
  820. Text ASCII text to be added to the log.
  821. Return Value:
  822. None
  823. --*/
  824. #ifdef __cplusplus
  825. }
  826. #endif