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.

386 lines
7.8 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Tue Jan 28 11:38:37 1997
  4. ;Command Line: ..\..\..\..\dev\tools\binr\thunk.exe -NC _TEXT ..\w95thk.thk
  5. TITLE $..\w95thk.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_w95thkTargetTable ;Flat address of target table in 16-bit module.
  75. public FT_w95thkChecksum32
  76. FT_w95thkChecksum32 dd 03469h
  77. ENDIF ;FT_DEFINEFTCOMMONROUTINES
  78. ;***************** END OF KERNEL32-ONLY SECTION ******************
  79. .code
  80. ;************************* COMMON PER-MODULE ROUTINES *************************
  81. .data
  82. public w95thk_ThunkData32 ;This symbol must be exported.
  83. w95thk_ThunkData32 label dword
  84. dd 3130534ch ;Protocol 'LS01'
  85. dd 03469h ;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_w95thk - offset w95thk_ThunkData32
  92. dd offset FT_Prolog_w95thk - offset w95thk_ThunkData32
  93. .code
  94. externDef ThunkConnect32@24:near32
  95. public w95thk_ThunkConnect32@16
  96. w95thk_ThunkConnect32@16:
  97. pop edx
  98. push offset w95thk_ThkData16
  99. push offset w95thk_ThunkData32
  100. push edx
  101. jmp ThunkConnect32@24
  102. w95thk_ThkData16 label byte
  103. db "w95thk_ThunkData16",0
  104. pfnQT_Thunk_w95thk dd offset QT_Thunk_w95thk
  105. pfnFT_Prolog_w95thk dd offset FT_Prolog_w95thk
  106. .data
  107. QT_Thunk_w95thk label byte
  108. db 32 dup(0cch) ;Patch space.
  109. FT_Prolog_w95thk 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 w95thk.inc
  120. ;************************ START OF THUNK BODIES************************
  121. ;
  122. public GetSETUPXErrorText16@12
  123. GetSETUPXErrorText16@12:
  124. FAPILOG16 73
  125. mov cl,3
  126. ; GetSETUPXErrorText16(16) = GetSETUPXErrorText16(32) {}
  127. ;
  128. ; dword ptr [ebp+8]: dwError
  129. ; dword ptr [ebp+12]: lpszErrorText
  130. ; dword ptr [ebp+16]: cbErrorText
  131. ;
  132. public IIGetSETUPXErrorText16@12
  133. IIGetSETUPXErrorText16@12:
  134. push ebp
  135. mov ebp,esp
  136. push ecx
  137. sub esp,60
  138. push dword ptr [ebp+8] ;dwError: dword->dword
  139. call SMapLS_IP_EBP_12
  140. push eax
  141. push dword ptr [ebp+16] ;cbErrorText: dword->dword
  142. call dword ptr [pfnQT_Thunk_w95thk]
  143. call SUnMapLS_IP_EBP_12
  144. leave
  145. retn 12
  146. ;
  147. public CtlSetLddPath16@8
  148. CtlSetLddPath16@8:
  149. FAPILOG16 53
  150. mov cl,2
  151. ; CtlSetLddPath16(16) = CtlSetLddPath16(32) {}
  152. ;
  153. ; dword ptr [ebp+8]: uiLDID
  154. ; dword ptr [ebp+12]: lpszPath
  155. ;
  156. public IICtlSetLddPath16@8
  157. IICtlSetLddPath16@8:
  158. push ebp
  159. mov ebp,esp
  160. push ecx
  161. sub esp,60
  162. push word ptr [ebp+8] ;uiLDID: dword->word
  163. call SMapLS_IP_EBP_12
  164. push eax
  165. call dword ptr [pfnQT_Thunk_w95thk]
  166. call SUnMapLS_IP_EBP_12
  167. leave
  168. retn 8
  169. ;
  170. public GenInstall16@20
  171. GenInstall16@20:
  172. FAPILOG16 36
  173. mov cl,1
  174. ; GenInstall16(16) = GenInstall16(32) {}
  175. ;
  176. ; dword ptr [ebp+8]: lpszInf
  177. ; dword ptr [ebp+12]: lpszSection
  178. ; dword ptr [ebp+16]: lpszDirectory
  179. ; dword ptr [ebp+20]: dwQuietMode
  180. ; dword ptr [ebp+24]: hwnd
  181. ;
  182. public IIGenInstall16@20
  183. IIGenInstall16@20:
  184. push ebp
  185. mov ebp,esp
  186. push ecx
  187. sub esp,60
  188. call SMapLS_IP_EBP_8
  189. push eax
  190. call SMapLS_IP_EBP_12
  191. push eax
  192. call SMapLS_IP_EBP_16
  193. push eax
  194. push dword ptr [ebp+20] ;dwQuietMode: dword->dword
  195. push dword ptr [ebp+24] ;hwnd: dword->dword
  196. call dword ptr [pfnQT_Thunk_w95thk]
  197. call SUnMapLS_IP_EBP_8
  198. call SUnMapLS_IP_EBP_12
  199. call SUnMapLS_IP_EBP_16
  200. leave
  201. retn 20
  202. ;
  203. public GenFormStrWithoutPlaceHolders16@12
  204. GenFormStrWithoutPlaceHolders16@12:
  205. FAPILOG16 0
  206. mov cl,0
  207. ; GenFormStrWithoutPlaceHolders16(16) = GenFormStrWithoutPlaceHolders16(32) {}
  208. ;
  209. ; dword ptr [ebp+8]: lpszDst
  210. ; dword ptr [ebp+12]: lpszSrc
  211. ; dword ptr [ebp+16]: lpszInfFilename
  212. ;
  213. public IIGenFormStrWithoutPlaceHolders16@12
  214. IIGenFormStrWithoutPlaceHolders16@12:
  215. push ebp
  216. mov ebp,esp
  217. push ecx
  218. sub esp,60
  219. call SMapLS_IP_EBP_8
  220. push eax
  221. call SMapLS_IP_EBP_12
  222. push eax
  223. call SMapLS_IP_EBP_16
  224. push eax
  225. call dword ptr [pfnQT_Thunk_w95thk]
  226. cwde
  227. call SUnMapLS_IP_EBP_8
  228. call SUnMapLS_IP_EBP_12
  229. call SUnMapLS_IP_EBP_16
  230. leave
  231. retn 12
  232. ;-----------------------------------------------------------
  233. ifdef DEBUG
  234. FT_ThunkLogNames label byte
  235. db '[F] GenFormStrWithoutPlaceHolders16',0
  236. db '[F] GenInstall16',0
  237. db '[F] CtlSetLddPath16',0
  238. db '[F] GetSETUPXErrorText16',0
  239. endif ;DEBUG
  240. ;-----------------------------------------------------------
  241. ELSE
  242. ;************************* START OF 16-BIT CODE *************************
  243. OPTION SEGMENT:USE16
  244. .model LARGE,PASCAL
  245. .code _TEXT
  246. externDef GenFormStrWithoutPlaceHolders16:far16
  247. externDef GenInstall16:far16
  248. externDef CtlSetLddPath16:far16
  249. externDef GetSETUPXErrorText16:far16
  250. FT_w95thkTargetTable label word
  251. dw offset GenFormStrWithoutPlaceHolders16
  252. dw seg GenFormStrWithoutPlaceHolders16
  253. dw offset GenInstall16
  254. dw seg GenInstall16
  255. dw offset CtlSetLddPath16
  256. dw seg CtlSetLddPath16
  257. dw offset GetSETUPXErrorText16
  258. dw seg GetSETUPXErrorText16
  259. .data
  260. public w95thk_ThunkData16 ;This symbol must be exported.
  261. w95thk_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  262. dd 03469h ;Checksum
  263. dw offset FT_w95thkTargetTable
  264. dw seg FT_w95thkTargetTable
  265. dd 0 ;First-time flag.
  266. .code _TEXT
  267. externDef ThunkConnect16:far16
  268. public w95thk_ThunkConnect16
  269. w95thk_ThunkConnect16:
  270. pop ax
  271. pop dx
  272. push seg w95thk_ThunkData16
  273. push offset w95thk_ThunkData16
  274. push seg w95thk_ThkData32
  275. push offset w95thk_ThkData32
  276. push cs
  277. push dx
  278. push ax
  279. jmp ThunkConnect16
  280. w95thk_ThkData32 label byte
  281. db "w95thk_ThunkData32",0
  282. ENDIF
  283. END