[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 #include <windows.h>
19
20 #include <debug.h>
21
22 /* DEFINES ********************************************************************/
23
24 #define TO_LINEAR(seg, off) (((seg) << 4) + (off))
25 #define MAX_SEGMENT 0xFFFF
26 #define MAX_OFFSET 0xFFFF
27 #define MAX_ADDRESS TO_LINEAR(MAX_SEGMENT, MAX_OFFSET)
28
29 #define FAR_POINTER(x) \
30 (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x)))
31
32 #define SEG_OFF_TO_PTR(seg, off) \
33 (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off)))
34
35 #define STEPS_PER_CYCLE 256
36
37 /* FUNCTIONS ******************************************************************/
38
39 extern LPVOID BaseAddress;
40 extern BOOLEAN VdmRunning;
41 extern LPCWSTR ExceptionName[];
42
43 VOID DisplayMessage(LPCWSTR Format, ...);
44
45 #endif // _NTVDM_H_
46
47 /* EOF */