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.

378 lines
8.3 KiB

  1. #define WF_WINNT 0x4000
  2. #define TAPI_APP_DATA_KEY 0x44415441
  3. #define GWL_APPDATA 0
  4. #define WM_ASYNCEVENT (WM_USER+111)
  5. #define NUM_TAPI32_PROCS ( THIS_MUST_BE_THE_LAST_ENTRY )
  6. typedef void (FAR PASCAL *MYPROC)();
  7. //typedef MYPROC NEAR * PMYPROC;
  8. typedef LONG (FAR PASCAL *PFNCALLPROC1)(DWORD, LPVOID, DWORD, DWORD);
  9. typedef LONG (FAR PASCAL *PFNCALLPROC2)(DWORD, DWORD, LPVOID, DWORD, DWORD);
  10. typedef LONG (FAR PASCAL *PFNCALLPROC3)(DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  11. typedef LONG (FAR PASCAL *PFNCALLPROC4)(DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  12. typedef LONG (FAR PASCAL *PFNCALLPROC5)(DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  13. typedef LONG (FAR PASCAL *PFNCALLPROC6)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  14. typedef LONG (FAR PASCAL *PFNCALLPROC7)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  15. typedef LONG (FAR PASCAL *PFNCALLPROC8)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  16. typedef LONG (FAR PASCAL *PFNCALLPROC9)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  17. typedef LONG (FAR PASCAL *PFNCALLPROC10)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  18. typedef LONG (FAR PASCAL *PFNCALLPROC11)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  19. typedef LONG (FAR PASCAL *PFNCALLPROC12)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPVOID, DWORD, DWORD);
  20. typedef struct _TAPI16_CALLBACKMSG
  21. {
  22. DWORD hDevice;
  23. DWORD dwMsg;
  24. DWORD dwCallbackInstance;
  25. DWORD dwParam1;
  26. DWORD dwParam2;
  27. DWORD dwParam3;
  28. } TAPI16_CALLBACKMSG, FAR *LPTAPI16_CALLBACKMSG;
  29. typedef struct _TAPI_APP_DATA
  30. {
  31. DWORD dwKey;
  32. HWND hwnd;
  33. LINECALLBACK lpfnCallback;
  34. BOOL bPendingAsyncEventMsg;
  35. DWORD hXxxApp;
  36. } TAPI_APP_DATA, FAR *LPTAPI_APP_DATA;
  37. typedef enum
  38. {
  39. lAccept,
  40. lAddProvider,
  41. lAddToConference,
  42. lAnswer,
  43. lBlindTransfer,
  44. lClose,
  45. lCompleteCall,
  46. lCompleteTransfer,
  47. lConfigDialog,
  48. lConfigDialogEdit,
  49. lConfigProvider,
  50. lDeallocateCall,
  51. lDevSpecific,
  52. lDevSpecificFeature,
  53. lDial,
  54. lDrop,
  55. lForward,
  56. lGatherDigits,
  57. lGenerateDigits,
  58. lGenerateTone,
  59. lGetAddressCaps,
  60. lGetAddressID,
  61. lGetAddressStatus,
  62. lGetAppPriority,
  63. lGetCallInfo,
  64. lGetCallStatus,
  65. lGetConfRelatedCalls,
  66. lGetCountry,
  67. lGetDevCaps,
  68. lGetDevConfig,
  69. lGetIcon,
  70. lGetID,
  71. lGetLineDevStatus,
  72. lGetNewCalls,
  73. lGetNumRings,
  74. lGetProviderList,
  75. lGetRequest,
  76. lGetStatusMessages,
  77. lGetTranslateCaps,
  78. lHandoff,
  79. lHold,
  80. lInitialize,
  81. lMakeCall,
  82. lMonitorDigits,
  83. lMonitorMedia,
  84. lMonitorTones,
  85. lNegotiateAPIVersion,
  86. lNegotiateExtVersion,
  87. lOpen,
  88. lPark,
  89. lPickup,
  90. lPrepareAddToConference,
  91. lRedirect,
  92. lRegisterRequestRecipient,
  93. lReleaseUserUserInfo,
  94. lRemoveFromConference,
  95. lRemoveProvider,
  96. lSecureCall,
  97. lSendUserUserInfo,
  98. lSetAppPriority,
  99. lSetAppSpecific,
  100. lSetCallParams,
  101. lSetCallPrivilege,
  102. lSetCurrentLocation,
  103. lSetDevConfig,
  104. lSetMediaControl,
  105. lSetMediaMode,
  106. lSetNumRings,
  107. lSetStatusMessages,
  108. lSetTerminal,
  109. lSetTollList,
  110. lSetupConference,
  111. lSetupTransfer,
  112. lShutdown,
  113. lSwapHold,
  114. lTranslateAddress,
  115. lTranslateDialog,
  116. lUncompleteCall,
  117. lUnhold,
  118. lUnpark,
  119. pClose,
  120. pConfigDialog,
  121. pDevSpecific,
  122. pGetButtonInfo,
  123. pGetData,
  124. pGetDevCaps,
  125. pGetDisplay,
  126. pGetGain,
  127. pGetHookSwitch,
  128. pGetID,
  129. pGetIcon,
  130. pGetLamp,
  131. pGetRing,
  132. pGetStatus,
  133. pGetStatusMessages,
  134. pGetVolume,
  135. pInitialize,
  136. pOpen,
  137. pNegotiateAPIVersion,
  138. pNegotiateExtVersion,
  139. pSetButtonInfo,
  140. pSetData,
  141. pSetDisplay,
  142. pSetGain,
  143. pSetHookSwitch,
  144. pSetLamp,
  145. pSetRing,
  146. pSetStatusMessages,
  147. pSetVolume,
  148. pShutdown,
  149. tGetLocationInfo,
  150. tRequestDrop,
  151. tRequestMakeCall,
  152. tRequestMediaCall,
  153. GetTapi16CallbkMsg,
  154. LOpenDialAsstVAL,
  155. LAddrParamsInitedVAL,
  156. lOpenInt,
  157. lShutdownInt,
  158. LocWizardDlgProc32,
  159. THIS_MUST_BE_THE_LAST_ENTRY
  160. } PROC_INDICES;
  161. char far *gaFuncNames[] =
  162. {
  163. "lineAccept",
  164. "lineAddProvider",
  165. "lineAddToConference",
  166. "lineAnswer",
  167. "lineBlindTransfer",
  168. "lineClose",
  169. "lineCompleteCall",
  170. "lineCompleteTransfer",
  171. "lineConfigDialog",
  172. "lineConfigDialogEdit",
  173. "lineConfigProvider",
  174. "lineDeallocateCall",
  175. "lineDevSpecific",
  176. "lineDevSpecificFeature",
  177. "lineDial",
  178. "lineDrop",
  179. "lineForward",
  180. "lineGatherDigits",
  181. "lineGenerateDigits",
  182. "lineGenerateTone",
  183. "lineGetAddressCaps",
  184. "lineGetAddressID",
  185. "lineGetAddressStatus",
  186. "lineGetAppPriority",
  187. "lineGetCallInfo",
  188. "lineGetCallStatus",
  189. "lineGetConfRelatedCalls",
  190. "lineGetCountry",
  191. "lineGetDevCaps",
  192. "lineGetDevConfig",
  193. "lineGetIcon",
  194. "lineGetID",
  195. "lineGetLineDevStatus",
  196. "lineGetNewCalls",
  197. "lineGetNumRings",
  198. "lineGetProviderList",
  199. "lineGetRequest",
  200. "lineGetStatusMessages",
  201. "lineGetTranslateCaps",
  202. "lineHandoff",
  203. "lineHold",
  204. "lineInitialize",
  205. "lineMakeCall",
  206. "lineMonitorDigits",
  207. "lineMonitorMedia",
  208. "lineMonitorTones",
  209. "lineNegotiateAPIVersion",
  210. "lineNegotiateExtVersion",
  211. "lineOpen",
  212. "linePark",
  213. "linePickup",
  214. "linePrepareAddToConference",
  215. "lineRedirect",
  216. "lineRegisterRequestRecipient",
  217. "lineReleaseUserUserInfo",
  218. "lineRemoveFromConference",
  219. "lineRemoveProvider",
  220. "lineSecureCall",
  221. "lineSendUserUserInfo",
  222. "lineSetAppPriority",
  223. "lineSetAppSpecific",
  224. "lineSetCallParams",
  225. "lineSetCallPrivilege",
  226. "lineSetCurrentLocation",
  227. "lineSetDevConfig",
  228. "lineSetMediaControl",
  229. "lineSetMediaMode",
  230. "lineSetNumRings",
  231. "lineSetStatusMessages",
  232. "lineSetTerminal",
  233. "lineSetTollList",
  234. "lineSetupConference",
  235. "lineSetupTransfer",
  236. "lineShutdown",
  237. "lineSwapHold",
  238. "lineTranslateAddress",
  239. "lineTranslateDialog",
  240. "lineUncompleteCall",
  241. "lineUnhold",
  242. "lineUnpark",
  243. "phoneClose",
  244. "phoneConfigDialog",
  245. "phoneDevSpecific",
  246. "phoneGetButtonInfo",
  247. "phoneGetData",
  248. "phoneGetDevCaps",
  249. "phoneGetDisplay",
  250. "phoneGetGain",
  251. "phoneGetHookSwitch",
  252. "phoneGetID",
  253. "phoneGetIcon",
  254. "phoneGetLamp",
  255. "phoneGetRing",
  256. "phoneGetStatus",
  257. "phoneGetStatusMessages",
  258. "phoneGetVolume",
  259. "phoneInitialize",
  260. "phoneOpen",
  261. "phoneNegotiateAPIVersion",
  262. "phoneNegotiateExtVersion",
  263. "phoneSetButtonInfo",
  264. "phoneSetData",
  265. "phoneSetDisplay",
  266. "phoneSetGain",
  267. "phoneSetHookSwitch",
  268. "phoneSetLamp",
  269. "phoneSetRing",
  270. "phoneSetStatusMessages",
  271. "phoneSetVolume",
  272. "phoneShutdown",
  273. "tapiGetLocationInfo",
  274. "tapiRequestDrop",
  275. "tapiRequestMakeCall",
  276. "tapiRequestMediaCall",
  277. "GetTapi16CallbackMsg",
  278. "LOpenDialAsst",
  279. "LAddrParamsInited",
  280. "lineOpenInt",
  281. "lineShutdownInt",
  282. "LocWizardDlgProc"
  283. };
  284. DWORD ghLib = 0;
  285. HINSTANCE ghInst;
  286. MYPROC gaProcs[NUM_TAPI32_PROCS];
  287. LRESULT
  288. CALLBACK
  289. Tapi16HiddenWndProc(
  290. HWND hwnd,
  291. UINT msg,
  292. WPARAM wParam,
  293. LPARAM lParam
  294. );
  295. #if CHICOBUILD
  296. DWORD
  297. FAR
  298. PASCAL
  299. LoadLibraryEx32W(
  300. LPCSTR,
  301. DWORD,
  302. DWORD
  303. );
  304. BOOL
  305. FAR
  306. PASCAL
  307. FreeLibrary32W(
  308. DWORD
  309. );
  310. DWORD
  311. FAR
  312. PASCAL
  313. GetProcAddress32W(
  314. DWORD,
  315. LPCSTR
  316. );
  317. DWORD
  318. FAR
  319. PASCAL
  320. CallProc32W(
  321. DWORD,
  322. LPVOID,
  323. DWORD,
  324. DWORD
  325. );
  326. #endif
  327. PFNCALLPROC1 pfnCallProc1 = (PFNCALLPROC1) CallProc32W;
  328. PFNCALLPROC2 pfnCallProc2 = (PFNCALLPROC2) CallProc32W;
  329. PFNCALLPROC3 pfnCallProc3 = (PFNCALLPROC3) CallProc32W;
  330. PFNCALLPROC4 pfnCallProc4 = (PFNCALLPROC4) CallProc32W;
  331. PFNCALLPROC5 pfnCallProc5 = (PFNCALLPROC5) CallProc32W;
  332. PFNCALLPROC6 pfnCallProc6 = (PFNCALLPROC6) CallProc32W;
  333. PFNCALLPROC7 pfnCallProc7 = (PFNCALLPROC7) CallProc32W;
  334. PFNCALLPROC8 pfnCallProc8 = (PFNCALLPROC8) CallProc32W;
  335. PFNCALLPROC9 pfnCallProc9 = (PFNCALLPROC9) CallProc32W;
  336. PFNCALLPROC10 pfnCallProc10 = (PFNCALLPROC10) CallProc32W;
  337. PFNCALLPROC11 pfnCallProc11 = (PFNCALLPROC11) CallProc32W;
  338. PFNCALLPROC12 pfnCallProc12 = (PFNCALLPROC12) CallProc32W;