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.

1165 lines
24 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. common.h
  5. Abstract:
  6. Author:
  7. mquinton 06-12-97
  8. Notes:
  9. Revision History:
  10. --*/
  11. #ifndef __common_h__
  12. #define __common_h__
  13. #undef new
  14. #include <list>
  15. #if defined(_DEBUG)
  16. #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
  17. #endif
  18. using namespace std;
  19. #include "utils.h"
  20. #include "tapi3err.h"
  21. class CAddress;
  22. class CCall;
  23. class CMediaServiceProvider;
  24. class CTAPI;
  25. class CAgentHandler;
  26. class CCallHub;
  27. class CTerminal;
  28. class CPhone;
  29. typedef struct _T3CALL
  30. {
  31. HCALL hCall;
  32. CCall * pCall;
  33. } T3CALL, *PT3CALL;
  34. typedef struct _T3LINE
  35. {
  36. HLINE hLine;
  37. CAddress * pAddress;
  38. DWORD dwAddressLineStructHandle;
  39. } T3LINE, *PT3LINE;
  40. typedef struct _T3PHONE
  41. {
  42. HPHONE hPhone;
  43. CPhone * pPhone;
  44. #ifdef USEPHONE_MSP
  45. ITPhoneMSPCallPrivate * pMSPCall;
  46. #endif USEPHONE_MSP
  47. } T3PHONE, *PT3PHONE;
  48. typedef struct _tagPrivateObjectStruct
  49. {
  50. DWORD dwProviderID;
  51. DWORD dwDeviceID;
  52. CTAPI * pTapi;
  53. IUnknown * pPrivateTapi;
  54. } PrivateObjectStruct;
  55. typedef list<DWORD> AddressTypeList;
  56. typedef list<LPOLESTR> MediaTypePtrList;
  57. typedef list<BSTR> TerminalClassPtrList;
  58. typedef list<BSTR> BstrPtrList;
  59. typedef list<CONNECTDATA> ConnectDataList;
  60. typedef list<PVOID> PtrList;
  61. typedef list<long> LongList;
  62. typedef CTObjectArray<ITAddress *> AddressArray;
  63. typedef CTObjectArray<ITTerminal *> TerminalArray;
  64. typedef CTObjectArray<ITTerminalPrivate *> TerminalPrivateArray;
  65. typedef CTArray<ITCallInfo *> CallInfoArrayNR;
  66. typedef CTObjectArray<ITCallingCard *> CallingCardArray;
  67. typedef CTObjectArray<ITLocationInfo *> LocationArray;
  68. typedef CTObjectArray<ITQueue *> QueueArray;
  69. typedef CTObjectArray<ITAgentSession *> AgentSessionArray;
  70. typedef CTArray<ITCallHub *> CallHubArrayNR;
  71. typedef CTArray<IUnknown *> UnknownArrayNR;
  72. typedef CTObjectArray<IUnknown *> UnknownArray;
  73. //typedef CTArray<ITAgentHandler *> AgentHandlerArrayNR;
  74. typedef CTObjectArray<ITAgentHandler *> AgentHandlerArray;
  75. typedef CTArray<CTAPI *> TAPIObjectArrayNR;
  76. typedef CTObjectArray<CTAPI *> TAPIObjectArray;
  77. typedef CTObjectArray<ITACDGroup *> GroupArray;
  78. typedef CTObjectArray<ITAgent *> AgentArray;
  79. typedef CTArray<CONNECTDATA> ConnectDataArray;
  80. typedef CTArray<PrivateObjectStruct *> PrivateObjectStructArray;
  81. typedef CTObjectArray<CAddress *> CAddressArray;
  82. typedef CTObjectArray<ITStream *> StreamArray;
  83. typedef CTObjectArray<ITPhone *> PhoneArray;
  84. struct AddressLineStruct
  85. {
  86. DECLARE_TRACELOG_CLASS(AddressLineStruct)
  87. AddressLineStruct()
  88. {
  89. dwMediaModes = 0;
  90. dwPrivs = 0;
  91. dwRefCount = 0;
  92. lCallbackInstance = 0;
  93. }
  94. T3LINE t3Line;
  95. DWORD dwMediaModes;
  96. DWORD dwPrivs;
  97. private:
  98. //
  99. // this data member should only be accessed through public access functions
  100. //
  101. DWORD dwRefCount;
  102. public:
  103. long lCallbackInstance;
  104. public:
  105. DWORD AddRef()
  106. {
  107. LONG l = InterlockedIncrement( (LONG*)(&dwRefCount) );
  108. LOG((TL_INFO, "AddRef - dwRefCount[%ld]", l));
  109. _ASSERTE(l > 0);
  110. return l;
  111. }
  112. DWORD Release()
  113. {
  114. LONG l = InterlockedDecrement( (LONG*)(&dwRefCount) );
  115. LOG((TL_INFO, "Release - dwRefCount[%ld]", l));
  116. _ASSERTE(l >= 0);
  117. return l;
  118. }
  119. //
  120. // note: the caller is responsible for ensuring thread safety of this call
  121. //
  122. void InitializeRefcount(DWORD dwInitialRC)
  123. {
  124. dwRefCount = dwInitialRC;
  125. }
  126. };
  127. typedef list<AddressLineStruct *> AddressLinePtrList;
  128. typedef struct _tagRegisterItem
  129. {
  130. DWORD dwType;
  131. PVOID pInterface;
  132. PVOID pRegister;
  133. } REGISTERITEM;
  134. typedef enum TAPICALLBACKEVENTTYPE
  135. {
  136. CALLBACKTYPE_TAPI_EVENT_OBJECT,
  137. CALLBACKTYPE_RAW_ASYNC_MESSAGE
  138. } TAPICALLBACKEVENTTYPE;
  139. typedef struct _tagTAPICALLBACKEVENT
  140. {
  141. TAPICALLBACKEVENTTYPE type;
  142. CTAPI *pTapi;
  143. union
  144. {
  145. ASYNCEVENTMSG asyncMessage;
  146. struct
  147. {
  148. TAPI_EVENT te;
  149. IDispatch * pEvent;
  150. }tapiEvent;
  151. }data;
  152. } TAPICALLBACKEVENT, *PTAPICALLBACKEVENT;
  153. typedef struct _T3INIT_DATA
  154. {
  155. DWORD dwKey;
  156. DWORD dwInitOptions;
  157. DWORD hXxxApp;
  158. BOOL bPendingAsyncEventMsg;
  159. CTAPI * pTAPI;
  160. } T3INIT_DATA, *PT3INIT_DATA;
  161. #define TAPIERR_INVALRPCCONTEXT 0xF101
  162. #define RA_ADDRESS 0
  163. #define RA_CALLHUB 1
  164. #define AUDIOMEDIAMODES (LINEMEDIAMODE_INTERACTIVEVOICE | LINEMEDIAMODE_AUTOMATEDVOICE)
  165. #define ALLMEDIAMODES (LINEMEDIAMODE_AUTOMATEDVOICE | LINEMEDIAMODE_VIDEO | \
  166. LINEMEDIAMODE_G3FAX | LINEMEDIAMODE_DATAMODEM )
  167. #define PRIVATE_UNADVISE 0xFFFF0000
  168. #define PRIVATE_CALLHUB 0xFFFE0000
  169. #define PRIVATE_PHONESETHOOKSWITCH 0xFFFD0000
  170. #define PRIVATE_MSPEVENT 0xFFFC0000
  171. #define PRIVATE_ISDN__ACCEPTTOALERT 0xFFFB0000
  172. #define ALLMEDIATYPES 0xFFFFFFFF
  173. #define GET_SUBEVENT_FLAG( a ) ( 1 << ( a ) )
  174. EXTERN_C const CLSID CLSID_AddressRoot;
  175. EXTERN_C const GUID CLSID_CallRoot;
  176. EXTERN_C const GUID IID_Audio;
  177. EXTERN_C const GUID IID_InteractiveVoice;
  178. EXTERN_C const GUID IID_AutomatedVoice;
  179. EXTERN_C const GUID IID_Video;
  180. EXTERN_C const GUID IID_Data;
  181. EXTERN_C const GUID IID_DataModem;
  182. EXTERN_C const GUID IID_G3Fax;
  183. HRESULT
  184. LineGetAddressCaps(
  185. HLINEAPP hLineApp,
  186. DWORD dwDeviceID,
  187. DWORD dwAddressID,
  188. DWORD dwAPIVersion,
  189. LPLINEADDRESSCAPS * ppAddressCaps
  190. );
  191. HRESULT
  192. LineGetDevCaps(
  193. HLINEAPP hLineApp,
  194. DWORD dwDeviceID,
  195. DWORD dwAPIVersion,
  196. LPLINEDEVCAPS * ppLineDevCaps
  197. );
  198. HRESULT
  199. LineGetDevCapsWithAlloc(
  200. HLINEAPP hLineApp,
  201. DWORD dwDeviceID,
  202. DWORD dwAPIVersion,
  203. LPLINEDEVCAPS * ppLineDevCaps
  204. );
  205. HRESULT
  206. LineGetID(
  207. HLINE hLine,
  208. DWORD dwID,
  209. HCALL hCall,
  210. DWORD dwSelect,
  211. LPVARSTRING * ppDeviceID,
  212. LPCWSTR lpszDeviceClass
  213. );
  214. HRESULT
  215. LineGetDevConfig(
  216. DWORD dwDeviceID,
  217. LPVARSTRING * ppDeviceConfig,
  218. LPCWSTR lpszDeviceClass
  219. );
  220. HRESULT
  221. LineGetCallStatus(
  222. HCALL hCall,
  223. LPLINECALLSTATUS * ppCallStatus
  224. );
  225. HRESULT
  226. LineGetProviderList(
  227. LPLINEPROVIDERLIST * ppProviderList
  228. );
  229. HRESULT
  230. LineNegotiateAPIVersion(
  231. HLINEAPP hLineApp,
  232. DWORD dwDeviceID,
  233. LPDWORD lpdwAPIVersion
  234. );
  235. HRESULT
  236. LineOpen(
  237. HLINEAPP hLineApp,
  238. DWORD dwDeviceID,
  239. DWORD dwAddressID,
  240. T3LINE * pt3Line,
  241. DWORD dwAPIVersion,
  242. DWORD dwPrivileges,
  243. DWORD dwMediaModes,
  244. AddressLineStruct * pAddressLine,
  245. LPLINECALLPARAMS const lpCallParams,
  246. CAddress * pAddress,
  247. CTAPI * pTapiObj,
  248. BOOL bAddToHashTable = TRUE
  249. );
  250. HRESULT
  251. LineClose(
  252. T3LINE * pt3Line
  253. );
  254. HRESULT
  255. LineMakeCall(
  256. T3LINE * pt3Line,
  257. HCALL * phCall,
  258. LPCWSTR lpszDestAddress,
  259. DWORD dwCountryCode,
  260. LPLINECALLPARAMS const lpCallParams
  261. );
  262. LONG
  263. LineDrop(
  264. HCALL hCall,
  265. LPCSTR lpsUserUserInfo,
  266. DWORD dwSize
  267. );
  268. HRESULT
  269. LineDeallocateCall(
  270. HCALL hCall
  271. );
  272. HRESULT
  273. LineDial(
  274. HCALL hCall,
  275. LPCWSTR lpszDestAddress,
  276. DWORD dwCountryCode
  277. );
  278. HRESULT
  279. LineAddToConference(
  280. HCALL hConfCall,
  281. HCALL hConsultCall
  282. );
  283. HRESULT
  284. LinePrepareAddToConference(
  285. HCALL hConfCall,
  286. HCALL *phConsultCall,
  287. LPLINECALLPARAMS const lpCallParams
  288. );
  289. HRESULT
  290. LineSetupConference(
  291. HCALL hCall,
  292. T3LINE * pt3Line,
  293. HCALL * phConfCall,
  294. HCALL * phConsultCall,
  295. DWORD dwNumParties,
  296. LPLINECALLPARAMS const lpCallParams
  297. );
  298. HRESULT
  299. LineRemoveFromConference(
  300. HCALL hCall
  301. );
  302. HRESULT
  303. LineGetConfRelatedCalls(
  304. HCALL hCall,
  305. LINECALLLIST ** ppCallList
  306. );
  307. HRESULT
  308. LineBlindTransfer(
  309. HCALL hCall,
  310. LPCWSTR lpszDestAddress,
  311. DWORD dwCountryCode
  312. );
  313. HRESULT
  314. LineSetupTransfer(
  315. HCALL hCall,
  316. HCALL *phConsultCall,
  317. LPLINECALLPARAMS const lpCallParams
  318. );
  319. HRESULT
  320. LineCompleteTransfer(
  321. HCALL hCall,
  322. HCALL hConsultCall,
  323. T3CALL * pt3ConfCall,
  324. DWORD dwTransferMode
  325. );
  326. HRESULT
  327. LineConfigDialogW(
  328. DWORD dwDeviceID,
  329. HWND hwndOwner,
  330. LPCWSTR lpszDeviceClass
  331. );
  332. HRESULT
  333. LineConfigDialogEditW(
  334. DWORD dwDeviceID,
  335. HWND hwndOwner,
  336. LPCWSTR lpszDeviceClass,
  337. LPVOID const lpDeviceConfigIn,
  338. DWORD dwSize,
  339. LPVARSTRING * ppDeviceConfigOut
  340. );
  341. HRESULT
  342. LineHold(
  343. HCALL hCall
  344. );
  345. HRESULT
  346. LineUnhold(
  347. HCALL hCall
  348. );
  349. HRESULT
  350. LineHandoff(
  351. HCALL hCall,
  352. LPCWSTR lpszFileName,
  353. DWORD dwMediaMode
  354. );
  355. HRESULT
  356. LineSetStatusMessages(
  357. T3LINE * pt3Line,
  358. DWORD dwLineStates,
  359. DWORD dwAddressStates
  360. );
  361. HRESULT
  362. LineGetTranslateCaps(
  363. HLINEAPP hLineApp,
  364. DWORD dwAPIVersion,
  365. LPLINETRANSLATECAPS *ppTranslateCaps
  366. );
  367. HRESULT
  368. LineTranslateAddress(
  369. HLINEAPP hLineApp,
  370. DWORD dwDeviceID,
  371. DWORD dwAPIVersion,
  372. LPCWSTR lpszAddressIn,
  373. DWORD dwCard,
  374. DWORD dwTranslateOptions,
  375. LPLINETRANSLATEOUTPUT *ppTranslateOutput
  376. );
  377. HRESULT
  378. LinePark(
  379. HCALL hCall,
  380. DWORD dwParkMode,
  381. LPCWSTR lpszDirAddress,
  382. LPVARSTRING * ppNonDirAddress
  383. );
  384. HRESULT
  385. LineUnpark(
  386. HLINE hLine,
  387. DWORD dwAddressID,
  388. HCALL *phCall,
  389. LPCWSTR lpszDestAddress
  390. );
  391. HRESULT
  392. LineSwapHold(
  393. HCALL hActiveCall,
  394. HCALL hHeldCall
  395. );
  396. HRESULT
  397. LineSendUserUserInfo(
  398. HCALL hCall,
  399. LPCSTR lpsUserUserInfo,
  400. DWORD dwSize
  401. );
  402. HRESULT
  403. LineReleaseUserUserInfo(
  404. HCALL hCall
  405. );
  406. HRESULT
  407. LineRegisterRequestRecipient(
  408. HLINEAPP hLineApp,
  409. DWORD dwRegistrationInstance,
  410. DWORD dwRequestMode,
  411. #ifdef NEWREQUEST
  412. DWORD dwAddressTypes,
  413. #endif
  414. DWORD bEnable
  415. );
  416. HRESULT
  417. LineSetAppSpecific(
  418. HCALL hCall,
  419. DWORD dwAppSpecific
  420. );
  421. HRESULT
  422. LineGetCallIDs(
  423. HCALL hCall,
  424. LPDWORD lpdwAddressID,
  425. LPDWORD lpdwCallID,
  426. LPDWORD lpdwRelatedCallID
  427. );
  428. HRESULT
  429. LineGetCallInfo(
  430. HCALL hCall,
  431. LPLINECALLINFO * ppCallInfo
  432. );
  433. HRESULT
  434. LineSetCallData(
  435. HCALL hCall,
  436. LPVOID lpCallData,
  437. DWORD dwSize
  438. );
  439. HRESULT
  440. WINAPI
  441. LineSetCallHubTracking(
  442. T3LINE * pt3Line,
  443. LINECALLHUBTRACKINGINFO * plchti
  444. );
  445. HRESULT
  446. CreateMSPObject(
  447. DWORD dwDeviceID,
  448. IUnknown * pUnk,
  449. IUnknown ** ppMSPAggAddress
  450. );
  451. HRESULT
  452. LineAnswer(
  453. HCALL hCall
  454. );
  455. HRESULT
  456. LineSetCallTreatment(
  457. HCALL hCall,
  458. DWORD dwTreatment
  459. );
  460. HRESULT
  461. LineSetMediaMode(
  462. HCALL hCall,
  463. DWORD dwMediaModes
  464. );
  465. HRESULT
  466. LineMonitorDigits(
  467. HCALL hCall,
  468. DWORD dwDigitModes
  469. );
  470. HRESULT
  471. LineMonitorTones(
  472. HCALL hCall,
  473. LPLINEMONITORTONE const lpToneList,
  474. DWORD dwNumEntries
  475. );
  476. HRESULT
  477. LineGatherDigits(
  478. HCALL hCall,
  479. DWORD dwDigitModes,
  480. LPWSTR lpsDigits,
  481. DWORD dwNumDigits,
  482. LPCWSTR lpszTerminationDigits,
  483. DWORD dwFirstDigitTimeout,
  484. DWORD dwInterDigitTimeout
  485. );
  486. HRESULT
  487. LineGenerateDigits(
  488. HCALL hCall,
  489. DWORD dwDigitMode,
  490. LPCWSTR lpszDigits,
  491. DWORD dwDuration
  492. );
  493. HRESULT
  494. LineGenerateTone(
  495. HCALL hCall,
  496. DWORD dwToneMode,
  497. DWORD dwDuration,
  498. DWORD dwNumTones,
  499. LPLINEGENERATETONE const lpTones
  500. );
  501. HRESULT
  502. LineReceiveMSPData(
  503. HLINE hLine,
  504. HCALL hCall,
  505. PBYTE pBuffer,
  506. DWORD dwSize
  507. );
  508. HRESULT
  509. LineGetCallHubTracking(
  510. DWORD dwDeviceID,
  511. LINECALLHUBTRACKINGINFO ** ppTrackingInfo
  512. );
  513. HRESULT
  514. LineGetHubRelatedCalls(
  515. HCALLHUB hCallHub,
  516. HCALL hCall,
  517. LINECALLLIST ** ppCallHubList
  518. );
  519. HRESULT
  520. LineGetCallHub(
  521. HCALL hCall,
  522. HCALLHUB * pCallHub
  523. );
  524. HRESULT
  525. LinePickup(
  526. HLINE hLine,
  527. DWORD dwAddressID,
  528. HCALL *phCall,
  529. LPCWSTR lpszDestAddress,
  530. LPCWSTR lpszGroupID
  531. );
  532. HRESULT
  533. LineGetLineDevStatus(
  534. HLINE hLine,
  535. LPLINEDEVSTATUS * ppDevStatus
  536. );
  537. HRESULT
  538. LineGetProxyStatus(
  539. HLINEAPP hLineApp,
  540. DWORD dwDeviceID,
  541. DWORD dwAppAPIVersion,
  542. LPLINEPROXYREQUESTLIST * ppLineProxyReqestList
  543. );
  544. HRESULT
  545. LineSetLineDevStatus(
  546. T3LINE *pLine,
  547. DWORD dwStatusToChange,
  548. DWORD fStatus
  549. );
  550. HRESULT
  551. LineGetAddressStatus(
  552. T3LINE * pt3Line,
  553. DWORD dwAddressID,
  554. LPLINEADDRESSSTATUS * ppAddressStatus
  555. );
  556. HRESULT
  557. LineForward(
  558. T3LINE * pt3Line,
  559. DWORD dwAddressID,
  560. LPLINEFORWARDLIST const lpForwardList,
  561. DWORD dwNumRingsNoAnswer,
  562. LPHCALL lphConsultCall
  563. );
  564. HRESULT
  565. LineSetCallQualityOfService(
  566. HCALL hCall,
  567. QOS_SERVICE_LEVEL ServiceLevel,
  568. DWORD dwMediaType
  569. );
  570. HRESULT
  571. LineAccept(
  572. HCALL hCall,
  573. LPCSTR lpsUserUserInfo,
  574. DWORD dwSize
  575. );
  576. HRESULT
  577. PhoneNegotiateAPIVersion(
  578. HPHONEAPP hPhoneApp,
  579. DWORD dwDeviceID,
  580. LPDWORD lpdwAPIVersion
  581. );
  582. HRESULT
  583. PhoneOpen(
  584. HPHONEAPP hPhoneApp,
  585. DWORD dwDeviceID,
  586. T3PHONE * pt3Phone,
  587. DWORD dwAPIVersion,
  588. DWORD dwPrivilege
  589. );
  590. HRESULT
  591. PhoneClose(
  592. HPHONE hPhone,
  593. BOOL bCleanHashTableOnFailure = TRUE
  594. );
  595. HRESULT
  596. PhoneGetStatusWithAlloc(
  597. HPHONE hPhone,
  598. LPPHONESTATUS *ppPhoneStatus
  599. );
  600. HRESULT
  601. PhoneGetDevCapsWithAlloc(
  602. HPHONEAPP hPhoneApp,
  603. DWORD dwDeviceID,
  604. DWORD dwAPIVersion,
  605. LPPHONECAPS * ppPhoneCaps
  606. );
  607. HRESULT
  608. PhoneGetDevCaps(
  609. HPHONEAPP hPhoneApp,
  610. DWORD dwDeviceID,
  611. DWORD dwAPIVersion,
  612. LPPHONECAPS * ppPhoneCaps
  613. );
  614. HRESULT
  615. PhoneGetDisplay(
  616. HPHONE hPhone,
  617. LPVARSTRING * ppDisplay
  618. );
  619. HRESULT
  620. PhoneSetStatusMessages(
  621. T3PHONE * pt3Phone,
  622. DWORD dwPhoneStates,
  623. DWORD dwButtonModes,
  624. DWORD dwButtonStates
  625. );
  626. HRESULT
  627. PhoneGetButtonInfo(
  628. HPHONE hPhone,
  629. DWORD dwButtonLampID,
  630. LPPHONEBUTTONINFO * ppButtonInfo
  631. );
  632. HRESULT
  633. PhoneSetButtonInfo(
  634. HPHONE hPhone,
  635. DWORD dwButtonLampID,
  636. LPPHONEBUTTONINFO const pButtonInfo
  637. );
  638. HRESULT
  639. PhoneGetLamp(
  640. HPHONE hPhone,
  641. DWORD dwButtonLampID,
  642. LPDWORD lpdwLampMode
  643. );
  644. HRESULT
  645. PhoneSetLamp(
  646. HPHONE hPhone,
  647. DWORD dwButtonLampID,
  648. DWORD dwLampMode
  649. );
  650. HRESULT
  651. PhoneGetHookSwitch(
  652. HPHONE hPhone,
  653. LPDWORD lpdwHookSwitchDevs
  654. );
  655. HRESULT
  656. PhoneGetRing(
  657. HPHONE hPhone,
  658. LPDWORD lpdwRingMode,
  659. LPDWORD lpdwVolume
  660. );
  661. HRESULT
  662. PhoneSetRing(
  663. HPHONE hPhone,
  664. DWORD dwRingMode,
  665. DWORD dwVolume
  666. );
  667. HRESULT
  668. PhoneGetID(
  669. HLINE hPhone,
  670. LPVARSTRING * ppDeviceID,
  671. LPCWSTR lpszDeviceClass
  672. );
  673. HRESULT
  674. PhoneSetDisplay(
  675. HPHONE hPhone,
  676. DWORD dwRow,
  677. DWORD dwColumn,
  678. LPCSTR lpsDisplay,
  679. DWORD dwSize
  680. );
  681. HRESULT
  682. PhoneGetGain(
  683. HPHONE hPhone,
  684. DWORD dwHookSwitchDev,
  685. LPDWORD lpdwGain
  686. );
  687. HRESULT
  688. PhoneSetGain(
  689. HPHONE hPhone,
  690. DWORD dwHookSwitchDev,
  691. DWORD dwGain
  692. );
  693. HRESULT
  694. PhoneGetVolume(
  695. HPHONE hPhone,
  696. DWORD dwHookSwitchDev,
  697. LPDWORD lpdwVolume
  698. );
  699. HRESULT
  700. PhoneSetVolume(
  701. HPHONE hPhone,
  702. DWORD dwHookSwitchDev,
  703. DWORD dwVolume
  704. );
  705. HRESULT
  706. PhoneSetHookSwitch(
  707. HPHONE hPhone,
  708. DWORD dwHookSwitchDevs,
  709. DWORD dwHookSwitchMode
  710. );
  711. HRESULT
  712. ProviderPrivateFactoryIdentify(
  713. DWORD dwDeviceID,
  714. GUID * pguid
  715. );
  716. HRESULT
  717. ProviderPrivateChannelData(
  718. DWORD dwDeviceID,
  719. DWORD dwAddressID,
  720. HCALL hCall,
  721. HCALLHUB hCallHub,
  722. DWORD dwType,
  723. BYTE * pBuffer,
  724. DWORD dwSize
  725. );
  726. BOOL
  727. GetMediaMode(
  728. BSTR bstr,
  729. BOOL bActiveMovie,
  730. DWORD * pdwMediaMode
  731. );
  732. BOOL
  733. GetMediaTypes(
  734. DWORD dwMediaMode,
  735. MediaTypePtrList * plist
  736. );
  737. HRESULT
  738. VerifyAndGetArrayBounds(
  739. VARIANT Array,
  740. SAFEARRAY ** ppsa,
  741. long * pllBound,
  742. long * pluBound
  743. );
  744. HRESULT
  745. ConvertMediaTypesToMediaModes(
  746. VARIANT pMediaTypes,
  747. DWORD * pdwMediaModes
  748. );
  749. BOOL
  750. IsAudioInTerminal( ITTerminal * pTerminal);
  751. BOOL
  752. FindCallObject(
  753. HCALL hCall,
  754. CCall ** ppCall
  755. );
  756. BOOL
  757. FindAddressObject(
  758. HLINE hLine,
  759. CAddress ** ppAddress
  760. );
  761. BOOL
  762. FindAgentHandlerObject(
  763. HLINE hLine,
  764. CAgentHandler ** ppAgentHandler
  765. );
  766. BOOL
  767. FindPhoneObject(
  768. HPHONE hPhone,
  769. CPhone ** ppPhone
  770. );
  771. BOOL
  772. FindCallHubObject(
  773. HCALLHUB hCallHub,
  774. CCallHub ** ppCallHub
  775. );
  776. HRESULT
  777. LineGetAgentCaps(
  778. HLINEAPP hLineApp,
  779. DWORD dwDeviceID,
  780. DWORD dwAddressID,
  781. DWORD dwAppAPIVersion,
  782. LPLINEAGENTCAPS *ppAgentCaps
  783. );
  784. HRESULT
  785. LineCreateAgent(
  786. HLINE hLine,
  787. PWSTR pszAgentID,
  788. PWSTR pszAgentPIN,
  789. LPHAGENT lphAgent // Return value
  790. );
  791. LONG
  792. WINAPI
  793. lineSetAgentMeasurementPeriod(
  794. HLINE hLine,
  795. HAGENT hAgent,
  796. DWORD dwMeasurementPeriod
  797. );
  798. LONG
  799. WINAPI
  800. lineGetAgentInfo(
  801. HLINE hLine,
  802. HAGENT hAgent,
  803. LPLINEAGENTINFO lpAgentInfo // Returned structure
  804. );
  805. HRESULT
  806. LineCreateAgentSession(
  807. HLINE hLine,
  808. HAGENT hAgent,
  809. PWSTR pszAgentPIN,
  810. DWORD dwWorkingAddressID,
  811. LPGUID lpGroupID,
  812. LPHAGENTSESSION lphAgentSession // Return value
  813. );
  814. LONG
  815. WINAPI
  816. lineGetAgentSessionInfo(
  817. HLINE hLine,
  818. HAGENTSESSION hAgentSession,
  819. LPLINEAGENTSESSIONINFO lpAgentSessionInfo // Returned structure
  820. );
  821. LONG
  822. WINAPI
  823. lineSetAgentSessionState(
  824. HLINE hLine,
  825. HAGENTSESSION hAgentSession,
  826. DWORD dwAgentState,
  827. DWORD dwNextAgentState
  828. );
  829. LONG
  830. WINAPI
  831. lineSetQueueMeasurementPeriod(
  832. HLINE hLine,
  833. DWORD dwQueueID,
  834. DWORD dwMeasurementPeriod
  835. );
  836. LONG
  837. WINAPI
  838. lineGetQueueInfo(
  839. HLINE hLine,
  840. DWORD dwQueueID,
  841. LPLINEQUEUEINFO lpQueueInfo // Returned structure
  842. );
  843. HRESULT
  844. LineGetGroupList(
  845. HLINE hLine,
  846. LPLINEAGENTGROUPLIST * pGroupList // Returned structure
  847. );
  848. HRESULT
  849. lineGetQueueList(
  850. HLINE hLine,
  851. LPGUID lpGroupID,
  852. LPLINEQUEUELIST * ppQueueList // Returned structure
  853. );
  854. LONG
  855. WINAPI
  856. lineGetAgentSessionList(
  857. HLINE hLine,
  858. HAGENT hAgent,
  859. LPLINEAGENTSESSIONLIST lpSessionList // Returned structure
  860. );
  861. HRESULT TapiMakeCall(
  862. BSTR pDestAddress,
  863. BSTR pAppName,
  864. BSTR pCalledParty,
  865. BSTR pComment
  866. );
  867. HRESULT
  868. LineTranslateDialog(
  869. DWORD dwDeviceID,
  870. DWORD dwAPIVersion,
  871. HWND hwndOwner,
  872. BSTR pAddressIn
  873. );
  874. HRESULT
  875. LineGetRequest(
  876. HLINEAPP hLineApp,
  877. DWORD dwRequestMode,
  878. LPLINEREQMAKECALLW * ppReqMakeCall
  879. );
  880. HRESULT
  881. LineSetAppPriority(
  882. LPCWSTR lpszAppName,
  883. DWORD dwMediaMode,
  884. DWORD dwRequestMode,
  885. DWORD dwPriority
  886. );
  887. HRESULT
  888. LineCreateMSPInstance(
  889. HLINE hLine,
  890. DWORD dwAddressID
  891. );
  892. HRESULT
  893. LineCloseMSPInstance(
  894. HLINE hLine
  895. );
  896. HRESULT
  897. LineSetCallParams(
  898. HCALL hCall,
  899. DWORD dwBearerMode,
  900. DWORD dwMinRate,
  901. DWORD dwMaxRate,
  902. LPLINEDIALPARAMS const lpDialParams
  903. );
  904. HRESULT
  905. WaitForReply(DWORD);
  906. HRESULT
  907. WaitForPhoneReply(DWORD dwID);
  908. void
  909. QueueCallbackEvent(PASYNCEVENTMSG pParams);
  910. PWSTR
  911. MyLoadString( UINT uID );
  912. HRESULT
  913. CreateWaveInfo(
  914. HLINE hLine,
  915. DWORD dwAddressID,
  916. HCALL hCall,
  917. DWORD dwCallSelect,
  918. BOOL bFullDuplex,
  919. LPDWORD pdwIDs
  920. );
  921. //
  922. // a helper function implemented in call.cpp that puts the passeed buffer into
  923. // a variant array
  924. //
  925. HRESULT FillVariantFromBuffer(
  926. IN DWORD dwBufferSize,
  927. IN BYTE * pBuffer,
  928. OUT VARIANT * pVar
  929. );
  930. #define MAX_DWORD 0xffffffff
  931. #if DBG
  932. DWORD DWORD_CAST(ULONG_PTR v);
  933. #else
  934. #define DWORD_CAST(x) ((DWORD)(x))
  935. #endif
  936. //
  937. // handle table manipulation routines
  938. //
  939. DWORD CreateHandleTableEntry(ULONG_PTR nEntry);
  940. void DeleteHandleTableEntry(DWORD dwHandle);
  941. ULONG_PTR GetHandleTableEntry(DWORD dwHandle);
  942. #define DECLARE_QI() \
  943. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject) = 0; \
  944. virtual ULONG STDMETHODCALLTYPE AddRef() = 0; \
  945. virtual ULONG STDMETHODCALLTYPE Release() = 0; \
  946. #endif
  947. //
  948. // IsBadWritePtr is not thread safe. so use IsBadReadPtr instread
  949. //
  950. #define TAPIIsBadWritePtr(x, y) IsBadWritePtr((x), (y))