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.

476 lines
8.8 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Tue Jul 09 16:59:49 1996
  4. ;Command Line: ..\..\..\dev\tools\binr\thunk.exe -NC _TEXT -o Cctl1632 ..\Cctl1632.thk
  5. TITLE $Cctl1632.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_Cctl1632TargetTable ;Flat address of target table in 16-bit module.
  75. public FT_Cctl1632Checksum32
  76. FT_Cctl1632Checksum32 dd 01e9ah
  77. ENDIF ;FT_DEFINEFTCOMMONROUTINES
  78. ;***************** END OF KERNEL32-ONLY SECTION ******************
  79. .code
  80. ;************************* COMMON PER-MODULE ROUTINES *************************
  81. .data
  82. ; The next two symbols must be exported so BBT knows not to optimize
  83. ; them. (We tag them as KeepTogetherRange in the BBT config file.)
  84. public Cctl1632_ThunkData32 ;This symbol must be exported.
  85. public FT_Prolog_Cctl1632
  86. Cctl1632_ThunkData32 label dword
  87. dd 3130534ch ;Protocol 'LS01'
  88. dd 01e9ah ;Checksum
  89. dd 0 ;Jump table address.
  90. dd 3130424ch ;'LB01'
  91. dd 0 ;Flags
  92. dd 0 ;Reserved (MUST BE 0)
  93. dd 0 ;Reserved (MUST BE 0)
  94. dd offset QT_Thunk_Cctl1632 - offset Cctl1632_ThunkData32
  95. dd offset FT_Prolog_Cctl1632 - offset Cctl1632_ThunkData32
  96. .code
  97. externDef ThunkConnect32@24:near32
  98. public Cctl1632_ThunkConnect32@16
  99. Cctl1632_ThunkConnect32@16:
  100. pop edx
  101. push offset Cctl1632_ThkData16
  102. push offset Cctl1632_ThunkData32
  103. push edx
  104. jmp ThunkConnect32@24
  105. Cctl1632_ThkData16 label byte
  106. db "Cctl1632_ThunkData16",0
  107. pfnQT_Thunk_Cctl1632 dd offset QT_Thunk_Cctl1632
  108. pfnFT_Prolog_Cctl1632 dd offset FT_Prolog_Cctl1632
  109. .data
  110. QT_Thunk_Cctl1632 label byte
  111. db 32 dup(0cch) ;Patch space.
  112. FT_Prolog_Cctl1632 label byte
  113. db 32 dup(0cch) ;Patch space.
  114. .code
  115. ebp_top equ <[ebp + 8]> ;First api parameter
  116. ebp_retval equ <[ebp + -64]> ;Api return value
  117. FT_ESPFIXUP macro dwSpOffset
  118. or dword ptr [ebp + -20], 1 SHL ((dwSpOffset) SHR 1)
  119. endm
  120. ebp_qttop equ <[ebp + 8]>
  121. include fltthk.inc ;Support definitions
  122. include Cctl1632.inc
  123. ;************************ START OF THUNK BODIES************************
  124. ;
  125. public DestroyPropertySheetPage16@4
  126. DestroyPropertySheetPage16@4:
  127. FAPILOG16 35
  128. mov cl,2
  129. ; DestroyPropertySheetPage(16) = DestroyPropertySheetPage16(32) {}
  130. ;
  131. ; dword ptr [ebp+8]: hpage
  132. ;
  133. public IIDestroyPropertySheetPage16@4
  134. IIDestroyPropertySheetPage16@4:
  135. push ebp
  136. mov ebp,esp
  137. push ecx
  138. sub esp,60
  139. push dword ptr [ebp+8] ;hpage: dword->dword
  140. call dword ptr [pfnQT_Thunk_Cctl1632]
  141. cwde
  142. leave
  143. retn 4
  144. ;
  145. public CreatePage16@8
  146. CreatePage16@8:
  147. FAPILOG16 18
  148. mov cl,1
  149. ; CreatePage(16) = CreatePage16(32) {}
  150. ;
  151. ; dword ptr [ebp+8]: hpage
  152. ; dword ptr [ebp+12]: hwndParent
  153. ;
  154. public IICreatePage16@8
  155. IICreatePage16@8:
  156. push ebp
  157. mov ebp,esp
  158. push ecx
  159. sub esp,60
  160. push dword ptr [ebp+8] ;hpage: dword->dword
  161. push word ptr [ebp+12] ;hwndParent: dword->word
  162. call dword ptr [pfnQT_Thunk_Cctl1632]
  163. movzx eax,ax
  164. leave
  165. retn 8
  166. ;
  167. public GetPageInfoME@24
  168. GetPageInfoME@24:
  169. FAPILOG16 0
  170. mov cx, (6 SHL 10) + (0 SHL 8) + 0
  171. ; GetPageInfo(16) = GetPageInfoME(32) {}
  172. ;
  173. ; dword ptr [ebp+8]: hpage
  174. ; dword ptr [ebp+12]: pszCaption
  175. ; dword ptr [ebp+16]: cbCaption
  176. ; dword ptr [ebp+20]: ppt
  177. ; dword ptr [ebp+24]: phIcon
  178. ; dword ptr [ebp+28]: pb
  179. ;
  180. public IIGetPageInfoME@24
  181. IIGetPageInfoME@24:
  182. call dword ptr [pfnFT_Prolog_Cctl1632]
  183. xor eax,eax
  184. push eax
  185. push eax
  186. sub esp,4
  187. mov esi,[ebp+20]
  188. or esi,esi
  189. jz @F
  190. or byte ptr [esi], 0
  191. or byte ptr [esi + 7], 0
  192. @@:
  193. mov edx, dword ptr [ebp+24]
  194. or edx,edx
  195. jz @F
  196. or dword ptr [edx], 0
  197. @@:
  198. mov edx, dword ptr [ebp+28]
  199. or edx,edx
  200. jz @F
  201. or dword ptr [edx], 0
  202. @@:
  203. push dword ptr [ebp+8] ;hpage: dword->dword
  204. call SMapLS_IP_EBP_12
  205. push eax
  206. push word ptr [ebp+16] ;cbCaption: dword->word
  207. mov esi,[ebp+20]
  208. or esi,esi
  209. jnz M0
  210. push esi
  211. jmp M1
  212. M0:
  213. lea edi,[ebp-76]
  214. push edi ;ppt: lpstruct32->lpstruct16
  215. or dword ptr [ebp-20],010h ;Set flag to fixup ESP-rel argument.
  216. M1:
  217. mov eax, dword ptr [ebp+24]
  218. call SMapLS
  219. mov [ebp-68],edx
  220. push eax
  221. mov eax, dword ptr [ebp+28]
  222. call SMapLS
  223. mov [ebp-72],edx
  224. push eax
  225. call FT_Thunk
  226. movsx ebx,ax
  227. call SUnMapLS_IP_EBP_12
  228. mov edi,[ebp+20]
  229. or edi,edi
  230. jz M2
  231. lea esi,[ebp-76] ;ppt Struct16->Struct32
  232. lodsw
  233. cwde
  234. stosd
  235. lodsw
  236. cwde
  237. stosd
  238. M2:
  239. mov edx, dword ptr [ebp+24]
  240. or edx,edx
  241. jz M3
  242. mov word ptr [edx+2], 0
  243. M3:
  244. mov ecx, dword ptr [ebp-68]
  245. call SUnMapLS
  246. mov edx, dword ptr [ebp+28]
  247. or edx,edx
  248. jz M4
  249. mov word ptr [edx+2], 0
  250. M4:
  251. mov ecx, dword ptr [ebp-72]
  252. call SUnMapLS
  253. jmp FT_Exit24
  254. ;
  255. public GetPageInfo16@20
  256. GetPageInfo16@20:
  257. FAPILOG16 0
  258. mov cx, (5 SHL 10) + (0 SHL 8) + 0
  259. ; GetPageInfo(16) = GetPageInfo16(32) {}
  260. ;
  261. ; dword ptr [ebp+8]: hpage
  262. ; dword ptr [ebp+12]: pszCaption
  263. ; dword ptr [ebp+16]: cbCaption
  264. ; dword ptr [ebp+20]: ppt
  265. ; dword ptr [ebp+24]: phIcon
  266. ;
  267. public IIGetPageInfo16@20
  268. IIGetPageInfo16@20:
  269. call dword ptr [pfnFT_Prolog_Cctl1632]
  270. xor eax,eax
  271. push eax
  272. sub esp,4
  273. mov esi,[ebp+20]
  274. or esi,esi
  275. jz @F
  276. or byte ptr [esi], 0
  277. or byte ptr [esi + 7], 0
  278. @@:
  279. mov edx, dword ptr [ebp+24]
  280. or edx,edx
  281. jz @F
  282. or dword ptr [edx], 0
  283. @@:
  284. push dword ptr [ebp+8] ;hpage: dword->dword
  285. call SMapLS_IP_EBP_12
  286. push eax
  287. push word ptr [ebp+16] ;cbCaption: dword->word
  288. mov esi,[ebp+20]
  289. or esi,esi
  290. jnz L0
  291. push esi
  292. jmp L1
  293. L0:
  294. lea edi,[ebp-72]
  295. push edi ;ppt: lpstruct32->lpstruct16
  296. or dword ptr [ebp-20],04h ;Set flag to fixup ESP-rel argument.
  297. L1:
  298. mov eax, dword ptr [ebp+24]
  299. call SMapLS
  300. mov [ebp-68],edx
  301. push eax
  302. call FT_Thunk
  303. movsx ebx,ax
  304. call SUnMapLS_IP_EBP_12
  305. mov edi,[ebp+20]
  306. or edi,edi
  307. jz L2
  308. lea esi,[ebp-72] ;ppt Struct16->Struct32
  309. lodsw
  310. cwde
  311. stosd
  312. lodsw
  313. cwde
  314. stosd
  315. L2:
  316. mov edx, dword ptr [ebp+24]
  317. or edx,edx
  318. jz L3
  319. mov word ptr [edx+2], 0
  320. L3:
  321. mov ecx, dword ptr [ebp-68]
  322. call SUnMapLS
  323. jmp FT_Exit20
  324. ;-----------------------------------------------------------
  325. ifdef DEBUG
  326. FT_ThunkLogNames label byte
  327. db '[F] GetPageInfo16',0
  328. db '[F] CreatePage16',0
  329. db '[F] DestroyPropertySheetPage16',0
  330. endif ;DEBUG
  331. ;-----------------------------------------------------------
  332. ELSE
  333. ;************************* START OF 16-BIT CODE *************************
  334. OPTION SEGMENT:USE16
  335. .model LARGE,PASCAL
  336. .code _TEXT
  337. externDef GetPageInfo:far16
  338. externDef CreatePage:far16
  339. externDef DestroyPropertySheetPage:far16
  340. FT_Cctl1632TargetTable label word
  341. dw offset GetPageInfo
  342. dw seg GetPageInfo
  343. dw offset CreatePage
  344. dw seg CreatePage
  345. dw offset DestroyPropertySheetPage
  346. dw seg DestroyPropertySheetPage
  347. .data
  348. public Cctl1632_ThunkData16 ;This symbol must be exported.
  349. Cctl1632_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  350. dd 01e9ah ;Checksum
  351. dw offset FT_Cctl1632TargetTable
  352. dw seg FT_Cctl1632TargetTable
  353. dd 0 ;First-time flag.
  354. .code _TEXT
  355. externDef ThunkConnect16:far16
  356. public Cctl1632_ThunkConnect16
  357. Cctl1632_ThunkConnect16:
  358. pop ax
  359. pop dx
  360. push seg Cctl1632_ThunkData16
  361. push offset Cctl1632_ThunkData16
  362. push seg Cctl1632_ThkData32
  363. push offset Cctl1632_ThkData32
  364. push cs
  365. push dx
  366. push ax
  367. jmp ThunkConnect16
  368. Cctl1632_ThkData32 label byte
  369. db "Cctl1632_ThunkData32",0
  370. ENDIF
  371. END