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

907 lines
15 KiB

  1. /*++ BUILD Version: 0000 // Increment this if a change has global effects
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name:
  4. tb.h
  5. Abstract:
  6. Header file for the TAPI Browser util
  7. Author:
  8. Dan Knudson (DanKn) 23-Aug-1994
  9. Revision History:
  10. --*/
  11. #include <windows.h>
  12. #include <tapi.h>
  13. #if INTERNAL_3_0
  14. #include <tapimmc.h>
  15. #endif
  16. //
  17. // Symbolic constants
  18. //
  19. #define DS_NONZEROFIELDS 0x00000001
  20. #define DS_ZEROFIELDS 0x00000002
  21. #define DS_BYTEDUMP 0x00000004
  22. #define WT_LINEAPP 1
  23. #define WT_LINE 2
  24. #define WT_CALL 3
  25. #define WT_PHONEAPP 4
  26. #define WT_PHONE 5
  27. #define PT_DWORD 1
  28. #define PT_FLAGS 2
  29. #define PT_POINTER 3
  30. #define PT_STRING 4
  31. #define PT_CALLPARAMS 5
  32. #define PT_FORWARDLIST 6
  33. #define PT_ORDINAL 7
  34. #define FT_DWORD 1
  35. #define FT_FLAGS 2
  36. #define FT_ORD 3
  37. #define FT_SIZE 4
  38. #define FT_OFFSET 5
  39. #define MAX_STRING_PARAM_SIZE 96
  40. #define MAX_USER_BUTTONS 6
  41. #define MAX_USER_BUTTON_TEXT_SIZE 8
  42. #define MAX_LINEFORWARD_ENTRIES 5
  43. #define TABSIZE 4
  44. #if TAPI_2_0
  45. #define LAST_LINEERR LINEERR_DIALVOICEDETECT
  46. #else
  47. #define LAST_LINEERR LINEERR_NOMULTIPLEINSTANCE
  48. #endif
  49. //
  50. //
  51. //
  52. typedef LONG (WINAPI *PFN1)(ULONG_PTR);
  53. typedef LONG (WINAPI *PFN2)(ULONG_PTR, ULONG_PTR);
  54. typedef LONG (WINAPI *PFN3)(ULONG_PTR, ULONG_PTR, ULONG_PTR);
  55. typedef LONG (WINAPI *PFN4)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR);
  56. typedef LONG (WINAPI *PFN5)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  57. ULONG_PTR);
  58. typedef LONG (WINAPI *PFN6)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  59. ULONG_PTR, ULONG_PTR);
  60. typedef LONG (WINAPI *PFN7)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  61. ULONG_PTR, ULONG_PTR, ULONG_PTR);
  62. typedef LONG (WINAPI *PFN8)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  63. ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR);
  64. typedef LONG (WINAPI *PFN9)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  65. ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  66. ULONG_PTR);
  67. typedef LONG (WINAPI *PFN10)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  68. ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  69. ULONG_PTR, ULONG_PTR);
  70. typedef LONG (WINAPI *PFN12)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  71. ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR,
  72. ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR);
  73. typedef struct _MYWIDGET
  74. {
  75. DWORD dwType;
  76. struct _MYWIDGET *pNext;
  77. } MYWIDGET, *PMYWIDGET;
  78. typedef struct _MYLINEAPP
  79. {
  80. MYWIDGET Widget;
  81. HLINEAPP hLineApp;
  82. } MYLINEAPP, *PMYLINEAPP;
  83. typedef struct _MYLINE
  84. {
  85. MYWIDGET Widget;
  86. HLINE hLine;
  87. HLINEAPP hLineApp;
  88. DWORD dwDevID;
  89. DWORD dwPrivileges;
  90. DWORD dwMediaModes;
  91. DWORD dwAPIVersion;
  92. PMYLINEAPP pLineApp;
  93. } MYLINE, *PMYLINE;
  94. typedef struct _MYCALL
  95. {
  96. MYWIDGET Widget;
  97. HCALL hCall;
  98. DWORD dwCallState;
  99. LONG lMakeCallReqID;
  100. LONG lDropReqID;
  101. DWORD dwCompletionID;
  102. DWORD dwNumGatheredDigits;
  103. char *lpsGatheredDigits;
  104. PMYLINE pLine;
  105. BOOL bMonitor;
  106. } MYCALL, *PMYCALL;
  107. typedef struct _MYPHONEAPP
  108. {
  109. MYWIDGET Widget;
  110. HPHONEAPP hPhoneApp;
  111. } MYPHONEAPP, *PMYPHONEAPP;
  112. typedef struct _MYPHONE
  113. {
  114. MYWIDGET Widget;
  115. HPHONE hPhone;
  116. HPHONEAPP hPhoneApp;
  117. DWORD dwDevID;
  118. DWORD dwPrivilege;
  119. DWORD dwAPIVersion;
  120. PMYPHONEAPP pPhoneApp;
  121. } MYPHONE, *PMYPHONE;
  122. typedef struct _LOOKUP
  123. {
  124. DWORD dwVal;
  125. char lpszVal[20];
  126. } LOOKUP, *PLOOKUP;
  127. typedef enum
  128. {
  129. lAccept,
  130. #if TAPI_1_1
  131. lAddProvider,
  132. #if TAPI_2_0
  133. lAddProviderW,
  134. #endif
  135. #endif
  136. lAddToConference,
  137. #if TAPI_2_0
  138. lAgentSpecific,
  139. #endif
  140. lAnswer,
  141. lBlindTransfer,
  142. #if TAPI_2_0
  143. lBlindTransferW,
  144. #endif
  145. lClose,
  146. lCompleteCall,
  147. lCompleteTransfer,
  148. lConfigDialog,
  149. #if TAPI_2_0
  150. lConfigDialogW,
  151. #endif
  152. #if TAPI_1_1
  153. lConfigDialogEdit,
  154. #if TAPI_2_0
  155. lConfigDialogEditW,
  156. #endif
  157. lConfigProvider,
  158. #endif
  159. lDeallocateCall,
  160. lDevSpecific,
  161. lDevSpecificFeature,
  162. lDial,
  163. #if TAPI_2_0
  164. lDialW,
  165. #endif
  166. lDrop,
  167. lForward,
  168. #if TAPI_2_0
  169. lForwardW,
  170. #endif
  171. lGatherDigits,
  172. #if TAPI_2_0
  173. lGatherDigitsW,
  174. #endif
  175. lGenerateDigits,
  176. #if TAPI_2_0
  177. lGenerateDigitsW,
  178. #endif
  179. lGenerateTone,
  180. lGetAddressCaps,
  181. #if TAPI_2_0
  182. lGetAddressCapsW,
  183. #endif
  184. lGetAddressID,
  185. #if TAPI_2_0
  186. lGetAddressIDW,
  187. #endif
  188. lGetAddressStatus,
  189. #if TAPI_2_0
  190. lGetAddressStatusW,
  191. lGetAgentActivityList,
  192. lGetAgentActivityListW,
  193. lGetAgentCaps,
  194. lGetAgentGroupList,
  195. lGetAgentStatus,
  196. #endif
  197. #if TAPI_1_1
  198. lGetAppPriority,
  199. #if TAPI_2_0
  200. lGetAppPriorityW,
  201. #endif
  202. #endif
  203. lGetCallInfo,
  204. #if TAPI_2_0
  205. lGetCallInfoW,
  206. #endif
  207. lGetCallStatus,
  208. lGetConfRelatedCalls,
  209. #if TAPI_1_1
  210. lGetCountry,
  211. #if TAPI_2_0
  212. lGetCountryW,
  213. #endif
  214. #endif
  215. lGetDevCaps,
  216. #if TAPI_2_0
  217. lGetDevCapsW,
  218. #endif
  219. lGetDevConfig,
  220. #if TAPI_2_0
  221. lGetDevConfigW,
  222. #endif
  223. lGetIcon,
  224. #if TAPI_2_0
  225. lGetIconW,
  226. #endif
  227. lGetID,
  228. #if TAPI_2_0
  229. lGetIDW,
  230. #endif
  231. lGetLineDevStatus,
  232. #if TAPI_2_0
  233. lGetLineDevStatusW,
  234. lGetMessage,
  235. #endif
  236. lGetNewCalls,
  237. lGetNumRings,
  238. #if TAPI_1_1
  239. lGetProviderList,
  240. #if TAPI_2_0
  241. lGetProviderListW,
  242. #endif
  243. #endif
  244. lGetRequest,
  245. #if TAPI_2_0
  246. lGetRequestW,
  247. #endif
  248. lGetStatusMessages,
  249. lGetTranslateCaps,
  250. #if TAPI_2_0
  251. lGetTranslateCapsW,
  252. #endif
  253. lHandoff,
  254. #if TAPI_2_0
  255. lHandoffW,
  256. #endif
  257. lHold,
  258. lInitialize,
  259. #if TAPI_2_0
  260. lInitializeEx,
  261. lInitializeExW,
  262. #endif
  263. lMakeCall,
  264. #if TAPI_2_0
  265. lMakeCallW,
  266. #endif
  267. lMonitorDigits,
  268. lMonitorMedia,
  269. lMonitorTones,
  270. lNegotiateAPIVersion,
  271. lNegotiateExtVersion,
  272. lOpen,
  273. #if TAPI_2_0
  274. lOpenW,
  275. #endif
  276. lPark,
  277. #if TAPI_2_0
  278. lParkW,
  279. #endif
  280. lPickup,
  281. #if TAPI_2_0
  282. lPickupW,
  283. #endif
  284. lPrepareAddToConference,
  285. #if TAPI_2_0
  286. lPrepareAddToConferenceW,
  287. lProxyMessage,
  288. lProxyResponse,
  289. #endif
  290. lRedirect,
  291. #if TAPI_2_0
  292. lRedirectW,
  293. #endif
  294. lRegisterRequestRecipient,
  295. #if TAPI_1_1
  296. lReleaseUserUserInfo,
  297. #endif
  298. lRemoveFromConference,
  299. #if TAPI_1_1
  300. lRemoveProvider,
  301. #endif
  302. lSecureCall,
  303. lSendUserUserInfo,
  304. #if TAPI_2_0
  305. lSetAgentActivity,
  306. lSetAgentGroup,
  307. lSetAgentState,
  308. #endif
  309. #if TAPI_1_1
  310. lSetAppPriority,
  311. #if TAPI_2_0
  312. lSetAppPriorityW,
  313. #endif
  314. #endif
  315. lSetAppSpecific,
  316. #if TAPI_2_0
  317. lSetCallData,
  318. #endif
  319. lSetCallParams,
  320. lSetCallPrivilege,
  321. #if TAPI_2_0
  322. lSetCallQualityOfService,
  323. lSetCallTreatment,
  324. #endif
  325. lSetCurrentLocation,
  326. lSetDevConfig,
  327. #if TAPI_2_0
  328. lSetDevConfigW,
  329. lSetLineDevStatus,
  330. #endif
  331. lSetMediaControl,
  332. lSetMediaMode,
  333. lSetNumRings,
  334. lSetStatusMessages,
  335. lSetTerminal,
  336. lSetTollList,
  337. #if TAPI_2_0
  338. lSetTollListW,
  339. #endif
  340. lSetupConference,
  341. #if TAPI_2_0
  342. lSetupConferenceW,
  343. #endif
  344. lSetupTransfer,
  345. #if TAPI_2_0
  346. lSetupTransferW,
  347. #endif
  348. lShutdown,
  349. lSwapHold,
  350. lTranslateAddress,
  351. #if TAPI_2_0
  352. lTranslateAddressW,
  353. #endif
  354. #if TAPI_1_1
  355. lTranslateDialog,
  356. #if TAPI_2_0
  357. lTranslateDialogW,
  358. #endif
  359. #endif
  360. lUncompleteCall,
  361. lUnhold,
  362. lUnpark,
  363. #if TAPI_2_0
  364. lUnparkW,
  365. #endif
  366. #if INTERNAL_3_0
  367. mmcAddProvider,
  368. mmcConfigProvider,
  369. mmcGetAvailableProviders,
  370. mmcGetLineInfo,
  371. mmcGetLineStatus,
  372. mmcGetPhoneInfo,
  373. mmcGetPhoneStatus,
  374. mmcGetProviderList,
  375. mmcGetServerConfig,
  376. mmcInitialize,
  377. mmcRemoveProvider,
  378. mmcSetLineInfo,
  379. mmcSetPhoneInfo,
  380. mmcSetServerConfig,
  381. mmcShutdown,
  382. #endif
  383. pClose,
  384. pConfigDialog,
  385. #if TAPI_2_0
  386. pConfigDialogW,
  387. #endif
  388. pDevSpecific,
  389. pGetButtonInfo,
  390. #if TAPI_2_0
  391. pGetButtonInfoW,
  392. #endif
  393. pGetData,
  394. pGetDevCaps,
  395. #if TAPI_2_0
  396. pGetDevCapsW,
  397. #endif
  398. pGetDisplay,
  399. pGetGain,
  400. pGetHookSwitch,
  401. pGetIcon,
  402. #if TAPI_2_0
  403. pGetIconW,
  404. #endif
  405. pGetID,
  406. #if TAPI_2_0
  407. pGetIDW,
  408. #endif
  409. pGetLamp,
  410. #if TAPI_2_0
  411. pGetMessage,
  412. #endif
  413. pGetRing,
  414. pGetStatus,
  415. #if TAPI_2_0
  416. pGetStatusW,
  417. #endif
  418. pGetStatusMessages,
  419. pGetVolume,
  420. pInitialize,
  421. #if TAPI_2_0
  422. pInitializeEx,
  423. pInitializeExW,
  424. #endif
  425. pOpen,
  426. pNegotiateAPIVersion,
  427. pNegotiateExtVersion,
  428. pSetButtonInfo,
  429. #if TAPI_2_0
  430. pSetButtonInfoW,
  431. #endif
  432. pSetData,
  433. pSetDisplay,
  434. pSetGain,
  435. pSetHookSwitch,
  436. pSetLamp,
  437. pSetRing,
  438. pSetStatusMessages,
  439. pSetVolume,
  440. pShutdown,
  441. tGetLocationInfo,
  442. #if TAPI_2_0
  443. tGetLocationInfoW,
  444. #endif
  445. tRequestDrop,
  446. tRequestMakeCall,
  447. #if TAPI_2_0
  448. tRequestMakeCallW,
  449. #endif
  450. tRequestMediaCall,
  451. #if TAPI_2_0
  452. tRequestMediaCallW,
  453. #endif
  454. OpenAllLines,
  455. OpenAllPhones,
  456. CloseHandl,
  457. DumpBuffer,
  458. #if (INTERNAL_VER >= 0x20000)
  459. iNewLocationW,
  460. #endif
  461. MiscBegin,
  462. DefValues,
  463. lCallParams,
  464. lForwardList
  465. } FUNC_INDEX;
  466. typedef struct _FUNC_PARAM
  467. {
  468. char far *szName;
  469. DWORD dwType;
  470. ULONG_PTR dwValue;
  471. union
  472. {
  473. LPVOID pLookup;
  474. char far *buf;
  475. LPVOID ptr;
  476. ULONG_PTR dwDefValue;
  477. } u;
  478. } FUNC_PARAM, *PFUNC_PARAM;
  479. typedef struct _FUNC_PARAM_HEADER
  480. {
  481. DWORD dwNumParams;
  482. FUNC_INDEX FuncIndex;
  483. PFUNC_PARAM aParams;
  484. union
  485. {
  486. PFN1 pfn1;
  487. PFN2 pfn2;
  488. PFN3 pfn3;
  489. PFN4 pfn4;
  490. PFN5 pfn5;
  491. PFN6 pfn6;
  492. PFN7 pfn7;
  493. PFN8 pfn8;
  494. PFN9 pfn9;
  495. PFN10 pfn10;
  496. PFN12 pfn12;
  497. } u;
  498. } FUNC_PARAM_HEADER, *PFUNC_PARAM_HEADER;
  499. typedef struct _STRUCT_FIELD
  500. {
  501. char far *szName;
  502. DWORD dwType;
  503. DWORD dwValue;
  504. LPVOID pLookup;
  505. } STRUCT_FIELD, *PSTRUCT_FIELD;
  506. typedef struct _STRUCT_FIELD_HEADER
  507. {
  508. LPVOID pStruct;
  509. char far *szName;
  510. DWORD dwNumFields;
  511. PSTRUCT_FIELD aFields;
  512. } STRUCT_FIELD_HEADER, *PSTRUCT_FIELD_HEADER;
  513. //
  514. // Func prototypes
  515. //
  516. INT_PTR
  517. CALLBACK
  518. MainWndProc(
  519. HWND hwnd,
  520. UINT msg,
  521. WPARAM wParam,
  522. LPARAM lParam
  523. );
  524. void
  525. FAR
  526. ShowStr(
  527. LPCSTR format,
  528. ...
  529. );
  530. void
  531. ShowBytes(
  532. DWORD dwSize,
  533. LPVOID lp,
  534. DWORD dwNumTabs
  535. );
  536. VOID
  537. CALLBACK
  538. tapiCallback(
  539. DWORD hDevice,
  540. DWORD dwMsg,
  541. ULONG_PTR CallbackInstance,
  542. ULONG_PTR Param1,
  543. ULONG_PTR Param2,
  544. ULONG_PTR Param3
  545. );
  546. INT_PTR
  547. CALLBACK
  548. ParamsDlgProc(
  549. HWND hwnd,
  550. UINT msg,
  551. WPARAM wParam,
  552. LPARAM lParam
  553. );
  554. INT_PTR
  555. CALLBACK
  556. AboutDlgProc(
  557. HWND hwnd,
  558. UINT msg,
  559. WPARAM wParam,
  560. LPARAM lParam
  561. );
  562. INT_PTR
  563. CALLBACK
  564. IconDlgProc(
  565. HWND hwnd,
  566. UINT msg,
  567. WPARAM wParam,
  568. LPARAM lParam
  569. );
  570. BOOL
  571. IsLineAppSelected(
  572. void
  573. );
  574. BOOL
  575. IsLineSelected(
  576. void
  577. );
  578. BOOL
  579. IsCallSelected(
  580. void
  581. );
  582. BOOL
  583. IsTwoCallsSelected(
  584. void
  585. );
  586. BOOL
  587. IsPhoneAppSelected(
  588. void
  589. );
  590. BOOL
  591. IsPhoneSelected(
  592. void
  593. );
  594. LONG
  595. DoFunc(
  596. PFUNC_PARAM_HEADER pHeader
  597. );
  598. INT_PTR
  599. LetUserMungeParams(
  600. PFUNC_PARAM_HEADER pParamsHeader
  601. );
  602. void
  603. ShowLineFuncResult(
  604. LPSTR lpFuncName,
  605. LONG lResult
  606. );
  607. void
  608. FuncDriver(
  609. FUNC_INDEX funcIndex
  610. );
  611. void
  612. UpdateWidgetList(
  613. void
  614. );
  615. void
  616. InsertWidgetInList(
  617. PMYWIDGET pNewWidget,
  618. PMYWIDGET pWidgetInsertBefore
  619. );
  620. BOOL
  621. RemoveWidgetFromList(
  622. PMYWIDGET pWidgetToRemove
  623. );
  624. PMYLINEAPP
  625. AllocLineApp(
  626. void
  627. );
  628. PMYLINEAPP
  629. GetLineApp(
  630. HLINEAPP hLineApp
  631. );
  632. VOID
  633. FreeLineApp(
  634. PMYLINEAPP pLineApp
  635. );
  636. PMYLINE
  637. AllocLine(
  638. PMYLINEAPP pLineApp
  639. );
  640. PMYLINE
  641. GetLine(
  642. HLINE hLine
  643. );
  644. VOID
  645. FreeLine(
  646. PMYLINE pLine
  647. );
  648. PMYCALL
  649. AllocCall(
  650. PMYLINE pLine
  651. );
  652. PMYCALL
  653. GetCall(
  654. HCALL hCall
  655. );
  656. VOID
  657. FreeCall(
  658. PMYCALL pCall
  659. );
  660. VOID
  661. MoveCallToLine(
  662. PMYCALL pCall,
  663. HLINE hLine
  664. );
  665. PMYPHONEAPP
  666. AllocPhoneApp(
  667. void
  668. );
  669. PMYPHONEAPP
  670. GetPhoneApp(
  671. HPHONEAPP hPhoneApp
  672. );
  673. VOID
  674. FreePhoneApp(
  675. PMYPHONEAPP pPhoneApp
  676. );
  677. PMYPHONE
  678. AllocPhone(
  679. PMYPHONEAPP pPhoneApp
  680. );
  681. PMYPHONE
  682. GetPhone(
  683. HPHONE hPhone
  684. );
  685. VOID
  686. FreePhone(
  687. PMYPHONE pPhone
  688. );
  689. int
  690. GetWidgetIndex(
  691. PMYWIDGET pWidget
  692. );
  693. void
  694. SelectWidget(
  695. PMYWIDGET pWidget
  696. );
  697. void
  698. UpdateResults(
  699. BOOL bBegin
  700. );
  701. INT_PTR
  702. CALLBACK
  703. UserButtonsDlgProc(
  704. HWND hwnd,
  705. UINT msg,
  706. WPARAM wParam,
  707. LPARAM lParam
  708. );
  709. void
  710. ErrorAlert(
  711. void
  712. );
  713. //
  714. // Macros
  715. //
  716. #define CHK_LINEAPP_SELECTED() \
  717. if (!IsLineAppSelected()) \
  718. { \
  719. break; \
  720. }
  721. #define CHK_LINE_SELECTED() \
  722. if (!IsLineSelected()) \
  723. { \
  724. break; \
  725. }
  726. #define CHK_CALL_SELECTED() \
  727. if (!IsCallSelected()) \
  728. { \
  729. break; \
  730. }
  731. #define CHK_TWO_CALLS_SELECTED() \
  732. if (!IsTwoCallsSelected()) \
  733. { \
  734. break; \
  735. }
  736. #define CHK_PHONEAPP_SELECTED() \
  737. if (!IsPhoneAppSelected()) \
  738. { \
  739. break; \
  740. }
  741. #define CHK_PHONE_SELECTED() \
  742. if (!IsPhoneSelected()) \
  743. { \
  744. break; \
  745. }