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.

382 lines
7.7 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Wed Jan 29 18:57:28 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@12
  171. GenInstall16@12:
  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. ;
  180. public IIGenInstall16@12
  181. IIGenInstall16@12:
  182. push ebp
  183. mov ebp,esp
  184. push ecx
  185. sub esp,60
  186. call SMapLS_IP_EBP_8
  187. push eax
  188. call SMapLS_IP_EBP_12
  189. push eax
  190. call SMapLS_IP_EBP_16
  191. push eax
  192. call dword ptr [pfnQT_Thunk_w95thk]
  193. call SUnMapLS_IP_EBP_8
  194. call SUnMapLS_IP_EBP_12
  195. call SUnMapLS_IP_EBP_16
  196. leave
  197. retn 12
  198. ;
  199. public GenFormStrWithoutPlaceHolders16@12
  200. GenFormStrWithoutPlaceHolders16@12:
  201. FAPILOG16 0
  202. mov cl,0
  203. ; GenFormStrWithoutPlaceHolders16(16) = GenFormStrWithoutPlaceHolders16(32) {}
  204. ;
  205. ; dword ptr [ebp+8]: lpszDst
  206. ; dword ptr [ebp+12]: lpszSrc
  207. ; dword ptr [ebp+16]: lpszInfFilename
  208. ;
  209. public IIGenFormStrWithoutPlaceHolders16@12
  210. IIGenFormStrWithoutPlaceHolders16@12:
  211. push ebp
  212. mov ebp,esp
  213. push ecx
  214. sub esp,60
  215. call SMapLS_IP_EBP_8
  216. push eax
  217. call SMapLS_IP_EBP_12
  218. push eax
  219. call SMapLS_IP_EBP_16
  220. push eax
  221. call dword ptr [pfnQT_Thunk_w95thk]
  222. cwde
  223. call SUnMapLS_IP_EBP_8
  224. call SUnMapLS_IP_EBP_12
  225. call SUnMapLS_IP_EBP_16
  226. leave
  227. retn 12
  228. ;-----------------------------------------------------------
  229. ifdef DEBUG
  230. FT_ThunkLogNames label byte
  231. db '[F] GenFormStrWithoutPlaceHolders16',0
  232. db '[F] GenInstall16',0
  233. db '[F] CtlSetLddPath16',0
  234. db '[F] GetSETUPXErrorText16',0
  235. endif ;DEBUG
  236. ;-----------------------------------------------------------
  237. ELSE
  238. ;************************* START OF 16-BIT CODE *************************
  239. OPTION SEGMENT:USE16
  240. .model LARGE,PASCAL
  241. .code _TEXT
  242. externDef GenFormStrWithoutPlaceHolders16:far16
  243. externDef GenInstall16:far16
  244. externDef CtlSetLddPath16:far16
  245. externDef GetSETUPXErrorText16:far16
  246. FT_w95thkTargetTable label word
  247. dw offset GenFormStrWithoutPlaceHolders16
  248. dw seg GenFormStrWithoutPlaceHolders16
  249. dw offset GenInstall16
  250. dw seg GenInstall16
  251. dw offset CtlSetLddPath16
  252. dw seg CtlSetLddPath16
  253. dw offset GetSETUPXErrorText16
  254. dw seg GetSETUPXErrorText16
  255. .data
  256. public w95thk_ThunkData16 ;This symbol must be exported.
  257. w95thk_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  258. dd 03469h ;Checksum
  259. dw offset FT_w95thkTargetTable
  260. dw seg FT_w95thkTargetTable
  261. dd 0 ;First-time flag.
  262. .code _TEXT
  263. externDef ThunkConnect16:far16
  264. public w95thk_ThunkConnect16
  265. w95thk_ThunkConnect16:
  266. pop ax
  267. pop dx
  268. push seg w95thk_ThunkData16
  269. push offset w95thk_ThunkData16
  270. push seg w95thk_ThkData32
  271. push offset w95thk_ThkData32
  272. push cs
  273. push dx
  274. push ax
  275. jmp ThunkConnect16
  276. w95thk_ThkData32 label byte
  277. db "w95thk_ThunkData32",0
  278. ENDIF
  279. END