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.

41 lines
874 B

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. xlathlp.h
  5. Abstract:
  6. This module contains helper macros for the api translation
  7. Author:
  8. Dave Hastings (daveh) 24-Nov-1992
  9. Revision History:
  10. --*/
  11. #define DPMI_EXEC_INT(x) SWITCH_TO_DOSX_RMSTACK(); \
  12. DpmiPushRmInt(x); \
  13. host_simulate(); \
  14. SWITCH_FROM_DOSX_RMSTACK();
  15. //
  16. // VOID
  17. // DPMI_FLAT_TO_SEGMENTED(
  18. // PUCHAR buffer,
  19. // PUSHORT seg,
  20. // PUSHORT off
  21. // )
  22. #define DPMI_FLAT_TO_SEGMENTED(buffer, seg, off) { \
  23. *seg = (USHORT)(((ULONG)buffer-IntelBase) >> 4); \
  24. *off = (USHORT)(((ULONG)buffer-IntelBase) & 0xf); \
  25. }
  26. #define SELECTOR_TO_INTEL_LINEAR_ADDRESS(sel) \
  27. (FlatAddress[(sel & ~7) / sizeof(LDT_ENTRY)] - IntelBase)