[NTVDM]
[reactos.git] / reactos / subsystems / mvdm / ntvdm / dos / dos32krnl / himem.h
1 /*
2 * COPYRIGHT: GPLv2+ - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: himem.h
5 * PURPOSE: DOS XMS Driver
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9 /* DEFINITIONS ****************************************************************/
10
11 #define XMS_ADDRESS 0x110000
12 #define XMS_BLOCKS 0x37C0
13 #define XMS_BLOCK_SIZE 1024
14 #define XMS_MAX_HANDLES 16
15
16 #define XMS_STATUS_SUCCESS 0x00
17 #define XMS_STATUS_NOT_IMPLEMENTED 0x80
18 #define XMS_STATUS_A20_ERROR 0x82
19 #define XMS_STATUS_HMA_IN_USE 0x91
20 #define XMS_STATUS_OUT_OF_MEMORY 0xA0
21 #define XMS_STATUS_OUT_OF_HANDLES 0xA1
22 #define XMS_STATUS_INVALID_HANDLE 0xA2
23 #define XMS_STATUS_BAD_SRC_HANDLE 0xA3
24 #define XMS_STATUS_BAD_DEST_HANDLE 0xA4
25 #define XMS_STATUS_BAD_SRC_OFFSET 0xA5
26 #define XMS_STATUS_BAD_DEST_OFFSET 0xA6
27 #define XMS_STATUS_NOT_LOCKED 0xAA
28 #define XMS_STATUS_LOCKED 0xAB
29 #define XMS_STATUS_LOCK_OVERFLOW 0xAC
30 #define XMS_STATUS_CANNOT_LOCK 0xAD
31
32 typedef struct _XMS_HANDLE
33 {
34 BYTE Handle;
35 BYTE LockCount;
36 WORD Size;
37 DWORD Address;
38 } XMS_HANDLE, *PXMS_HANDLE;
39
40 #pragma pack(push, 1)
41 typedef struct _XMS_COPY_DATA
42 {
43 DWORD Count;
44 WORD SourceHandle;
45 DWORD SourceOffset;
46 WORD DestHandle;
47 DWORD DestOffset;
48 } XMS_COPY_DATA, *PXMS_COPY_DATA;
49 #pragma pack(pop)
50
51 /* FUNCTIONS ******************************************************************/
52
53 BOOLEAN XmsGetDriverEntry(PDWORD Pointer);
54 VOID XmsInitialize(VOID);
55 VOID XmsCleanup(VOID);