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.

1234 lines
35 KiB

  1. CodeData equ <THUNK16BCodeData>
  2. include thkrp.inc
  3. include cbcheck.inc
  4. include thkframe.inc
  5. include public.inc
  6. include thkmacro.inc
  7. ;include struc.inc
  8. include cbcid.inc
  9. include tapicbid.inc
  10. ;externDef IsBadCodePtr:far16
  11. externDef CALLBACK_BODY_16:far16
  12. externDef Escape:far16
  13. externDef AllocCallback:far16
  14. externDef MapLS:far16
  15. externDef UnmapLS:far16
  16. ifdef DEBUG
  17. externDef _wsprintf:far16
  18. externDef OutputDebugString:far16
  19. endif
  20. externDef FreeCallback:far16
  21. externDef lineInitialize:far16
  22. externDef phoneInitialize:far16
  23. externDef lineShutdown:far16
  24. externDef phoneShutdown:far16
  25. public addrCBLineInit ;Address of callback routine passed in lineInitialize
  26. public addrCBPhoneInit ;Address of callback routine passed in phoneInitialize
  27. public cbcidTapi ;Callback ID for client returned by RegisterCBClient
  28. _DATA SEGMENT
  29. addrCBLineInit dd 0
  30. addrCBPhoneInit dd 0
  31. cbcidTapi dd 0
  32. _DATA ENDS
  33. ifdef DEBUG
  34. ;; Writes message to debug port.
  35. ;;
  36. ;; Usage:
  37. ;; DPRINT "I'm feeling buggy."
  38. ;;
  39. DPRINT macro string
  40. local mes, skip_mes
  41. jmp skip_mes
  42. mes db &string&,13,10,0
  43. skip_mes:
  44. push eax ;Save all registers not preserved by PASCAL format.
  45. push ebx
  46. push ecx
  47. push edx
  48. push cs ;Arg: OutputDebugString(lpstr)
  49. push offset mes
  50. call OutputDebugString
  51. pop edx
  52. pop ecx
  53. pop ebx
  54. pop eax
  55. endm ;DPRINT
  56. endif
  57. ;-----------------------------------------------------------------------;
  58. ; body_LINEINITIALIZE16
  59. ;-----------------------------------------------------------------------;
  60. body_LINEINITIALIZE16 macro
  61. ;LONG lineInitialize16 (LPHLINEAPP lphLineApp,
  62. ; HINSTANCE hInstance,
  63. ; LINECALLBACK lpfnCallback,
  64. ; LPCSTR lpszAppName,
  65. ; LPDWORD lpdwNumDevs)
  66. ;
  67. bp_lphLineApp equ <bp_top>
  68. bp_hInstance equ <bp_top+4>
  69. bp_lpfnCallback equ <bp_top+8>
  70. bp_lpszAppName equ <bp_top+12>
  71. bp_lpdwNumDevs equ <bp_top+16>
  72. ;
  73. bp_lpszAppNameTmp equ <dword ptr [bp-4]>
  74. bp_lpdwNumDevsTmp equ <dword ptr [bp-8]>
  75. bp_lphLineAppTmp equ <dword ptr [bp-12]>
  76. ;
  77. ; First order of business: check the code pointer. If it's
  78. ; bogus, we leave.
  79. ;
  80. ; push dword ptr bp_lpfnCallback
  81. ; call IsBadCodePtr
  82. ; or eax, eax
  83. ; jnz DoNothing
  84. sub eax, eax
  85. push eax ;bp_lpszAppNameTmp
  86. push eax ;bp_lpdwNumDevsTmp
  87. push eax ;bp_lphLineAppTmp
  88. push dword ptr bp_lphLineApp
  89. call MapLS
  90. mov bp_lphLineAppTmp, eax
  91. push eax
  92. mov eax, dword ptr bp_hInstance ; Get the hInst
  93. or eax, eax ; Is it NULL?
  94. jz @f ; Yup, and that's ok.
  95. MAP_NULL_HINST eax ; Needs to be mapped.
  96. push ax
  97. ; mov ax, seg addrCBLineInit
  98. ; mov ds, ax
  99. ; mov eax, dword ptr bp_lpfnCallback
  100. ; mov addrCBLineInit, eax
  101. ; push eax
  102. ; mov eax, cbcidTapi
  103. ; shl eax, 16
  104. ; add eax, ID_LINEINITIALIZE
  105. ; push eax
  106. ; call AllocCallback
  107. ; push dx
  108. ; push ax
  109. push dword ptr bp_lpfnCallback
  110. push dword ptr bp_lpszAppName
  111. call MapLS
  112. mov bp_lpszAppNameTmp, eax
  113. push eax
  114. push dword ptr bp_lpdwNumDevs
  115. call MapLS
  116. mov bp_lpdwNumDevsTmp, eax
  117. push eax
  118. call lineInitialize
  119. shl eax,16 ; Convert the 16bit retcode...
  120. shrd eax,edx,16 ; to a 32bit retcode.
  121. push eax ; Save the retcode for later.
  122. push dword ptr bp_lpdwNumDevsTmp
  123. call UnMapLS
  124. push dword ptr bp_lpszAppNameTmp
  125. call UnMapLS
  126. push dword ptr bp_lphLineAppTmp
  127. call UnMapLS
  128. pop eax ; Get the retcode
  129. ;DoNothing:
  130. endm
  131. ;-----------------------------------------------------------------------;
  132. ; body_PHONEINITIALIZE
  133. ;-----------------------------------------------------------------------;
  134. body_PHONEINITIALIZE16 macro
  135. ;LONG phoneInitialize (LPHPHONEAPP lphPhoneApp,
  136. ; HINSTANCE hInstance,
  137. ; PHONECALLBACK lpfnCallback,
  138. ; LPCSTR lpszAppName,
  139. ; LPDWORD lpdwNumDevs)
  140. ;
  141. bp_lphPhoneApp equ <bp_top>
  142. bp_hInstance equ <bp_top+4>
  143. bp_lpfnCallback equ <bp_top+8>
  144. bp_lpszAppName equ <bp_top+12>
  145. bp_lpdwNumDevs equ <bp_top+16>
  146. ;
  147. bp_lpszAppNameTmp equ <dword ptr [bp-4]>
  148. bp_lpdwNumDevsTmp equ <dword ptr [bp-8]>
  149. bp_lphPhoneAppTmp equ <dword ptr [bp-12]>
  150. sub eax, eax
  151. push eax ;bp_lpszAppNameTmp
  152. push eax ;bp_lpdwNumDevsTmp
  153. push eax ;bp_lphPhoneAppTmp
  154. push dword ptr bp_lphPhoneApp
  155. call MapLS
  156. mov bp_lphPhoneAppTmp, eax
  157. push eax
  158. mov eax, dword ptr bp_hInstance ; Get the hInst
  159. or eax, eax ; Is it NULL?
  160. jz @f ; Yup, and that's ok.
  161. MAP_NULL_HINST eax ; Needs to be mapped.
  162. push ax
  163. ; mov ax, seg addrCBPhoneInit
  164. ; mov ds, ax
  165. ; mov eax, dword ptr bp_lpfnCallback
  166. ; mov addrCBPhoneInit, eax
  167. ; push eax
  168. ; mov eax, cbcidTapi
  169. ; shl eax, 16
  170. ; add eax, ID_PHONEINITIALIZE
  171. ; push eax
  172. ; call AllocCallback
  173. ; push dx
  174. ; push ax
  175. push dword ptr bp_lpfnCallback
  176. push dword ptr bp_lpszAppName
  177. call MapLS
  178. mov bp_lpszAppNameTmp, eax
  179. push eax
  180. push dword ptr bp_lpdwNumDevs
  181. call MapLS
  182. mov bp_lpdwNumDevsTmp, eax
  183. push eax
  184. call phoneInitialize
  185. shl eax,16 ; Convert the 16bit retcode...
  186. shrd eax,edx,16 ; to a 32bit retcode.
  187. push eax ; Save the retcode for later.
  188. push dword ptr bp_lpdwNumDevsTmp
  189. call UnMapLS
  190. push dword ptr bp_lpszAppNameTmp
  191. call UnMapLS
  192. push dword ptr bp_lphPhoneAppTmp
  193. call UnMapLS
  194. pop eax ; Get the retcode
  195. endm
  196. ;-----------------------------------------------------------------------;
  197. ;-----------------------------------------------------------------------;
  198. ;PUSH__LINEINITIALIZE_hInstance macro iOffset, iJunk
  199. ; local Null_OK
  200. ;
  201. ; mov eax, [bp+iOffset] ;;Allow NULL to be passed here (for now)
  202. ; or eax, eax
  203. ; jz Null_OK
  204. ; MAP_NULL_HINST eax
  205. ;Null_OK:
  206. ; push ax
  207. ;
  208. ;endm ;PUSH__LINEINITIALIZE_hInstance
  209. ;
  210. ;
  211. ;-----------------------------------------------------------------------;
  212. ;-----------------------------------------------------------------------;
  213. ;PUSH__PHONEINITIALIZE_hInstance macro iOffset, iJunk
  214. ; local Null_OK
  215. ;
  216. ; mov eax, [bp+iOffset] ;;Allow NULL to be passed here (for now)
  217. ; or eax, eax
  218. ; jz Null_OK
  219. ; MAP_NULL_HINST eax
  220. ;Null_OK:
  221. ; push ax
  222. ;
  223. ;endm ;PUSH__PHONEINITIALIZE_hInstance
  224. ;
  225. ;
  226. ;;-----------------------------------------------------------------------;
  227. ;; PUSH__LINEINITIALIZE_lpfnCallback (similar to PUSH_SetAbortProc_pfnAbort)
  228. ;;-----------------------------------------------------------------------;
  229. ;PUSH__LINEINITIALIZE_lpfnCallback macro iOffset, iTempOffset
  230. ;; assume ds:DATA16
  231. ;
  232. ; mov ax, seg addrCBLineInit
  233. ; mov ds, ax
  234. ;
  235. ; mov eax, dword ptr [bp+iOffset]
  236. ; mov addrCBLineInit, eax
  237. ; push eax
  238. ; mov eax, cbcidTapi
  239. ; shl eax, 16
  240. ; add eax, ID_LINEINITIALIZE
  241. ; push eax
  242. ; call AllocCallback
  243. ; push dx
  244. ; push ax
  245. ;endm
  246. ;
  247. ;
  248. ;-----------------------------------------------------------------------;
  249. ; PUSH__PHONEINITIALIZE_lpfnCallback
  250. ;-----------------------------------------------------------------------;
  251. ;PUSH__PHONEINITIALIZE_lpfnCallback macro iOffset, iTempOffset
  252. ; assume ds:DATA16
  253. ; mov ax, seg addrCBPhoneInit
  254. ; mov ds, ax
  255. ;
  256. ; mov eax, dword ptr [bp+iOffset]
  257. ; mov addrCBPhoneInit, eax
  258. ; push eax
  259. ; mov eax, cbcidTapi
  260. ; shl eax, 16
  261. ; add eax, ID_PHONEINITIALIZE
  262. ; push eax
  263. ; call AllocCallback
  264. ; push dx
  265. ; push ax
  266. ;endm
  267. ;==============================================================================
  268. ; local macro, free resources allocated for a call-back function
  269. ; check if it is a NULL pointer before calling FreeCallBack.
  270. ; eax contains the 32-bit address of the mapped call-back function
  271. ; ecx contains the callback ID ((cbcidTapi << 16) + ID[PHONE/LINE]INITIALIZE)
  272. ;==============================================================================
  273. ;FREE_CALLBACK_TAPI macro
  274. ; local done
  275. ;
  276. ; or eax,eax
  277. ; jz done ;don't process NULL pointers
  278. ;
  279. ; push bx ;save BX
  280. ; push es ;save ES
  281. ;
  282. ; push eax ;32-bit callback address
  283. ; push ecx
  284. ; call FreeCallback
  285. ;
  286. ; pop es ;restore ES
  287. ; pop bx ;restore BX
  288. ;done:
  289. ;endm
  290. ;-----------------------------------------------------------------------;
  291. ; body_LINESHUTDOWN
  292. ; Use FREE_CALLBACK instead of directly calling FreeCallback so that we
  293. ; check for NULL pointers.
  294. ;-----------------------------------------------------------------------;
  295. body_LINESHUTDOWN16 macro
  296. bp_hLineApp equ <bp_top>
  297. ; assume ds:DATA16
  298. mov ax, seg addrCBLineInit
  299. mov ds, ax
  300. mov eax, dword ptr bp_hLineApp
  301. push eax
  302. ifdef DEBUG
  303. int 3
  304. endif
  305. call lineShutdown
  306. ; return code long --> long
  307. rol eax,16
  308. xchg ax,dx
  309. rol eax,16
  310. ; push eax ;; Save
  311. ; push ecx ;; Save
  312. ;
  313. ; mov eax, addrCBLineInit
  314. ;
  315. ; mov ecx, cbcidTapi
  316. ; shl ecx, 16
  317. ; add ecx, ID_LINEINITIALIZE
  318. ;
  319. ; FREE_CALLBACK_TAPI
  320. ;
  321. ; pop ecx
  322. ; pop eax
  323. endm
  324. ;-----------------------------------------------------------------------;
  325. ; body_PHONESHUTDOWN
  326. ;-----------------------------------------------------------------------;
  327. body_PHONESHUTDOWN16 macro
  328. bp_hLineApp equ <bp_top>
  329. ; assume ds:DATA16
  330. mov ax, seg addrCBPhoneInit
  331. mov ds, ax
  332. mov eax, dword ptr bp_hLineApp
  333. push eax
  334. call phoneShutdown
  335. ; return code long --> long
  336. rol eax,16
  337. xchg ax,dx
  338. rol eax,16
  339. ; push eax ;; Save it
  340. ; push ecx ;; Save it
  341. ;
  342. ; mov eax, addrCBPhoneInit
  343. ;
  344. ; mov ecx, cbcidTapi
  345. ; shl ecx, 16
  346. ; add ecx, ID_PHONEINITIALIZE
  347. ;
  348. ; FREE_CALLBACK_TAPI
  349. ;
  350. ; pop ecx
  351. ; pop eax
  352. endm
  353. ;-----------------------------------------------------------------------;
  354. ; body_LINEFORWARD
  355. ;-----------------------------------------------------------------------;
  356. body_LINEFORWARD macro
  357. bp_hLine equ <bp_top>
  358. bp_bAllAddresses equ <bp_top+4>
  359. bp_dwAddressID equ <bp_top+8>
  360. bp_lpForwardList equ <bp_top+12>
  361. bp_dwNumRingsNoAnswer equ <bp_top+16>
  362. bp_lphConsultCall equ <bp_top+20>
  363. bp_lpCallParams equ <bp_top+24>
  364. ;
  365. ; dword ptr [ebp+8]: hLine
  366. ; dword ptr [ebp+12]: bAllAddresses
  367. ; dword ptr [ebp+16]: dwAddressID
  368. ; dword ptr [ebp+20]: lpForwardList
  369. ; dword ptr [ebp+24]: dwNumRingsNoAnswer
  370. ; dword ptr [ebp+28]: lphConsultCall
  371. ; dword ptr [ebp+32]: lpCallParams
  372. ;
  373. bp_lpForwardListTmp equ <dword ptr [bp-4]>
  374. bp_lphConsultCallTmp equ <dword ptr [bp-8]>
  375. bp_lpCallParamsTmp equ <dword ptr [bp-12]>
  376. sub eax, eax
  377. push eax ;bp_lpForwardListTmp
  378. push eax ;bp_lphConsultCallTmp
  379. push eax ;bp_lpCallParams
  380. push dword ptr bp_hLine ;hLine: dword->dword
  381. push dword ptr bp_bAllAddresses ;bAllAddresses: dword->dword
  382. push dword ptr bp_dwAddressID ;dwAddressID: dword->dword
  383. push dword ptr bp_lpForwardList
  384. call MapLS
  385. mov bp_lpForwardListTmp, eax
  386. push eax
  387. push dword ptr bp_dwNumRingsNoAnswer ;dwNumRingsNoAnswer: dword->dword
  388. push dword ptr bp_lphConsultCall
  389. call MapLS
  390. mov bp_lphConsultCallTmp, eax
  391. push eax
  392. push dword ptr bp_lpCallParams
  393. call MapLS
  394. mov bp_lpCallParamsTmp, eax
  395. push eax
  396. call lineForward
  397. shl eax,16
  398. shrd eax,edx,16
  399. push eax
  400. push dword ptr bp_lpForwardListTmp
  401. call UnMapLS
  402. ;
  403. ; Don't UnMap lphConsultCallTmp: Done in tapi.dll due to async read/write.
  404. ;
  405. ; push dword ptr bp_lphConsultCallTmp
  406. ; call UnMapLS
  407. push dword ptr bp_lpCallParamsTmp
  408. call UnMapLS
  409. pop eax
  410. endm
  411. ;-----------------------------------------------------------------------;
  412. ; body_LINEMAKECALL
  413. ;-----------------------------------------------------------------------;
  414. body_LINEMAKECALL macro
  415. bp_hLine equ <bp_top>
  416. bp_lphCall equ <bp_top+4>
  417. bp_lpszDestAddress equ <bp_top+8>
  418. bp_dwCountryCode equ <bp_top+12>
  419. bp_lpCallParams equ <bp_top+16>
  420. ;
  421. ; dword ptr [ebp+8]: hLine
  422. ; dword ptr [ebp+12]: lphCall
  423. ; dword ptr [ebp+16]: lpszDestAddress
  424. ; dword ptr [ebp+20]: dwCountryCode
  425. ; dword ptr [ebp+24]: lpCallParams
  426. ;
  427. bp_lphCallTmp equ <dword ptr [bp-4]>
  428. bp_lpszDestAddressTmp equ <dword ptr [bp-8]>
  429. bp_lpCallParamsTmp equ <dword ptr [bp-12]>
  430. sub eax, eax
  431. push eax ;bp_lphCallTmp
  432. push eax ;bp_lpszDestAddress
  433. push eax ;bp_lpCallParams
  434. push dword ptr bp_hLine ;hLine: dword->dword
  435. push dword ptr bp_lphCall
  436. call MapLS
  437. mov bp_lphCallTmp, eax
  438. push eax
  439. push dword ptr bp_lpszDestAddress
  440. call MapLS
  441. mov bp_lpszDestAddressTmp, eax
  442. push eax
  443. push dword ptr bp_dwCountryCode ;dwCountryCode: dword->dword
  444. push dword ptr bp_lpCallParams
  445. call MapLS
  446. mov bp_lpCallParamsTmp, eax
  447. push eax
  448. call lineMakeCall
  449. shl eax,16
  450. shrd eax,edx,16
  451. push eax
  452. ;
  453. ; Don't UnMap lphCallTmp: Done in tapi.dll due to async read/write.
  454. ;
  455. ; push dword ptr bp_lphCallTmp
  456. ; call UnMapLS
  457. push dword ptr bp_lpszDestAddressTmp
  458. call UnMapLS
  459. push dword ptr bp_lpCallParamsTmp
  460. call UnMapLS
  461. pop eax
  462. endm
  463. ;-----------------------------------------------------------------------;
  464. ; body_LINEUNPARK
  465. ;-----------------------------------------------------------------------;
  466. body_LINEUNPARK macro
  467. bp_hLine equ <bp_top>
  468. bp_dwAddressID equ <bp_top+4>
  469. bp_lphCall equ <bp_top+8>
  470. bp_lpszDestAddress equ <bp_top+12>
  471. ;
  472. ; dword ptr [ebp+8]: hLine
  473. ; dword ptr [ebp+12]: dwAddressID
  474. ; dword ptr [ebp+16]: lphCall
  475. ; dword ptr [ebp+20]: lpszDestAddress
  476. ;
  477. bp_lphCallTmp equ <dword ptr [bp-4]>
  478. bp_lpszDestAddressTmp equ <dword ptr [bp-8]>
  479. sub eax, eax
  480. push eax ;bp_lphCallTmp
  481. push eax ;bp_lpszDestAddress
  482. push dword ptr bp_hLine ;hLine: dword->dword
  483. push dword ptr bp_dwCountryCode ;dwCountryCode: dword->dword
  484. push dword ptr bp_lphCall
  485. call MapLS
  486. mov bp_lphCallTmp, eax
  487. push eax
  488. push dword ptr bp_lpszDestAddress
  489. call MapLS
  490. mov bp_lpszDestAddressTmp, eax
  491. push eax
  492. call lineUnpark
  493. shl eax,16
  494. shrd eax,edx,16
  495. push eax
  496. ;
  497. ; Don't UnMap lphCallTmp: Done in tapi.dll due to async read/write.
  498. ;
  499. ; push dword ptr bp_lphCallTmp
  500. ; call UnMapLS
  501. push dword ptr bp_lpszDestAddressTmp
  502. call UnMapLS
  503. pop eax
  504. endm
  505. ;-----------------------------------------------------------------------;
  506. ; body_LINEPICKUP
  507. ;-----------------------------------------------------------------------;
  508. body_LINEPICKUP macro
  509. bp_hLine equ <bp_top>
  510. bp_dwAddressID equ <bp_top+4>
  511. bp_lphCall equ <bp_top+8>
  512. bp_lpszDestAddress equ <bp_top+12>
  513. bp_lpszGroupID equ <bp_top+16>
  514. ;
  515. ; dword ptr [ebp+8]: hLine
  516. ; dword ptr [ebp+12]: dwAddressID
  517. ; dword ptr [ebp+16]: lphCall
  518. ; dword ptr [ebp+20]: lpszDestAddress
  519. ; dword ptr [ebp+24]: lpszGroupID
  520. ;
  521. bp_lphCallTmp equ <dword ptr [bp-4]>
  522. bp_lpszDestAddressTmp equ <dword ptr [bp-8]>
  523. bp_lpszGroupIDTmp equ <dword ptr [bp-12]>
  524. sub eax, eax
  525. push eax ;bp_lphCallTmp
  526. push eax ;bp_lpszDestAddressTmp
  527. push eax ;bp_lpszGroupIDTmp
  528. push dword ptr bp_hLine ;hLine: dword->dword
  529. push dword ptr bp_dwAddressID ;dwAddressID: dword->dword
  530. push dword ptr bp_lphCall
  531. call MapLS
  532. mov bp_lphCallTmp, eax
  533. push eax
  534. push dword ptr bp_lpszDestAddress
  535. call MapLS
  536. mov bp_lpszDestAddressTmp, eax
  537. push eax
  538. push dword ptr bp_lpszGroupID
  539. call MapLS
  540. mov bp_lpszGroupIDTmp, eax
  541. push eax
  542. call linePickup
  543. shl eax,16
  544. shrd eax,edx,16
  545. push eax
  546. ;
  547. ; Don't UnMap lphCallTmp: Done in tapi.dll due to async read/write.
  548. ;
  549. ; push dword ptr bp_lphCallTmp
  550. ; call UnMapLS
  551. push dword ptr bp_lpszDestAddressTmp
  552. call UnMapLS
  553. push dword ptr bp_lpszGroupIDTmp
  554. call UnMapLS
  555. pop eax
  556. endm
  557. ;-----------------------------------------------------------------------;
  558. ; body_LINESETUPCONFERENCE
  559. ;-----------------------------------------------------------------------;
  560. body_LINESETUPCONFERENCE macro
  561. bp_hCall equ <bp_top>
  562. bp_hLine equ <bp_top+4>
  563. bp_lphConfCall equ <bp_top+8>
  564. bp_lphConsultCall equ <bp_top+12>
  565. bp_dwNumParties equ <bp_top+16>
  566. bp_lpCallParams equ <bp_top+20>
  567. ;
  568. ; dword ptr [ebp+8]: hCall
  569. ; dword ptr [ebp+12]: hLine
  570. ; dword ptr [ebp+16]: lphConfCall
  571. ; dword ptr [ebp+20]: lphConsultCall
  572. ; dword ptr [ebp+24]: dwNumParties
  573. ; dword ptr [ebp+28]: lpCallParams
  574. ;
  575. bp_lphConfCallTmp equ <dword ptr [bp-4]>
  576. bp_lphConsultCallTmp equ <dword ptr [bp-8]>
  577. bp_lpCallParamsTmp equ <dword ptr [bp-12]>
  578. sub eax, eax
  579. push eax ;bp_lphConfCallTmp
  580. push eax ;bp_lphConsultCallTmp
  581. push eax ;bp_lpCallParamsTmp
  582. push dword ptr bp_hCall ;hCall: dword->dword
  583. push dword ptr bp_hLine ;hLine: dword->dword
  584. push dword ptr bp_lphConfCall
  585. call MapLS
  586. mov bp_lphConfCallTmp, eax
  587. push eax
  588. push dword ptr bp_lphConsultCall
  589. call MapLS
  590. mov bp_lphConsultCallTmp, eax
  591. push eax
  592. push dword ptr bp_dwNumParties ;dwNumParties: dword->dword
  593. push dword ptr bp_lpCallParams
  594. call MapLS
  595. mov bp_lpCallParamsTmp, eax
  596. push eax
  597. call lineSetupConference
  598. shl eax,16
  599. shrd eax,edx,16
  600. push eax
  601. ;
  602. ; Don't UnMap lphConfCallTmp and lphConsultCallTmp: Done in tapi.dll
  603. ; due to async read/write.
  604. ;
  605. ; push dword ptr bp_lphConfCallTmp
  606. ; call UnMapLS
  607. ; push dword ptr bp_lphConsultCallTmp
  608. ; call UnMapLS
  609. push dword ptr bp_lpCallParamsTmp
  610. call UnMapLS
  611. pop eax
  612. endm
  613. ;-----------------------------------------------------------------------;
  614. ; body_LINECOMPLETETRANSFER
  615. ;-----------------------------------------------------------------------;
  616. body_LINECOMPLETETRANSFER macro
  617. bp_hCall equ <bp_top>
  618. bp_hConsultCall equ <bp_top+4>
  619. bp_lphConfCall equ <bp_top+8>
  620. bp_dwTransferMode equ <bp_top+12>
  621. ;
  622. ; dword ptr [ebp+8]: hCall
  623. ; dword ptr [ebp+12]: hConsultCall
  624. ; dword ptr [ebp+16]: lphConfCall
  625. ; dword ptr [ebp+20]: dwTransferMode
  626. ;
  627. bp_lphConfCallTmp equ <dword ptr [bp-4]>
  628. sub eax, eax
  629. push eax ;bp_lphConfCallTmp
  630. push dword ptr bp_hCall ;hCall: dword->dword
  631. push dword ptr bp_hConsultCall ;hConsultCall: dword->dword
  632. push dword ptr bp_lphConfCall
  633. call MapLS
  634. mov bp_lphConfCallTmp, eax
  635. push eax
  636. push dword ptr bp_dwTransferMode ;dwTransferMode: dword->dword
  637. call lineCompleteTransfer
  638. shl eax,16
  639. shrd eax,edx,16
  640. ; push eax
  641. ;
  642. ; Don't UnMap lphConfCallTmp: Done in tapi.dll due to async read/write.
  643. ;
  644. ; push dword ptr bp_lphConfCallTmp
  645. ; call UnMapLS
  646. ; pop eax
  647. endm
  648. ;-----------------------------------------------------------------------;
  649. ; body_LINEPREPAREADDTOCONFERENCE
  650. ;-----------------------------------------------------------------------;
  651. body_LINEPREPAREADDTOCONFERENCE macro
  652. bp_hConfCall equ <bp_top>
  653. bp_lphAddCall equ <bp_top+4>
  654. bp_lpCallParams equ <bp_top+8>
  655. ;
  656. ; dword ptr [ebp+8]: hConfCall
  657. ; dword ptr [ebp+12]: lphAddCall
  658. ; dword ptr [ebp+16]: lpCallParams
  659. ;
  660. bp_lphAddCallTmp equ <dword ptr [bp-4]>
  661. bp_lpCallParamsTmp equ <dword ptr [bp-8]>
  662. sub eax, eax
  663. push eax ;bp_lphAddCallTmp
  664. push eax ;bp_lpCallParams
  665. push dword ptr bp_hConfCall ;hConfCall: dword->dword
  666. push dword ptr bp_lphAddCall
  667. call MapLS
  668. mov bp_lphAddCallTmp, eax
  669. push eax
  670. push dword ptr bp_lpCallParams
  671. call MapLS
  672. mov bp_lpCallParamsTmp, eax
  673. push eax
  674. call linePrepareAddToConference
  675. shl eax,16
  676. shrd eax,edx,16
  677. push eax ; Save it
  678. ;
  679. ; Don't UnMap lphAddCallTmp: Done in tapi.dll due to async read/write.
  680. ;
  681. ; push dword ptr bp_lphAddCallTmp
  682. ; call UnMapLS
  683. push dword ptr bp_lpCallParamsTmp
  684. call UnMapLS
  685. pop eax
  686. endm
  687. ;-----------------------------------------------------------------------;
  688. ; body_LINESETUPTRANSFER
  689. ;-----------------------------------------------------------------------;
  690. body_LINESETUPTRANSFER macro
  691. bp_hCall equ <bp_top>
  692. bp_lphConsultCall equ <bp_top+4>
  693. bp_lpCallParams equ <bp_top+8>
  694. ;
  695. ; dword ptr [ebp+8]: hCall
  696. ; dword ptr [ebp+12]: lphConsultCall
  697. ; dword ptr [ebp+16]: lpCallParams
  698. ;
  699. bp_lphConsultCallTmp equ <dword ptr [bp-4]>
  700. bp_lpCallParamsTmp equ <dword ptr [bp-8]>
  701. sub eax, eax
  702. push eax ;bp_lphConsultCallTmp
  703. push eax ;bp_lpCallParams
  704. push dword ptr bp_hCall ;hCall: dword->dword
  705. push dword ptr bp_lphConsultCall
  706. call MapLS
  707. mov bp_lphConsultCallTmp, eax
  708. push eax
  709. push dword ptr bp_lpCallParams
  710. call MapLS
  711. mov bp_lpCallParamsTmp, eax
  712. push eax
  713. call lineSetupTransfer
  714. shl eax,16
  715. shrd eax,edx,16
  716. push eax ; Save it
  717. ;
  718. ; Don't UnMap lphConsultCallTmp: Done in tapi.dll due to async read/write.
  719. ;
  720. ; push dword ptr bp_lphConsultCallTmp
  721. ; call UnMapLS
  722. push dword ptr bp_lpCallParamsTmp
  723. call UnMapLS
  724. pop eax
  725. endm
  726. ;-----------------------------------------------------------------------;
  727. ; body_LINECOMPLETECALL
  728. ;-----------------------------------------------------------------------;
  729. body_LINECOMPLETECALL macro
  730. bp_hCall equ <bp_top>
  731. bp_lpdwCompletionID equ <bp_top+4>
  732. bp_dwCompletionMode equ <bp_top+8>
  733. bp_dwMessageID equ <bp_top+12>
  734. ;
  735. ; dword ptr [ebp+8]: hCall
  736. ; dword ptr [ebp+12]: lpdwCompletionID
  737. ; dword ptr [ebp+16]: dwCompletionMode
  738. ; dword ptr [ebp+20]: dwMessageID
  739. ;
  740. bp_lpdwCompletionIDTmp equ <dword ptr [bp-4]>
  741. sub eax, eax
  742. push eax ;bp_lpdwCompletionID
  743. push dword ptr bp_hCall ;hCall: dword->dword
  744. push dword ptr bp_lpdwCompletionID
  745. call MapLS
  746. mov bp_lpdwCompletionIDTmp, eax
  747. push eax
  748. push dword ptr bp_dwCompletionMode
  749. push dword ptr bp_dwMessageID
  750. call lineCompleteCall
  751. shl eax,16
  752. shrd eax,edx,16
  753. ; push eax
  754. ;
  755. ; Don't UnMap lpdwCompletionIDTmp: Done in tapi.dll due to async read/write.
  756. ;
  757. ; push dword ptr bp_lpdwCompletionIDTmp
  758. ; call UnMapLS
  759. ; pop eax
  760. endm
  761. ;-----------------------------------------------------------------------;
  762. ; body_LINEDEVSPECIFIC
  763. ;-----------------------------------------------------------------------;
  764. body_LINEDEVSPECIFIC macro
  765. bp_hLine equ <bp_top>
  766. bp_dwAddressID equ <bp_top+4>
  767. bp_hCall equ <bp_top+8>
  768. bp_lpParams equ <bp_top+12>
  769. bp_dwSize equ <bp_top+16>
  770. ;
  771. ; dword ptr [ebp+8]: hLine
  772. ; dword ptr [ebp+12]: dwAddressID
  773. ; dword ptr [ebp+16]: hCall
  774. ; dword ptr [ebp+20]: lpParams
  775. ; dword ptr [ebp+24]: dwSize
  776. ;
  777. bp_lpParamsTmp equ <dword ptr [bp-4]>
  778. sub eax, eax
  779. push eax ;bp_lpParams
  780. push dword ptr bp_hLine ;hLine: dword->dword
  781. push dword ptr bp_dwAddressID ;dwAddressID: dword->dword
  782. push dword ptr bp_hCall ;hCall: dword->dword
  783. push dword ptr bp_lpParams
  784. call MapLS
  785. mov bp_lpParamsTmp, eax
  786. push eax
  787. push dword ptr bp_dwSize ;dwSize: dword->dword
  788. call lineDevSpecific
  789. shl eax,16
  790. shrd eax,edx,16
  791. ; push eax
  792. ;
  793. ; Don't UnMap lpParams: Done in tapi.dll due to async read/write.
  794. ;
  795. ; push dword ptr bp_lpParamsTmp
  796. ; call UnMapLS
  797. ; pop eax
  798. endm
  799. ;-----------------------------------------------------------------------;
  800. ; body_PHONEDEVSPECIFIC
  801. ;-----------------------------------------------------------------------;
  802. body_PHONEDEVSPECIFIC macro
  803. bp_hPhone equ <bp_top>
  804. bp_lpParams equ <bp_top+4>
  805. bp_dwSize equ <bp_top+8>
  806. ;
  807. ; dword ptr [ebp+8]: hPhone
  808. ; dword ptr [ebp+12]: lpParams
  809. ; dword ptr [ebp+16]: dwSize
  810. ;
  811. ;bp_lpParamsTmp equ <dword ptr [bp-4]>
  812. ;
  813. sub eax, eax
  814. push eax ;bp_lpParams
  815. push dword ptr bp_hPhone ;hPhone: dword->dword
  816. push dword ptr bp_lpParams
  817. call MapLS
  818. mov bp_lpParamsTmp, eax
  819. push eax
  820. push dword ptr bp_dwSize ;dwSize: dword->dword
  821. call phoneDevSpecific
  822. shl eax,16
  823. shrd eax,edx,16
  824. ; push eax
  825. ;
  826. ; Don't UnMap lpParams: Done in tapi.dll due to async read/write.
  827. ;
  828. ; push dword ptr bp_lpParamsTmp
  829. ; call UnMapLS
  830. ; pop eax
  831. endm
  832. ;-----------------------------------------------------------------------;
  833. ; body_LINEDEVSPECIFICFEATURE
  834. ;-----------------------------------------------------------------------;
  835. body_LINEDEVSPECIFICFEATURE macro
  836. bp_hLine equ <bp_top>
  837. bp_dwFeature equ <bp_top+4>
  838. bp_lpParams equ <bp_top+8>
  839. bp_dwSize equ <bp_top+12>
  840. ;
  841. ; dword ptr [ebp+8]: hLine
  842. ; dword ptr [ebp+12]: dwFeature
  843. ; dword ptr [ebp+16]: lpParams
  844. ; dword ptr [ebp+20]: dwSize
  845. ;
  846. bp_lpParamsTmp equ <dword ptr [bp-4]>
  847. sub eax, eax
  848. push eax ;bp_lpParams
  849. push dword ptr bp_hLine ;hLine: dword->dword
  850. push dword ptr bp_dwFeature ;dwFeature: dword->dword
  851. push dword ptr bp_lpParams
  852. call MapLS
  853. mov bp_lpParamsTmp, eax
  854. push eax
  855. push dword ptr bp_dwSize ;dwSize: dword->dword
  856. call lineDevSpecificFeature
  857. shl eax,16
  858. shrd eax,edx,16
  859. ; push eax
  860. ;
  861. ; Don't UnMap lpParams: Done in tapi.dll due to async read/write.
  862. ;
  863. ; push dword ptr bp_lpParamsTmp
  864. ; call UnMapLS
  865. ; pop eax
  866. endm
  867. ;-----------------------------------------------------------------------;
  868. ; body_LINEGATHERDIGITS
  869. ;-----------------------------------------------------------------------;
  870. body_LINEGATHERDIGITS macro
  871. bp_hCall equ <bp_top>
  872. bp_dwDigitModes equ <bp_top+4>
  873. bp_lpsDigits equ <bp_top+8>
  874. bp_dwNumDigits equ <bp_top+12>
  875. bp_lpszTermDigits equ <bp_top+16>
  876. bp_dwFirstDigitTimeout equ <bp_top+20>
  877. bp_dwInterDigitTimeout equ <bp_top+24>
  878. ;
  879. ; dword ptr [ebp+8]: hCall
  880. ; dword ptr [ebp+12]: dwDigitModes
  881. ; dword ptr [ebp+16]: lpsDigits
  882. ; dword ptr [ebp+20]: dwNumDigits
  883. ; dword ptr [ebp+24]: lpszTerminationDigits
  884. ; dword ptr [ebp+28]: dwFirstDigitTimeout
  885. ; dword ptr [ebp+32]: dwInterDigitTimeout
  886. ;
  887. bp_lpsDigitsTmp equ <dword ptr [bp-4]>
  888. bp_lpszTermDigitsTmp equ <dword ptr [bp-8]>
  889. sub eax, eax
  890. push eax ;bp_lpsDigitsTmp
  891. push eax ;bp_lpszTerminationDigitsTmp
  892. push dword ptr bp_hCall ;hCall: dword->dword
  893. push dword ptr bp_dwDigitModes ;dwDigitModes: dword->dword
  894. push dword ptr bp_lpsDigits
  895. call MapLS
  896. mov bp_lpsDigitsTmp, eax
  897. push eax
  898. push dword ptr bp_dwNumDigits ;dwNumDigits: dword->dword
  899. push dword ptr bp_lpszTermDigits
  900. call MapLS
  901. mov bp_lpszTermDigitsTmp, eax
  902. push eax
  903. push dword ptr bp_dwFirstDigitTimeout ;dwFirstDigitTimeout: dword->dword
  904. push dword ptr bp_dwInterDigitTimeout ;dwInterDigitTimeout: dword->dword
  905. call lineGatherDigits
  906. shl eax,16
  907. shrd eax,edx,16
  908. push eax ; Save it
  909. ;
  910. ; Don't UnMap lpsDigits: Done in tapi.dll due to async read/write.
  911. ;
  912. ; push dword ptr bp_lpsDigitsTmp
  913. ; call UnMapLS
  914. push dword ptr bp_lpszTermDigitsTmp
  915. call UnMapLS
  916. pop eax
  917. endm
  918. ;-----------------------------------------------------------------------;
  919. ; body_LINEPARK
  920. ;-----------------------------------------------------------------------;
  921. body_LINEPARK macro
  922. bp_hLine equ <bp_top>
  923. bp_dwParkMode equ <bp_top+4>
  924. bp_lpszDirAddress equ <bp_top+8>
  925. bp_lpNonDirAddress equ <bp_top+12>
  926. ;
  927. ; dword ptr [ebp+8]: hLine
  928. ; dword ptr [ebp+12]: dwParkMode
  929. ; dword ptr [ebp+16]: lpszDirAddress
  930. ; dword ptr [ebp+20]: lpNonDirAddress
  931. ;
  932. bp_lpszDirAddressTmp equ <dword ptr [bp-4]>
  933. bp_lpNonDirAddressTmp equ <dword ptr [bp-8]>
  934. sub eax, eax
  935. push eax ;bp_lpszDirAddressTmp
  936. push eax ;bp_lpNonDirAddressTmp
  937. push dword ptr bp_hLine ;hLine: dword->dword
  938. push dword ptr bp_dwParkMode ;dwParkMode: dworkd->dword
  939. push dword ptr bp_lpszDirAddress
  940. call MapLS
  941. mov bp_lpszDirAddressTmp, eax
  942. push eax
  943. push dword ptr bp_lpNonDirAddress
  944. call MapLS
  945. mov bp_lpNonDirAddressTmp, eax
  946. push eax
  947. call linePark
  948. shl eax,16
  949. shrd eax,edx,16
  950. push eax ; Save it
  951. push dword ptr bp_lpszDirAddressTmp
  952. call UnMapLS
  953. ;
  954. ; Don't UnMap lpNonDirAddressTmp: Done in tapi.dll due to async read/write.
  955. ;
  956. ; push dword ptr bp_lpNonDirAddressTmp
  957. ; call UnMapLS
  958. pop eax
  959. endm
  960. ;-----------------------------------------------------------------------;
  961. ; body_TAPIREQUESTMEDIACALL
  962. ;-----------------------------------------------------------------------;
  963. body_TAPIREQUESTMEDIACALL macro
  964. mov eax, -16
  965. endm
  966. ;-----------------------------------------------------------------------;
  967. ; body_TAPIREQUESTDROP
  968. ;-----------------------------------------------------------------------;
  969. body_TAPIREQUESTDROP macro
  970. mov eax, -16
  971. endm
  972. ;-----------------------------------------------------------------------;
  973. ; body_LINEREGISTERREQUESTRECIPIENT
  974. ;-----------------------------------------------------------------------;
  975. body_LINEREGISTERREQUESTRECIPIENT macro
  976. bp_hLine equ <bp_top>
  977. bp_dwRegistrationInstance equ <bp_top+4>
  978. bp_dwRequestMode equ <bp_top+8>
  979. bp_dwEnable equ <bp_top+12>
  980. ;
  981. ; dword ptr [ebp+8]: hLine
  982. ; dword ptr [ebp+12]: dwRegistrationInstance
  983. ; dword ptr [ebp+16]: dwRequestMode
  984. ; dword ptr [ebp+20]: bEnable
  985. ;
  986. ;
  987. ; sub eax, eax
  988. ; push eax ;bp_lpszDirAddressTmp
  989. ; push eax ;bp_lpNonDirAddressTmp
  990. ;
  991. ;
  992. ; If this is a 32bit app asking to register for media calls, tell 'em
  993. ; 'e's nuts.
  994. ;
  995. test dword ptr bp_dwRequestMode, 2 ;*** *** ***Or should this be 6?
  996. jz @f
  997. ifdef DEBUG
  998. DPRINT "32bit apps aren't allowed to register for Media calls"
  999. endif
  1000. mov eax, 80000038h
  1001. jmp Done_LRRR
  1002. @@:
  1003. push dword ptr bp_hLine ;hLine: dword->dword
  1004. push dword ptr bp_dwRegistrationInstance
  1005. push dword ptr bp_dwRequestMode
  1006. push dword ptr bp_dwEnable
  1007. call lineRegisterRequestRecipient
  1008. shl eax,16
  1009. shrd eax,edx,16
  1010. Done_LRRR:
  1011. endm