Use free Windows DDK and compile with latest MinGW releases.
[reactos.git] / reactos / ntoskrnl / nt / vdm.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/nt/vdm.c
5 * PURPOSE: Virtual DOS machine support
6 * PROGRAMMER: David Welch (welch@mcmail.com)
7 * UPDATE HISTORY:
8 * Created 22/05/98
9 */
10
11 /* INCLUDES *****************************************************************/
12
13 #include <ntoskrnl.h>
14
15 #define NDEBUG
16 #include <internal/debug.h>
17
18
19 /* GLOBALS *******************************************************************/
20
21 static UCHAR OrigIVT[1024];
22 static UCHAR OrigBDA[256];
23 /* static UCHAR OrigEBDA[]; */
24
25 /* FUNCTIONS *****************************************************************/
26
27 VOID
28 NtEarlyInitVdm(VOID)
29 {
30 /*
31 * Save various BIOS data tables. At this point the lower 4MB memory
32 * map is still active so we can just copy the data from low memory.
33 */
34 memcpy(OrigIVT, (PVOID)0x0, 1024);
35 memcpy(OrigBDA, (PVOID)0x400, 256);
36 }
37
38 NTSTATUS STDCALL
39 NtVdmControl(IN ULONG ControlCode,
40 IN PVOID ControlData)
41 {
42 switch (ControlCode)
43 {
44 case 0:
45 memcpy(ControlData, OrigIVT, 1024);
46 break;
47
48 case 1:
49 memcpy(ControlData, OrigBDA, 256);
50 break;
51 }
52 return(STATUS_SUCCESS);
53 }
54
55 /* EOF */