[NTVDM]
[reactos.git] / subsystems / ntvdm / ntvdm.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: ntvdm.h
5 * PURPOSE: Header file to define commonly used stuff
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9 #ifndef _NTVDM_H_
10 #define _NTVDM_H_
11
12 /* INCLUDES *******************************************************************/
13
14 #include <stdio.h>
15 #include <stdarg.h>
16 #include <conio.h>
17
18 #define WIN32_NO_STATUS
19 #include <windef.h>
20 #include <winbase.h>
21 #include <wingdi.h>
22 #include <wincon.h>
23 #include <winnls.h>
24 #include <winuser.h>
25
26 #include <debug.h>
27
28 /* DEFINES ********************************************************************/
29
30 #define TO_LINEAR(seg, off) (((seg) << 4) + (off))
31 #define MAX_SEGMENT 0xFFFF
32 #define MAX_OFFSET 0xFFFF
33 #define MAX_ADDRESS 0x1000000 // 16 MB of RAM
34
35 #define FAR_POINTER(x) \
36 (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x)))
37
38 #define SEG_OFF_TO_PTR(seg, off) \
39 (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off)))
40
41 #define STEPS_PER_CYCLE 256
42
43 /* FUNCTIONS ******************************************************************/
44
45 extern LPVOID BaseAddress;
46 extern BOOLEAN VdmRunning;
47
48 VOID DisplayMessage(LPCWSTR Format, ...);
49
50 #endif // _NTVDM_H_
51
52 /* EOF */