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.

339 lines
6.3 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Mon May 21 15:57:59 2001
  4. ;Command Line: thunk.exe -t thk NCXP.thk -o Thunk.asm
  5. TITLE $Thunk.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 MapHInstLS :near32
  24. externDef MapHInstLS_PN :near32
  25. externDef MapHInstSL :near32
  26. externDef MapHInstSL_PN :near32
  27. externDef FT_Prolog :near32
  28. externDef FT_Thunk :near32
  29. externDef QT_Thunk :near32
  30. externDef FT_Exit0 :near32
  31. externDef FT_Exit4 :near32
  32. externDef FT_Exit8 :near32
  33. externDef FT_Exit12 :near32
  34. externDef FT_Exit16 :near32
  35. externDef FT_Exit20 :near32
  36. externDef FT_Exit24 :near32
  37. externDef FT_Exit28 :near32
  38. externDef FT_Exit32 :near32
  39. externDef FT_Exit36 :near32
  40. externDef FT_Exit40 :near32
  41. externDef FT_Exit44 :near32
  42. externDef FT_Exit48 :near32
  43. externDef FT_Exit52 :near32
  44. externDef FT_Exit56 :near32
  45. externDef SMapLS :near32
  46. externDef SUnMapLS :near32
  47. externDef SMapLS_IP_EBP_8 :near32
  48. externDef SUnMapLS_IP_EBP_8 :near32
  49. externDef SMapLS_IP_EBP_12 :near32
  50. externDef SUnMapLS_IP_EBP_12 :near32
  51. externDef SMapLS_IP_EBP_16 :near32
  52. externDef SUnMapLS_IP_EBP_16 :near32
  53. externDef SMapLS_IP_EBP_20 :near32
  54. externDef SUnMapLS_IP_EBP_20 :near32
  55. externDef SMapLS_IP_EBP_24 :near32
  56. externDef SUnMapLS_IP_EBP_24 :near32
  57. externDef SMapLS_IP_EBP_28 :near32
  58. externDef SUnMapLS_IP_EBP_28 :near32
  59. externDef SMapLS_IP_EBP_32 :near32
  60. externDef SUnMapLS_IP_EBP_32 :near32
  61. externDef SMapLS_IP_EBP_36 :near32
  62. externDef SUnMapLS_IP_EBP_36 :near32
  63. externDef SMapLS_IP_EBP_40 :near32
  64. externDef SUnMapLS_IP_EBP_40 :near32
  65. MapSL PROTO NEAR STDCALL p32:DWORD
  66. .code
  67. ;************************* COMMON PER-MODULE ROUTINES *************************
  68. .data
  69. public thk_ThunkData32 ;This symbol must be exported.
  70. thk_ThunkData32 label dword
  71. dd 3130534ch ;Protocol 'LS01'
  72. dd 043a5h ;Checksum
  73. dd 0 ;Jump table address.
  74. dd 3130424ch ;'LB01'
  75. dd 0 ;Flags
  76. dd 0 ;Reserved (MUST BE 0)
  77. dd 0 ;Reserved (MUST BE 0)
  78. dd offset QT_Thunk_thk - offset thk_ThunkData32
  79. dd offset FT_Prolog_thk - offset thk_ThunkData32
  80. .code
  81. externDef ThunkConnect32@24:near32
  82. public thk_ThunkConnect32@16
  83. thk_ThunkConnect32@16:
  84. pop edx
  85. push offset thk_ThkData16
  86. push offset thk_ThunkData32
  87. push edx
  88. jmp ThunkConnect32@24
  89. thk_ThkData16 label byte
  90. db "thk_ThunkData16",0
  91. pfnQT_Thunk_thk dd offset QT_Thunk_thk
  92. pfnFT_Prolog_thk dd offset FT_Prolog_thk
  93. .data
  94. QT_Thunk_thk label byte
  95. db 32 dup(0cch) ;Patch space.
  96. FT_Prolog_thk label byte
  97. db 32 dup(0cch) ;Patch space.
  98. .code
  99. ;************************ START OF THUNK BODIES************************
  100. ;
  101. public FindClassDev16@12
  102. FindClassDev16@12:
  103. mov cl,3
  104. jmp IIFindClassDev16@12
  105. public CallClassInstaller16@12
  106. CallClassInstaller16@12:
  107. mov cl,4
  108. ; FindClassDev16(16) = FindClassDev16(32) {}
  109. ;
  110. ; dword ptr [ebp+8]: hwndParent
  111. ; dword ptr [ebp+12]: lpszClassName
  112. ; dword ptr [ebp+16]: szDeviceID
  113. ;
  114. public IIFindClassDev16@12
  115. IIFindClassDev16@12:
  116. push ebp
  117. mov ebp,esp
  118. push ecx
  119. sub esp,60
  120. push word ptr [ebp+8] ;hwndParent: dword->word
  121. call SMapLS_IP_EBP_12
  122. push eax
  123. call SMapLS_IP_EBP_16
  124. push eax
  125. call dword ptr [pfnQT_Thunk_thk]
  126. shl eax,16
  127. shrd eax,edx,16
  128. call SUnMapLS_IP_EBP_12
  129. call SUnMapLS_IP_EBP_16
  130. leave
  131. retn 12
  132. ;
  133. public LookupDevNode16@20
  134. LookupDevNode16@20:
  135. mov cl,2
  136. ; LookupDevNode16(16) = LookupDevNode16(32) {}
  137. ;
  138. ; dword ptr [ebp+8]: hwndParent
  139. ; dword ptr [ebp+12]: pszClass
  140. ; dword ptr [ebp+16]: pszEnumKey
  141. ; dword ptr [ebp+20]: pDevNode
  142. ; dword ptr [ebp+24]: pdwFreePointer
  143. ;
  144. public IILookupDevNode16@20
  145. IILookupDevNode16@20:
  146. push ebp
  147. mov ebp,esp
  148. push ecx
  149. sub esp,60
  150. push word ptr [ebp+8] ;hwndParent: dword->word
  151. call SMapLS_IP_EBP_12
  152. push eax
  153. call SMapLS_IP_EBP_16
  154. push eax
  155. call SMapLS_IP_EBP_20
  156. push eax
  157. call SMapLS_IP_EBP_24
  158. push eax
  159. call dword ptr [pfnQT_Thunk_thk]
  160. shl eax,16
  161. shrd eax,edx,16
  162. call SUnMapLS_IP_EBP_12
  163. call SUnMapLS_IP_EBP_16
  164. call SUnMapLS_IP_EBP_20
  165. call SUnMapLS_IP_EBP_24
  166. leave
  167. retn 20
  168. ;
  169. public FreeDevNode16@4
  170. FreeDevNode16@4:
  171. mov cl,1
  172. ; FreeDevNode16(16) = FreeDevNode16(32) {}
  173. ;
  174. ; dword ptr [ebp+8]: dwFreePointer
  175. ;
  176. public IIFreeDevNode16@4
  177. IIFreeDevNode16@4:
  178. push ebp
  179. mov ebp,esp
  180. push ecx
  181. sub esp,60
  182. push dword ptr [ebp+8] ;dwFreePointer: dword->dword
  183. call dword ptr [pfnQT_Thunk_thk]
  184. shl eax,16
  185. shrd eax,edx,16
  186. leave
  187. retn 4
  188. ;
  189. public IcsUninstall16@0
  190. IcsUninstall16@0:
  191. mov cl,0
  192. ; IcsUninstall16(16) = IcsUninstall16(32) {}
  193. ;
  194. ;
  195. public IIIcsUninstall16@0
  196. IIIcsUninstall16@0:
  197. push ebp
  198. mov ebp,esp
  199. push ecx
  200. sub esp,60
  201. call dword ptr [pfnQT_Thunk_thk]
  202. shl eax,16
  203. shrd eax,edx,16
  204. leave
  205. retn
  206. ELSE
  207. ;************************* START OF 16-BIT CODE *************************
  208. OPTION SEGMENT:USE16
  209. .model LARGE,PASCAL
  210. .code
  211. externDef IcsUninstall16:far16
  212. externDef FreeDevNode16:far16
  213. externDef LookupDevNode16:far16
  214. externDef FindClassDev16:far16
  215. externDef CallClassInstaller16:far16
  216. FT_thkTargetTable label word
  217. dw offset IcsUninstall16
  218. dw seg IcsUninstall16
  219. dw offset FreeDevNode16
  220. dw seg FreeDevNode16
  221. dw offset LookupDevNode16
  222. dw seg LookupDevNode16
  223. dw offset FindClassDev16
  224. dw seg FindClassDev16
  225. dw offset CallClassInstaller16
  226. dw seg CallClassInstaller16
  227. .data
  228. public thk_ThunkData16 ;This symbol must be exported.
  229. thk_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  230. dd 043a5h ;Checksum
  231. dw offset FT_thkTargetTable
  232. dw seg FT_thkTargetTable
  233. dd 0 ;First-time flag.
  234. .code
  235. externDef ThunkConnect16:far16
  236. public thk_ThunkConnect16
  237. thk_ThunkConnect16:
  238. pop ax
  239. pop dx
  240. push seg thk_ThunkData16
  241. push offset thk_ThunkData16
  242. push seg thk_ThkData32
  243. push offset thk_ThkData32
  244. push cs
  245. push dx
  246. push ax
  247. jmp ThunkConnect16
  248. thk_ThkData32 label byte
  249. db "thk_ThunkData32",0
  250. ENDIF
  251. END