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.

601 lines
11 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Thu Apr 01 11:42:55 1999
  4. ;Command Line: d:\projects\cayman\dev\bin\misc\i386\thunk -t thk -o dcthk.asm ..\thunks\dcthk.thk
  5. TITLE $dcthk.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 027b0fh ;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 _OpenDriver@12
  102. _OpenDriver@12:
  103. mov cl,14
  104. ; _OpenDriver(16) = _OpenDriver(32) {}
  105. ;
  106. ; dword ptr [ebp+8]: lpDriverName
  107. ; dword ptr [ebp+12]: dwReserved
  108. ; dword ptr [ebp+16]: lpvop
  109. ;
  110. public II_OpenDriver@12
  111. II_OpenDriver@12:
  112. push ebp
  113. mov ebp,esp
  114. push ecx
  115. sub esp,60
  116. call SMapLS_IP_EBP_8
  117. push eax
  118. push dword ptr [ebp+12] ;dwReserved: dword->dword
  119. call SMapLS_IP_EBP_16
  120. push eax
  121. call dword ptr [pfnQT_Thunk_thk]
  122. movzx eax,ax
  123. call SUnMapLS_IP_EBP_8
  124. call SUnMapLS_IP_EBP_16
  125. leave
  126. retn 12
  127. ;
  128. public _CloseDriver@12
  129. _CloseDriver@12:
  130. mov cl,13
  131. ; _CloseDriver(16) = _CloseDriver(32) {}
  132. ;
  133. ; dword ptr [ebp+8]: h
  134. ; dword ptr [ebp+12]: lpReserved1
  135. ; dword ptr [ebp+16]: lpReserved2
  136. ;
  137. public II_CloseDriver@12
  138. II_CloseDriver@12:
  139. push ebp
  140. mov ebp,esp
  141. push ecx
  142. sub esp,60
  143. push word ptr [ebp+8] ;h: dword->word
  144. push dword ptr [ebp+12] ;lpReserved1: dword->dword
  145. push dword ptr [ebp+16] ;lpReserved2: dword->dword
  146. call dword ptr [pfnQT_Thunk_thk]
  147. shl eax,16
  148. shrd eax,edx,16
  149. leave
  150. retn 12
  151. ;
  152. public _SendDriverMessage@16
  153. _SendDriverMessage@16:
  154. mov cl,12
  155. ; _SendDriverMessage(16) = _SendDriverMessage(32) {}
  156. ;
  157. ; dword ptr [ebp+8]: h
  158. ; dword ptr [ebp+12]: msg
  159. ; dword ptr [ebp+16]: param1
  160. ; dword ptr [ebp+20]: param2
  161. ;
  162. public II_SendDriverMessage@16
  163. II_SendDriverMessage@16:
  164. push ebp
  165. mov ebp,esp
  166. push ecx
  167. sub esp,60
  168. push word ptr [ebp+8] ;h: dword->word
  169. push dword ptr [ebp+12] ;msg: dword->dword
  170. push dword ptr [ebp+16] ;param1: dword->dword
  171. push dword ptr [ebp+20] ;param2: dword->dword
  172. call dword ptr [pfnQT_Thunk_thk]
  173. shl eax,16
  174. shrd eax,edx,16
  175. leave
  176. retn 16
  177. ;
  178. public _GetVideoPalette@12
  179. _GetVideoPalette@12:
  180. mov cl,11
  181. ; _GetVideoPalette(16) = _GetVideoPalette(32) {}
  182. ;
  183. ; dword ptr [ebp+8]: hvideo
  184. ; dword ptr [ebp+12]: lpcp
  185. ; dword ptr [ebp+16]: dwcbSize
  186. ;
  187. public II_GetVideoPalette@12
  188. II_GetVideoPalette@12:
  189. push ebp
  190. mov ebp,esp
  191. push ecx
  192. sub esp,60
  193. push word ptr [ebp+8] ;hvideo: dword->word
  194. call SMapLS_IP_EBP_12
  195. push eax
  196. push dword ptr [ebp+16] ;dwcbSize: dword->dword
  197. call dword ptr [pfnQT_Thunk_thk]
  198. cwde
  199. call SUnMapLS_IP_EBP_12
  200. leave
  201. retn 12
  202. ;
  203. public _InitializeVideoStream@12
  204. _InitializeVideoStream@12:
  205. mov cl,9
  206. ; _InitializeVideoStream(16) = _InitializeVideoStream(32) {}
  207. ;
  208. ; dword ptr [ebp+8]: hvideo
  209. ; dword ptr [ebp+12]: dwMicroSecPerFrame
  210. ; dword ptr [ebp+16]: dwEvent
  211. ;
  212. public II_InitializeVideoStream@12
  213. II_InitializeVideoStream@12:
  214. push ebp
  215. mov ebp,esp
  216. push ecx
  217. sub esp,60
  218. push word ptr [ebp+8] ;hvideo: dword->word
  219. push dword ptr [ebp+12] ;dwMicroSecPerFrame: dword->dword
  220. push dword ptr [ebp+16] ;dwEvent: dword->dword
  221. call dword ptr [pfnQT_Thunk_thk]
  222. cwde
  223. leave
  224. retn 12
  225. ;
  226. public _UninitializeVideoStream@4
  227. _UninitializeVideoStream@4:
  228. mov cl,8
  229. jmp II_UninitializeVideoStream@4
  230. public _InitializeExternalVideoStream@4
  231. _InitializeExternalVideoStream@4:
  232. mov cl,10
  233. ; _UninitializeVideoStream(16) = _UninitializeVideoStream(32) {}
  234. ;
  235. ; dword ptr [ebp+8]: hvideo
  236. ;
  237. public II_UninitializeVideoStream@4
  238. II_UninitializeVideoStream@4:
  239. push ebp
  240. mov ebp,esp
  241. push ecx
  242. sub esp,60
  243. push word ptr [ebp+8] ;hvideo: dword->word
  244. call dword ptr [pfnQT_Thunk_thk]
  245. cwde
  246. leave
  247. retn 4
  248. ;
  249. public _GetVideoFormatSize@4
  250. _GetVideoFormatSize@4:
  251. mov cl,7
  252. ; _GetVideoFormatSize(16) = _GetVideoFormatSize(32) {}
  253. ;
  254. ; dword ptr [ebp+8]: hvideo
  255. ;
  256. public II_GetVideoFormatSize@4
  257. II_GetVideoFormatSize@4:
  258. push ebp
  259. mov ebp,esp
  260. push ecx
  261. sub esp,60
  262. push word ptr [ebp+8] ;hvideo: dword->word
  263. call dword ptr [pfnQT_Thunk_thk]
  264. shl eax,16
  265. shrd eax,edx,16
  266. leave
  267. retn 4
  268. ;
  269. public _GetVideoFormat@8
  270. _GetVideoFormat@8:
  271. mov cl,6
  272. ; _GetVideoFormat(16) = _GetVideoFormat(32) {}
  273. ;
  274. ; dword ptr [ebp+8]: hvideo
  275. ; dword ptr [ebp+12]: lpbmih
  276. ;
  277. public II_GetVideoFormat@8
  278. II_GetVideoFormat@8:
  279. push ebp
  280. mov ebp,esp
  281. push ecx
  282. sub esp,60
  283. push word ptr [ebp+8] ;hvideo: dword->word
  284. call SMapLS_IP_EBP_12
  285. push eax
  286. call dword ptr [pfnQT_Thunk_thk]
  287. cwde
  288. call SUnMapLS_IP_EBP_12
  289. leave
  290. retn 8
  291. ;
  292. public _SetVideoFormat@12
  293. _SetVideoFormat@12:
  294. mov cl,5
  295. ; _SetVideoFormat(16) = _SetVideoFormat(32) {}
  296. ;
  297. ; dword ptr [ebp+8]: hvideoExtIn
  298. ; dword ptr [ebp+12]: hvideoIn
  299. ; dword ptr [ebp+16]: lpbmih
  300. ;
  301. public II_SetVideoFormat@12
  302. II_SetVideoFormat@12:
  303. push ebp
  304. mov ebp,esp
  305. push ecx
  306. sub esp,60
  307. push word ptr [ebp+8] ;hvideoExtIn: dword->word
  308. push word ptr [ebp+12] ;hvideoIn: dword->word
  309. call SMapLS_IP_EBP_16
  310. push eax
  311. call dword ptr [pfnQT_Thunk_thk]
  312. cwde
  313. call SUnMapLS_IP_EBP_16
  314. leave
  315. retn 12
  316. ;
  317. public _AllocateLockableBuffer@4
  318. _AllocateLockableBuffer@4:
  319. mov cl,4
  320. ; _AllocateLockableBuffer(16) = _AllocateLockableBuffer(32) {}
  321. ;
  322. ; dword ptr [ebp+8]: dwSize
  323. ;
  324. public II_AllocateLockableBuffer@4
  325. II_AllocateLockableBuffer@4:
  326. push ebp
  327. mov ebp,esp
  328. push ecx
  329. sub esp,60
  330. push dword ptr [ebp+8] ;dwSize: dword->dword
  331. call dword ptr [pfnQT_Thunk_thk]
  332. leave
  333. retn 4
  334. ;
  335. public _LockBuffer@4
  336. _LockBuffer@4:
  337. mov cl,3
  338. ; _LockBuffer(16) = _LockBuffer(32) {}
  339. ;
  340. ; dword ptr [ebp+8]: wBuffer
  341. ;
  342. public II_LockBuffer@4
  343. II_LockBuffer@4:
  344. push ebp
  345. mov ebp,esp
  346. push ecx
  347. sub esp,60
  348. push word ptr [ebp+8] ;wBuffer: dword->word
  349. call dword ptr [pfnQT_Thunk_thk]
  350. cwde
  351. leave
  352. retn 4
  353. ;
  354. public _FreeLockableBuffer@4
  355. _FreeLockableBuffer@4:
  356. mov cl,1
  357. jmp II_FreeLockableBuffer@4
  358. public _UnlockBuffer@4
  359. _UnlockBuffer@4:
  360. mov cl,2
  361. ; _FreeLockableBuffer(16) = _FreeLockableBuffer(32) {}
  362. ;
  363. ; dword ptr [ebp+8]: wBuffer
  364. ;
  365. public II_FreeLockableBuffer@4
  366. II_FreeLockableBuffer@4:
  367. push ebp
  368. mov ebp,esp
  369. push ecx
  370. sub esp,60
  371. push word ptr [ebp+8] ;wBuffer: dword->word
  372. call dword ptr [pfnQT_Thunk_thk]
  373. leave
  374. retn 4
  375. ;
  376. public _CloseVxDHandle@4
  377. _CloseVxDHandle@4:
  378. mov cl,0
  379. ; _CloseVxDHandle(16) = _CloseVxDHandle(32) {}
  380. ;
  381. ; dword ptr [ebp+8]: pev
  382. ;
  383. public II_CloseVxDHandle@4
  384. II_CloseVxDHandle@4:
  385. push ebp
  386. mov ebp,esp
  387. push ecx
  388. sub esp,60
  389. push dword ptr [ebp+8] ;pev: dword->dword
  390. call dword ptr [pfnQT_Thunk_thk]
  391. leave
  392. retn 4
  393. ELSE
  394. ;************************* START OF 16-BIT CODE *************************
  395. OPTION SEGMENT:USE16
  396. .model LARGE,PASCAL
  397. .code
  398. externDef _CloseVxDHandle:far16
  399. externDef _FreeLockableBuffer:far16
  400. externDef _UnlockBuffer:far16
  401. externDef _LockBuffer:far16
  402. externDef _AllocateLockableBuffer:far16
  403. externDef _SetVideoFormat:far16
  404. externDef _GetVideoFormat:far16
  405. externDef _GetVideoFormatSize:far16
  406. externDef _UninitializeVideoStream:far16
  407. externDef _InitializeVideoStream:far16
  408. externDef _InitializeExternalVideoStream:far16
  409. externDef _GetVideoPalette:far16
  410. externDef _SendDriverMessage:far16
  411. externDef _CloseDriver:far16
  412. externDef _OpenDriver:far16
  413. FT_thkTargetTable label word
  414. dw offset _CloseVxDHandle
  415. dw seg _CloseVxDHandle
  416. dw offset _FreeLockableBuffer
  417. dw seg _FreeLockableBuffer
  418. dw offset _UnlockBuffer
  419. dw seg _UnlockBuffer
  420. dw offset _LockBuffer
  421. dw seg _LockBuffer
  422. dw offset _AllocateLockableBuffer
  423. dw seg _AllocateLockableBuffer
  424. dw offset _SetVideoFormat
  425. dw seg _SetVideoFormat
  426. dw offset _GetVideoFormat
  427. dw seg _GetVideoFormat
  428. dw offset _GetVideoFormatSize
  429. dw seg _GetVideoFormatSize
  430. dw offset _UninitializeVideoStream
  431. dw seg _UninitializeVideoStream
  432. dw offset _InitializeVideoStream
  433. dw seg _InitializeVideoStream
  434. dw offset _InitializeExternalVideoStream
  435. dw seg _InitializeExternalVideoStream
  436. dw offset _GetVideoPalette
  437. dw seg _GetVideoPalette
  438. dw offset _SendDriverMessage
  439. dw seg _SendDriverMessage
  440. dw offset _CloseDriver
  441. dw seg _CloseDriver
  442. dw offset _OpenDriver
  443. dw seg _OpenDriver
  444. .data
  445. public thk_ThunkData16 ;This symbol must be exported.
  446. thk_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  447. dd 027b0fh ;Checksum
  448. dw offset FT_thkTargetTable
  449. dw seg FT_thkTargetTable
  450. dd 0 ;First-time flag.
  451. .code
  452. externDef ThunkConnect16:far16
  453. public thk_ThunkConnect16
  454. thk_ThunkConnect16:
  455. pop ax
  456. pop dx
  457. push seg thk_ThunkData16
  458. push offset thk_ThunkData16
  459. push seg thk_ThkData32
  460. push offset thk_ThkData32
  461. push cs
  462. push dx
  463. push ax
  464. jmp ThunkConnect16
  465. thk_ThkData32 label byte
  466. db "thk_ThunkData32",0
  467. ENDIF
  468. END