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.

156 lines
2.6 KiB

  1. /* xms.h - main include file for dem
  2. *
  3. * Modification History
  4. *
  5. * Sudeepb 31-Mar-1991 Created
  6. *
  7. * williamh 25-Sept-1992 Added UMB support
  8. */
  9. /*
  10. #define WIN
  11. #define FLAT_32
  12. #include <nt.h>
  13. #include <ntrtl.h>
  14. #include <nturtl.h>
  15. #define _WINDOWS
  16. #include <windows.h>
  17. */
  18. #ifdef DOS
  19. #define SIGNALS
  20. #endif
  21. #ifdef OS2_16
  22. #define OS2
  23. #define SIGNALS
  24. #endif
  25. #ifdef OS2_32
  26. #define OS2
  27. #define FLAT_32
  28. #endif
  29. #include <stdarg.h>
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32. #include <string.h>
  33. #include <malloc.h>
  34. #include <process.h>
  35. #ifdef WIN_16
  36. #define WIN
  37. #define API16
  38. #endif
  39. #ifdef WIN_32
  40. #define WIN
  41. #define FLAT_32
  42. #define TRUE_IF_WIN32 1
  43. #include <nt.h>
  44. #include <ntrtl.h>
  45. #include <nturtl.h>
  46. #else
  47. #define TRUE_IF_WIN32 0
  48. #endif
  49. #ifdef FLAT_32
  50. #ifndef i386
  51. #define ALIGN_32
  52. #else
  53. #define NOALIGN_32
  54. #endif
  55. #endif
  56. #ifdef WIN
  57. #define _WINDOWS
  58. #include <windows.h>
  59. #endif
  60. #ifdef SIGNALS
  61. #include <conio.h>
  62. #include <signal.h>
  63. #endif
  64. #ifdef OS2_32
  65. #include <excpt.h>
  66. #define XCPT_SIGNAL 0xC0010003
  67. #endif
  68. #include <xmsexp.h>
  69. #include <suballoc.h>
  70. #define SIZE_PARAGRAPH 16
  71. #define XMSUMB_THRESHOLD 3 * SIZE_PARAGRAPH
  72. /** Basic Typedefs of XMS **/
  73. typedef VOID (*PFNSVC)(VOID);
  74. typedef struct _ExtMemMove {
  75. ULONG mm_len; // Move Length
  76. USHORT mm_hSource; // Source Handle
  77. ULONG mm_SourceOffset; // Source Offset
  78. USHORT mm_hDest; // Dest Handle
  79. ULONG mm_DestOffset; // Dest. offset
  80. } EXTMEMMOVE, *PEXTMEMMOVE;
  81. typedef struct _XMSUMB_ {
  82. WORD Segment;
  83. WORD Size;
  84. WORD Owner;
  85. struct _XMSUMB_ *Next;
  86. } XMSUMB, *PXMSUMB;
  87. /** Function Prototypes */
  88. VOID xmsA20 (VOID);
  89. VOID xmsAllocBlock (VOID);
  90. VOID xmsFreeBlock (VOID);
  91. VOID xmsReallocBlock (VOID);
  92. VOID xmsMoveBlock (VOID);
  93. VOID xmsSysPageSize (VOID);
  94. VOID xmsQueryExtMem (VOID);
  95. VOID xmsQueryFreeExtMem (VOID);
  96. ULONG xmsGetMemorySize (BOOL);
  97. ULONG xmsGetDefaultVDMSize (VOID);
  98. VOID xmsInitUMB (VOID);
  99. VOID xmsRequestUMB (VOID);
  100. VOID xmsReleaseUMB (VOID);
  101. VOID xmsReleaseUMBNotify (PVOID, ULONG);
  102. VOID xmsInsertUMB (PVOID, ULONG);
  103. VOID xmsNotifyHookI15 (VOID);
  104. VOID xmsDisableA20Wrapping (VOID);
  105. VOID xmsEnableA20Wrapping (VOID);
  106. NTSTATUS
  107. xmsCommitBlock(
  108. ULONG BaseAddress,
  109. ULONG Size
  110. );
  111. NTSTATUS
  112. xmsDecommitBlock(
  113. ULONG BaseAddress,
  114. ULONG Size
  115. );
  116. VOID
  117. xmsMoveMemory(
  118. ULONG Source,
  119. ULONG Destination,
  120. ULONG Count
  121. );
  122. #ifndef i386
  123. BOOL sas_manage_xms (VOID * start_addr, ULONG cb, INT a_or_f);
  124. #endif
  125. /** External Data */
  126. extern ULONG xmsMemorySize;
  127. extern BYTE * pHimemA20State;