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.

525 lines
11 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Fri Jun 21 14:07:10 1996
  4. ;Command Line: ..\..\..\..\dev\tools\binr\thunk.exe -NC _TEXT ..\wizthk.thk
  5. TITLE $..\wizthk.asm
  6. .386
  7. OPTION READONLY
  8. OPTION OLDSTRUCTS
  9. IFNDEF IS_16
  10. IFNDEF IS_32
  11. %out command line error: specify one of -DIS_16, -DIS_32
  12. .err
  13. ENDIF ;IS_32
  14. ENDIF ;IS_16
  15. IFDEF IS_32
  16. IFDEF IS_16
  17. %out command line error: you can't specify both -DIS_16 and -DIS_32
  18. .err
  19. ENDIF ;IS_16
  20. ;************************* START OF 32-BIT CODE *************************
  21. .model FLAT,STDCALL
  22. ;-- Import common flat thunk routines (in k32)
  23. externDef AllocMappedBuffer :near32
  24. externDef FreeMappedBuffer :near32
  25. externDef MapHInstLS :near32
  26. externDef MapHInstLS_PN :near32
  27. externDef MapHInstSL :near32
  28. externDef MapHInstSL_PN :near32
  29. externDef FT_Prolog :near32
  30. externDef FT_Thunk :near32
  31. externDef QT_Thunk :near32
  32. externDef FT_Exit0 :near32
  33. externDef FT_Exit4 :near32
  34. externDef FT_Exit8 :near32
  35. externDef FT_Exit12 :near32
  36. externDef FT_Exit16 :near32
  37. externDef FT_Exit20 :near32
  38. externDef FT_Exit24 :near32
  39. externDef FT_Exit28 :near32
  40. externDef FT_Exit32 :near32
  41. externDef FT_Exit36 :near32
  42. externDef FT_Exit40 :near32
  43. externDef FT_Exit44 :near32
  44. externDef FT_Exit48 :near32
  45. externDef FT_Exit52 :near32
  46. externDef FT_Exit56 :near32
  47. externDef SMapLS :near32
  48. externDef SUnMapLS :near32
  49. externDef SMapLS_IP_EBP_8 :near32
  50. externDef SUnMapLS_IP_EBP_8 :near32
  51. externDef SMapLS_IP_EBP_12 :near32
  52. externDef SUnMapLS_IP_EBP_12 :near32
  53. externDef SMapLS_IP_EBP_16 :near32
  54. externDef SUnMapLS_IP_EBP_16 :near32
  55. externDef SMapLS_IP_EBP_20 :near32
  56. externDef SUnMapLS_IP_EBP_20 :near32
  57. externDef SMapLS_IP_EBP_24 :near32
  58. externDef SUnMapLS_IP_EBP_24 :near32
  59. externDef SMapLS_IP_EBP_28 :near32
  60. externDef SUnMapLS_IP_EBP_28 :near32
  61. externDef SMapLS_IP_EBP_32 :near32
  62. externDef SUnMapLS_IP_EBP_32 :near32
  63. externDef SMapLS_IP_EBP_36 :near32
  64. externDef SUnMapLS_IP_EBP_36 :near32
  65. externDef SMapLS_IP_EBP_40 :near32
  66. externDef SUnMapLS_IP_EBP_40 :near32
  67. MapLS PROTO NEAR STDCALL :DWORD
  68. UnMapLS PROTO NEAR STDCALL :DWORD
  69. MapSL PROTO NEAR STDCALL p32:DWORD
  70. ;***************** START OF KERNEL32-ONLY SECTION ******************
  71. ; Hacks for kernel32 initialization.
  72. IFDEF FT_DEFINEFTCOMMONROUTINES
  73. .data
  74. public FT_wizthkTargetTable ;Flat address of target table in 16-bit module.
  75. public FT_wizthkChecksum32
  76. FT_wizthkChecksum32 dd 010e07h
  77. ENDIF ;FT_DEFINEFTCOMMONROUTINES
  78. ;***************** END OF KERNEL32-ONLY SECTION ******************
  79. .code
  80. ;************************* COMMON PER-MODULE ROUTINES *************************
  81. .data
  82. public wizthk_ThunkData32 ;This symbol must be exported.
  83. wizthk_ThunkData32 label dword
  84. dd 3130534ch ;Protocol 'LS01'
  85. dd 010e07h ;Checksum
  86. dd 0 ;Jump table address.
  87. dd 3130424ch ;'LB01'
  88. dd 0 ;Flags
  89. dd 0 ;Reserved (MUST BE 0)
  90. dd 0 ;Reserved (MUST BE 0)
  91. dd offset QT_Thunk_wizthk - offset wizthk_ThunkData32
  92. dd offset FT_Prolog_wizthk - offset wizthk_ThunkData32
  93. .code
  94. externDef ThunkConnect32@24:near32
  95. public wizthk_ThunkConnect32@16
  96. wizthk_ThunkConnect32@16:
  97. pop edx
  98. push offset wizthk_ThkData16
  99. push offset wizthk_ThunkData32
  100. push edx
  101. jmp ThunkConnect32@24
  102. wizthk_ThkData16 label byte
  103. db "wizthk_ThunkData16",0
  104. pfnQT_Thunk_wizthk dd offset QT_Thunk_wizthk
  105. pfnFT_Prolog_wizthk dd offset FT_Prolog_wizthk
  106. .data
  107. QT_Thunk_wizthk label byte
  108. db 32 dup(0cch) ;Patch space.
  109. FT_Prolog_wizthk label byte
  110. db 32 dup(0cch) ;Patch space.
  111. .code
  112. ebp_top equ <[ebp + 8]> ;First api parameter
  113. ebp_retval equ <[ebp + -64]> ;Api return value
  114. FT_ESPFIXUP macro dwSpOffset
  115. or dword ptr [ebp + -20], 1 SHL ((dwSpOffset) SHR 1)
  116. endm
  117. ebp_qttop equ <[ebp + 8]>
  118. include fltthk.inc ;Support definitions
  119. include wizthk.inc
  120. ;************************ START OF THUNK BODIES************************
  121. ;
  122. public GetClientConfig16@4
  123. GetClientConfig16@4:
  124. FAPILOG16 212
  125. mov cx, (1 SHL 10) + (0 SHL 8) + 8
  126. ; GetClientConfig16(16) = GetClientConfig16(32) {}
  127. ;
  128. ; dword ptr [ebp+8]: pClientConfig
  129. ;
  130. public IIGetClientConfig16@4
  131. IIGetClientConfig16@4:
  132. call dword ptr [pfnFT_Prolog_wizthk]
  133. sub esp,24
  134. mov esi,[ebp+8]
  135. or esi,esi
  136. jnz L0
  137. push esi
  138. jmp L1
  139. L0:
  140. lea edi,[ebp-88]
  141. push edi ;pClientConfig: lpstruct32->lpstruct16
  142. or dword ptr [ebp-20],01h ;Set flag to fixup ESP-rel argument.
  143. mov ecx,12
  144. @@:
  145. lodsd
  146. stosw
  147. loop @B
  148. L1:
  149. call FT_Thunk
  150. movzx ebx,ax
  151. mov edi,[ebp+8]
  152. or edi,edi
  153. jz L2
  154. lea esi,[ebp-88] ;pClientConfig Struct16->Struct32
  155. mov ecx,12
  156. @@:
  157. lodsw
  158. cwde
  159. stosd
  160. loop @B
  161. L2:
  162. jmp FT_Exit4
  163. ;
  164. public BeginNetcardTCPIPEnum16@0
  165. BeginNetcardTCPIPEnum16@0:
  166. FAPILOG16 161
  167. mov cl,6
  168. ; BeginNetcardTCPIPEnum16(16) = BeginNetcardTCPIPEnum16(32) {}
  169. ;
  170. ;
  171. public IIBeginNetcardTCPIPEnum16@0
  172. IIBeginNetcardTCPIPEnum16@0:
  173. push ebp
  174. mov ebp,esp
  175. push ecx
  176. sub esp,60
  177. call dword ptr [pfnQT_Thunk_wizthk]
  178. movzx eax,ax
  179. leave
  180. retn
  181. ;
  182. public GetNextNetcardTCPIPNode16@12
  183. GetNextNetcardTCPIPNode16@12:
  184. FAPILOG16 131
  185. mov cl,5
  186. ; GetNextNetcardTCPIPNode16(16) = GetNextNetcardTCPIPNode16(32) {}
  187. ;
  188. ; dword ptr [ebp+8]: pszTcpNode
  189. ; dword ptr [ebp+12]: cbTcpNode
  190. ; dword ptr [ebp+16]: dwFlags
  191. ;
  192. public IIGetNextNetcardTCPIPNode16@12
  193. IIGetNextNetcardTCPIPNode16@12:
  194. push ebp
  195. mov ebp,esp
  196. push ecx
  197. sub esp,60
  198. call SMapLS_IP_EBP_8
  199. push eax
  200. push word ptr [ebp+12] ;cbTcpNode: dword->word
  201. push dword ptr [ebp+16] ;dwFlags: dword->dword
  202. call dword ptr [pfnQT_Thunk_wizthk]
  203. cwde
  204. call SUnMapLS_IP_EBP_8
  205. leave
  206. retn 12
  207. ;
  208. public GetSETUPXErrorText16@12
  209. GetSETUPXErrorText16@12:
  210. FAPILOG16 106
  211. mov cl,4
  212. ; GetSETUPXErrorText16(16) = GetSETUPXErrorText16(32) {}
  213. ;
  214. ; dword ptr [ebp+8]: dwErr
  215. ; dword ptr [ebp+12]: pszErrorDesc
  216. ; dword ptr [ebp+16]: cbErrorDesc
  217. ;
  218. public IIGetSETUPXErrorText16@12
  219. IIGetSETUPXErrorText16@12:
  220. push ebp
  221. mov ebp,esp
  222. push ecx
  223. sub esp,60
  224. push dword ptr [ebp+8] ;dwErr: dword->dword
  225. call SMapLS_IP_EBP_12
  226. push eax
  227. push dword ptr [ebp+16] ;cbErrorDesc: dword->dword
  228. call dword ptr [pfnQT_Thunk_wizthk]
  229. call SUnMapLS_IP_EBP_12
  230. leave
  231. retn 12
  232. ;
  233. public RemoveUnneededDefaultComponents16@4
  234. RemoveUnneededDefaultComponents16@4:
  235. FAPILOG16 68
  236. mov cl,3
  237. ; RemoveUnneededDefaultComponents16(16) = RemoveUnneededDefaultComponents16(32) {}
  238. ;
  239. ; dword ptr [ebp+8]: hwndParent
  240. ;
  241. public IIRemoveUnneededDefaultComponents16@4
  242. IIRemoveUnneededDefaultComponents16@4:
  243. push ebp
  244. mov ebp,esp
  245. push ecx
  246. sub esp,60
  247. push word ptr [ebp+8] ;hwndParent: dword->word
  248. call dword ptr [pfnQT_Thunk_wizthk]
  249. movzx eax,ax
  250. leave
  251. retn 4
  252. ;
  253. public RemoveProtocols16@12
  254. RemoveProtocols16@12:
  255. FAPILOG16 46
  256. mov cl,2
  257. jmp IIRemoveProtocols16@12
  258. public InstallComponent16@12
  259. InstallComponent16@12:
  260. FAPILOG16 189
  261. mov cl,7
  262. ; RemoveProtocols16(16) = RemoveProtocols16(32) {}
  263. ;
  264. ; dword ptr [ebp+8]: hwndParent
  265. ; dword ptr [ebp+12]: dwRemoveFromCardType
  266. ; dword ptr [ebp+16]: dwProtocols
  267. ;
  268. public IIRemoveProtocols16@12
  269. IIRemoveProtocols16@12:
  270. push ebp
  271. mov ebp,esp
  272. push ecx
  273. sub esp,60
  274. push word ptr [ebp+8] ;hwndParent: dword->word
  275. push dword ptr [ebp+12] ;dwRemoveFromCardType: dword->dword
  276. push dword ptr [ebp+16] ;dwProtocols: dword->dword
  277. call dword ptr [pfnQT_Thunk_wizthk]
  278. movzx eax,ax
  279. leave
  280. retn 12
  281. ;
  282. public DoGenInstall16@12
  283. DoGenInstall16@12:
  284. FAPILOG16 27
  285. mov cl,1
  286. ; DoGenInstall16(16) = DoGenInstall16(32) {}
  287. ;
  288. ; dword ptr [ebp+8]: hwndParent
  289. ; dword ptr [ebp+12]: lpszInfFile
  290. ; dword ptr [ebp+16]: lpszInfSect
  291. ;
  292. public IIDoGenInstall16@12
  293. IIDoGenInstall16@12:
  294. push ebp
  295. mov ebp,esp
  296. push ecx
  297. sub esp,60
  298. push word ptr [ebp+8] ;hwndParent: dword->word
  299. call SMapLS_IP_EBP_12
  300. push eax
  301. call SMapLS_IP_EBP_16
  302. push eax
  303. call dword ptr [pfnQT_Thunk_wizthk]
  304. movzx eax,ax
  305. call SUnMapLS_IP_EBP_12
  306. call SUnMapLS_IP_EBP_16
  307. leave
  308. retn 12
  309. ;
  310. public SetInstallSourcePath16@4
  311. SetInstallSourcePath16@4:
  312. FAPILOG16 0
  313. mov cl,0
  314. ; SetInstallSourcePath16(16) = SetInstallSourcePath16(32) {}
  315. ;
  316. ; dword ptr [ebp+8]: szSourcePath
  317. ;
  318. public IISetInstallSourcePath16@4
  319. IISetInstallSourcePath16@4:
  320. push ebp
  321. mov ebp,esp
  322. push ecx
  323. sub esp,60
  324. call SMapLS_IP_EBP_8
  325. push eax
  326. call dword ptr [pfnQT_Thunk_wizthk]
  327. movzx eax,ax
  328. call SUnMapLS_IP_EBP_8
  329. leave
  330. retn 4
  331. ;-----------------------------------------------------------
  332. ifdef DEBUG
  333. FT_ThunkLogNames label byte
  334. db '[F] SetInstallSourcePath16',0
  335. db '[F] DoGenInstall16',0
  336. db '[F] RemoveProtocols16',0
  337. db '[F] RemoveUnneededDefaultComponents16',0
  338. db '[F] GetSETUPXErrorText16',0
  339. db '[F] GetNextNetcardTCPIPNode16',0
  340. db '[F] BeginNetcardTCPIPEnum16',0
  341. db '[F] InstallComponent16',0
  342. db '[F] GetClientConfig16',0
  343. endif ;DEBUG
  344. ;-----------------------------------------------------------
  345. ELSE
  346. ;************************* START OF 16-BIT CODE *************************
  347. OPTION SEGMENT:USE16
  348. .model LARGE,PASCAL
  349. .code _TEXT
  350. externDef SetInstallSourcePath16:far16
  351. externDef DoGenInstall16:far16
  352. externDef RemoveProtocols16:far16
  353. externDef RemoveUnneededDefaultComponents16:far16
  354. externDef GetSETUPXErrorText16:far16
  355. externDef GetNextNetcardTCPIPNode16:far16
  356. externDef BeginNetcardTCPIPEnum16:far16
  357. externDef InstallComponent16:far16
  358. externDef GetClientConfig16:far16
  359. FT_wizthkTargetTable label word
  360. dw offset SetInstallSourcePath16
  361. dw seg SetInstallSourcePath16
  362. dw offset DoGenInstall16
  363. dw seg DoGenInstall16
  364. dw offset RemoveProtocols16
  365. dw seg RemoveProtocols16
  366. dw offset RemoveUnneededDefaultComponents16
  367. dw seg RemoveUnneededDefaultComponents16
  368. dw offset GetSETUPXErrorText16
  369. dw seg GetSETUPXErrorText16
  370. dw offset GetNextNetcardTCPIPNode16
  371. dw seg GetNextNetcardTCPIPNode16
  372. dw offset BeginNetcardTCPIPEnum16
  373. dw seg BeginNetcardTCPIPEnum16
  374. dw offset InstallComponent16
  375. dw seg InstallComponent16
  376. dw offset GetClientConfig16
  377. dw seg GetClientConfig16
  378. .data
  379. public wizthk_ThunkData16 ;This symbol must be exported.
  380. wizthk_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  381. dd 010e07h ;Checksum
  382. dw offset FT_wizthkTargetTable
  383. dw seg FT_wizthkTargetTable
  384. dd 0 ;First-time flag.
  385. .code _TEXT
  386. externDef ThunkConnect16:far16
  387. public wizthk_ThunkConnect16
  388. wizthk_ThunkConnect16:
  389. pop ax
  390. pop dx
  391. push seg wizthk_ThunkData16
  392. push offset wizthk_ThunkData16
  393. push seg wizthk_ThkData32
  394. push offset wizthk_ThkData32
  395. push cs
  396. push dx
  397. push ax
  398. jmp ThunkConnect16
  399. wizthk_ThkData32 label byte
  400. db "wizthk_ThunkData32",0
  401. ENDIF
  402. END