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.

110 lines
2.7 KiB

  1. TITLE KFLATSTB.ASM
  2. PAGE ,132
  3. ;
  4. ; WOW v1.0
  5. ;
  6. ; Copyright (c) 1991, Microsoft Corporation
  7. ;
  8. ; KTHUNKS.ASM
  9. ; Thunks in 16-bit space to route Windows API calls to WOW32
  10. ;
  11. ; History:
  12. ; 02-Apr-1991 Matt Felton (mattfe)
  13. ; Created.
  14. ;
  15. ifndef WINDEBUG
  16. KDEBUG = 0
  17. WDEBUG = 0
  18. else
  19. KDEBUG = 1
  20. WDEBUG = 1
  21. endif
  22. .386p
  23. .xlist
  24. include cmacros.inc
  25. include wow.inc
  26. include wowkrn.inc
  27. .list
  28. externFP WOW16Call
  29. sBegin CODE
  30. assumes CS,CODE
  31. ;---------------------------------------------------------------------
  32. ;
  33. ; BOOL ThunkConnect16(LPSTR pszDll16,
  34. ; LPSTR pszDll32,
  35. ; HINSTANCE hInstance,
  36. ; DWORD dwReason,
  37. ; LPVOID lpThunkData16,
  38. ; LPSTR pszThunkData32Name,
  39. ; WORD hModuleCS)
  40. ;
  41. ; Exported kernel routine: called from the DllEntryPoint()'s
  42. ; of 16-bit dll's that depend on a 32-bit partner with which
  43. ; they share thunks
  44. ;
  45. ;---------------------------------------------------------------------
  46. cProc ThunkConnect16, <PUBLIC, FAR, PASCAL>, <ds,si,di>
  47. parmD pszDll16
  48. parmD pszDll32
  49. parmW hInstance
  50. parmD dwReason
  51. parmD lpThunkData16
  52. parmD pszThunkData32Name
  53. parmW hModuleCS
  54. ; ThunkConnect16 proc FAR PASCAL PUBLIC USES ds si di, pszDll16:DWORD,
  55. ; pszDll32:DWORD,
  56. ; hInstance:WORD,
  57. ; dwReason:DWORD,
  58. ; lpThunkData16:DWORD,
  59. ; pszThunkData32Name:DWORD,
  60. ; hModuleCS:WORD
  61. cBegin nogen
  62. xor ax, ax
  63. ret
  64. ;ThunkConnect16 endp
  65. cEnd nogen
  66. ;; C16ThkSL01
  67. ;
  68. ; This is the 16-bit rewriter code for orthogonal 16->32 thunks.
  69. ;
  70. ; Entry:
  71. ; cx = offset in flat jump table
  72. ; edx = linear address of THUNKDATA16
  73. ; eax = cs:ip of common thunk entry point
  74. ; bx = NOT USED
  75. ;
  76. ; Exit:
  77. ; This "routine" doesn't really exit. It jumps back to eax (which now
  78. ; holds the rewritten code). When it does this, cx, di, si, bp, ds and the D
  79. ; flag must all hold the same values they had on entry.
  80. ;
  81. ;
  82. ; This routine only runs when the 16-bit thunk entry point has been
  83. ; freshly loaded, or restored after a discard. This routine patches
  84. ; its caller code so that it jumps straight to C32ThkSL in kernel32.
  85. ;
  86. cProc C16ThkSL01, <PUBLIC,FAR>
  87. cBegin nogen
  88. ; just return
  89. ret
  90. cEnd nogen
  91. sEnd CODE
  92. end