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.

180 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. data.c
  5. Abstract:
  6. This module contains the x86 specific data for the dpmi library.
  7. Common data is found in dpmi32.c
  8. Author:
  9. Dave Hastings (daveh) creation-date 09-Feb-1994
  10. Revision History:
  11. Neil Sandlin (neilsa) 31-Jul-1995 Updates for the 486 emulator
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. //
  16. // Information about the current PSP
  17. //
  18. USHORT CurrentPSPSelector;
  19. //
  20. // Table of selector bases and limits
  21. //
  22. ULONG FlatAddress[LDT_SIZE];
  23. //
  24. // LDT information
  25. //
  26. PLDT_ENTRY Ldt;
  27. USHORT LdtSel;
  28. USHORT LdtMaxSel = 0;
  29. USHORT LdtUserSel = 0;
  30. //
  31. // Address of 16 bit Idt
  32. //
  33. PIDT_ENTRY Idt;
  34. //
  35. // Pointers to the low memory buffers
  36. //
  37. PUCHAR SmallXlatBuffer;
  38. PUCHAR LargeXlatBuffer;
  39. BOOL SmallBufferInUse;
  40. USHORT LargeBufferInUseCount = 0;
  41. //
  42. // Segment of realmode dosx stack
  43. //
  44. USHORT DosxStackSegment;
  45. //
  46. // segment of realmode dosx code
  47. //
  48. USHORT DosxRmCodeSegment;
  49. //
  50. // selector of realmode code
  51. //
  52. USHORT DosxRmCodeSelector;
  53. //
  54. // Address of pointer to next frame on Dosx stack
  55. //
  56. PWORD16 DosxStackFramePointer;
  57. //
  58. // Size of dosx stack frame
  59. //
  60. USHORT DosxStackFrameSize;
  61. //
  62. // Dpmi flags for the current application
  63. //
  64. USHORT CurrentAppFlags;
  65. //
  66. // Address of Bop fe for ending interrupt simulation
  67. //
  68. ULONG RmBopFe;
  69. ULONG PmBopFe;
  70. //
  71. // Address of buffer for DTA in Dosx
  72. //
  73. PUCHAR DosxDtaBuffer;
  74. //
  75. // Information about the current DTA
  76. //
  77. // N.B. The selector:offset, and CurrentDta following MAY point to
  78. // different linear addresses. This will be the case if the
  79. // dta selector is in high memory.
  80. // CurrentDosDta holds the "cached" value of the Dta that has
  81. // actually been issued to DOS.
  82. PUCHAR CurrentDta;
  83. PUCHAR CurrentPmDtaAddress;
  84. PUCHAR CurrentDosDta;
  85. USHORT CurrentDtaSelector;
  86. USHORT CurrentDtaOffset;
  87. //
  88. // These are the functions in WOW (GlobalDOSAlloc, GlobalDOSFree)
  89. // that are used as helper functions to perform DPMI func's 100,101
  90. // when we are running under WOW.
  91. //
  92. USHORT WOWAllocSeg = 0;
  93. USHORT WOWAllocFunc;
  94. USHORT WOWFreeSeg = 0;
  95. USHORT WOWFreeFunc;
  96. //
  97. // Selector limits
  98. //
  99. #if DBG
  100. ULONG SelectorLimit[LDT_SIZE];
  101. PULONG ExpSelectorLimit = SelectorLimit;
  102. #else
  103. PULONG ExpSelectorLimit = NULL;
  104. #endif
  105. //
  106. // Start of intel address space in process memory
  107. //
  108. ULONG IntelBase = 0;
  109. //
  110. // Variables used for supporting stack switching
  111. // (on x86, these are in the vdmtib)
  112. //
  113. #ifndef i386
  114. USHORT LockedPMStackSel;
  115. ULONG LockedPMStackCount;
  116. ULONG PMLockOrigEIP;
  117. ULONG PMLockOrigSS;
  118. ULONG PMLockOrigESP;
  119. ULONG DosxFaultHandlerIret;
  120. ULONG DosxFaultHandlerIretd;
  121. ULONG DosxIntHandlerIret;
  122. ULONG DosxIntHandlerIretd;
  123. ULONG DosxRMReflector;
  124. #endif
  125. VDM_INTERRUPTHANDLER DpmiInterruptHandlers[256] = {0};
  126. VDM_FAULTHANDLER DpmiFaultHandlers[32] = {0};
  127. ULONG DosxIret;
  128. ULONG DosxIretd;
  129. USHORT PMReflectorSeg;
  130. ULONG DosxRmSaveRestoreState;
  131. ULONG DosxPmSaveRestoreState;
  132. ULONG DosxRmRawModeSwitch;
  133. ULONG DosxPmRawModeSwitch;
  134. ULONG DosxVcdPmSvcCall;
  135. ULONG DosxMsDosApi;
  136. ULONG DosxXmsControl;
  137. ULONG DosxHungAppExit;
  138. //
  139. // WORKITEM: should be in VDMTIB
  140. //
  141. ULONG LastLockedPMStackSS;
  142. ULONG LastLockedPMStackESP;