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.

81 lines
2.4 KiB

  1. /*++ BUILD Version: 0003
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, 1992, 1993 Microsoft Corporation
  6. *
  7. * FASTWOW.H
  8. * WOW32 x86 fast callback/API support
  9. *
  10. * History:
  11. * Created 4-Dec-1992 by barry bradie (barryb)
  12. --*/
  13. #if defined(i386) && !defined(DEBUG_OR_WOWPROFILE)
  14. #define FASTBOPPING 1
  15. #else
  16. #define FASTBOPPING 0
  17. #endif
  18. #if FASTBOPPING
  19. extern BYTE fKernelCSIPFixed;
  20. // Used by the monitor to dispatch interupts. Updated for callbacks and bops
  21. extern DECLSPEC_IMPORT PVOID CurrentMonitorTeb;
  22. #endif
  23. #if FASTBOPPING
  24. VOID WOWBopEntry(VOID);
  25. VPVOID FastBopVDMStack(void);
  26. VOID FastBopSetVDMStack(VPVOID vp);
  27. VOID FastWOWCallbackCall(VOID);
  28. VOID FastWOWCallbackRet(VOID);
  29. #define FASTVDMSTACK() FastBopVDMStack()
  30. #define SETFASTVDMSTACK(vp) FastBopSetVDMStack(vp)
  31. #endif
  32. //#if FASTBOPPING
  33. //
  34. // Used to put lock prefixes in appropriate places for MP machines
  35. //
  36. extern VOID FastWowFirstCode(VOID);
  37. extern VOID FixLocks(VOID);
  38. //#endif
  39. #if 0
  40. How to set a 16-bit register from the 32-bit side:
  41. WOW16Call is called by all API thunks. this routine sets up a stack
  42. frame (the VDMFRAME) before getting over to WOW32. the VDMFRAME is where
  43. all the registers are stored - whenever a task has crossed over to WOW32
  44. either via an API call or by returning from a callback, it saves
  45. its registers in the frame. immediately upon returning from WOW32
  46. it pops the stuff off the stack back into the registers. the way
  47. to get a value into a specific register when the task starts executing
  48. 16-bit code again is to put it in the frame.
  49. *** do not use the setAX(), setDX(), etc. functions for this purpose ***
  50. those routines update a context block. when the app re-enters 16-bit
  51. code the registers will have the requested values but will be
  52. immediately overwritten by the values on the stack.
  53. similarly, to retrieve a value that was in a register at the time
  54. of the API call you should fetch it out of the frame.
  55. note that this is only valid for a few registers, because the
  56. validation layer may modify the general-purpose registers.
  57. upon returning from a callback everything on the 16-bit stack
  58. should be valid. to get the value that was in a register
  59. after a callback, pull it out of the callback frame. note that
  60. there are general-purpose words in the callback frame for passing
  61. extra data from the 16-bit callback routine to WOW32.
  62. *** do not use the getAX(), getDX(), etc. functions for this purpose ***
  63. #endif