* Sync up to trunk head (r65353).
[reactos.git] / subsystems / ntvdm / emulator.c
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: emulator.c
5 * PURPOSE: Minimal x86 machine emulator for the VDM
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #define NDEBUG
12
13 #include "emulator.h"
14
15 #include "cpu/callback.h"
16 #include "cpu/cpu.h"
17 #include "cpu/bop.h"
18 #include <isvbop.h>
19
20 #include "int32.h"
21
22 #include "clock.h"
23 #include "bios/rom.h"
24 #include "hardware/cmos.h"
25 #include "hardware/keyboard.h"
26 #include "hardware/mouse.h"
27 #include "hardware/pic.h"
28 #include "hardware/ps2.h"
29 #include "hardware/speaker.h"
30 #include "hardware/timer.h"
31 #include "hardware/vga.h"
32
33 #include "vddsup.h"
34 #include "io.h"
35
36 /* PRIVATE VARIABLES **********************************************************/
37
38 LPVOID BaseAddress = NULL;
39 BOOLEAN VdmRunning = TRUE;
40
41 static BOOLEAN A20Line = FALSE;
42 static BYTE Port61hState = 0x00;
43
44 static HANDLE InputThread = NULL;
45
46 LPCWSTR ExceptionName[] =
47 {
48 L"Division By Zero",
49 L"Debug",
50 L"Unexpected Error",
51 L"Breakpoint",
52 L"Integer Overflow",
53 L"Bound Range Exceeded",
54 L"Invalid Opcode",
55 L"FPU Not Available"
56 };
57
58 /* BOP Identifiers */
59 #define BOP_DEBUGGER 0x56 // Break into the debugger from a 16-bit app
60
61 /* PRIVATE FUNCTIONS **********************************************************/
62
63 static inline VOID
64 EmulatorMoveMemory(OUT VOID UNALIGNED *Destination,
65 IN const VOID UNALIGNED *Source,
66 IN SIZE_T Length)
67 {
68 #if 1
69 /*
70 * We use a switch here to detect small moves of memory, as these
71 * constitute the bulk of our moves.
72 * Using RtlMoveMemory for all these small moves would be slow otherwise.
73 */
74 switch (Length)
75 {
76 case 0:
77 return;
78
79 case sizeof(UCHAR):
80 *(PUCHAR)Destination = *(PUCHAR)Source;
81 return;
82
83 case sizeof(USHORT):
84 *(PUSHORT)Destination = *(PUSHORT)Source;
85 return;
86
87 case sizeof(ULONG):
88 *(PULONG)Destination = *(PULONG)Source;
89 return;
90
91 case sizeof(ULONGLONG):
92 *(PULONGLONG)Destination = *(PULONGLONG)Source;
93 return;
94
95 default:
96 #if defined(__GNUC__)
97 __builtin_memmove(Destination, Source, Length);
98 #else
99 RtlMoveMemory(Destination, Source, Length);
100 #endif
101 }
102
103 #else // defined(_MSC_VER)
104
105 PUCHAR Dest = (PUCHAR)Destination;
106 PUCHAR Src = (PUCHAR)Source;
107
108 SIZE_T Count, NewSize = Length;
109
110 /* Move dword */
111 Count = NewSize >> 2; // NewSize / sizeof(ULONG);
112 NewSize = NewSize & 3; // NewSize % sizeof(ULONG);
113 __movsd(Dest, Src, Count);
114 Dest += Count << 2; // Count * sizeof(ULONG);
115 Src += Count << 2;
116
117 /* Move word */
118 Count = NewSize >> 1; // NewSize / sizeof(USHORT);
119 NewSize = NewSize & 1; // NewSize % sizeof(USHORT);
120 __movsw(Dest, Src, Count);
121 Dest += Count << 1; // Count * sizeof(USHORT);
122 Src += Count << 1;
123
124 /* Move byte */
125 Count = NewSize; // NewSize / sizeof(UCHAR);
126 // NewSize = NewSize; // NewSize % sizeof(UCHAR);
127 __movsb(Dest, Src, Count);
128
129 #endif
130 }
131
132 VOID WINAPI EmulatorReadMemory(PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size)
133 {
134 UNREFERENCED_PARAMETER(State);
135
136 // BIG HACK!!!! To make BIOS images working correctly,
137 // until Aleksander rewrites memory management!!
138 if (Address >= 0xFFFFFFF0) Address -= 0xFFF00000;
139
140 /* If the A20 line is disabled, mask bit 20 */
141 if (!A20Line) Address &= ~(1 << 20);
142
143 /* Make sure the requested address is valid */
144 if ((Address + Size) >= MAX_ADDRESS) return;
145
146 /*
147 * Check if we are going to read the VGA memory and
148 * copy it into the virtual address space if needed.
149 */
150 if (((Address + Size) >= VgaGetVideoBaseAddress())
151 && (Address < VgaGetVideoLimitAddress()))
152 {
153 DWORD VgaAddress = max(Address, VgaGetVideoBaseAddress());
154 DWORD ActualSize = min(Address + Size - 1, VgaGetVideoLimitAddress())
155 - VgaAddress + 1;
156 LPBYTE DestBuffer = (LPBYTE)REAL_TO_PHYS(VgaAddress);
157
158 /* Read from the VGA memory */
159 VgaReadMemory(VgaAddress, DestBuffer, ActualSize);
160 }
161
162 /* Read the data from the virtual address space and store it in the buffer */
163 EmulatorMoveMemory(Buffer, REAL_TO_PHYS(Address), Size);
164 }
165
166 VOID WINAPI EmulatorWriteMemory(PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size)
167 {
168 UNREFERENCED_PARAMETER(State);
169
170 // BIG HACK!!!! To make BIOS images working correctly,
171 // until Aleksander rewrites memory management!!
172 if (Address >= 0xFFFFFFF0) Address -= 0xFFF00000;
173
174 /* If the A20 line is disabled, mask bit 20 */
175 if (!A20Line) Address &= ~(1 << 20);
176
177 /* Make sure the requested address is valid */
178 if ((Address + Size) >= MAX_ADDRESS) return;
179
180 /* Make sure we don't write to the ROM area */
181 if ((Address + Size) >= ROM_AREA_START && (Address < ROM_AREA_END)) return;
182
183 /* Read the data from the buffer and store it in the virtual address space */
184 EmulatorMoveMemory(REAL_TO_PHYS(Address), Buffer, Size);
185
186 /*
187 * Check if we modified the VGA memory.
188 */
189 if (((Address + Size) >= VgaGetVideoBaseAddress())
190 && (Address < VgaGetVideoLimitAddress()))
191 {
192 DWORD VgaAddress = max(Address, VgaGetVideoBaseAddress());
193 DWORD ActualSize = min(Address + Size - 1, VgaGetVideoLimitAddress())
194 - VgaAddress + 1;
195 LPBYTE SrcBuffer = (LPBYTE)REAL_TO_PHYS(VgaAddress);
196
197 /* Write to the VGA memory */
198 VgaWriteMemory(VgaAddress, SrcBuffer, ActualSize);
199 }
200 }
201
202 UCHAR WINAPI EmulatorIntAcknowledge(PFAST486_STATE State)
203 {
204 UNREFERENCED_PARAMETER(State);
205
206 /* Get the interrupt number from the PIC */
207 return PicGetInterrupt();
208 }
209
210 VOID EmulatorException(BYTE ExceptionNumber, LPWORD Stack)
211 {
212 WORD CodeSegment, InstructionPointer;
213 PBYTE Opcode;
214
215 ASSERT(ExceptionNumber < 8);
216
217 /* Get the CS:IP */
218 InstructionPointer = Stack[STACK_IP];
219 CodeSegment = Stack[STACK_CS];
220 Opcode = (PBYTE)SEG_OFF_TO_PTR(CodeSegment, InstructionPointer);
221
222 /* Display a message to the user */
223 DisplayMessage(L"Exception: %s occured at %04X:%04X\n"
224 L"Opcode: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X",
225 ExceptionName[ExceptionNumber],
226 CodeSegment,
227 InstructionPointer,
228 Opcode[0],
229 Opcode[1],
230 Opcode[2],
231 Opcode[3],
232 Opcode[4],
233 Opcode[5],
234 Opcode[6],
235 Opcode[7],
236 Opcode[8],
237 Opcode[9]);
238
239 Fast486DumpState(&EmulatorContext);
240
241 /* Stop the VDM */
242 EmulatorTerminate();
243 return;
244 }
245
246 VOID EmulatorTerminate(VOID)
247 {
248 /* Stop the VDM */
249 CpuUnsimulate(); // Halt the CPU
250 VdmRunning = FALSE;
251 }
252
253 VOID EmulatorInterruptSignal(VOID)
254 {
255 /* Call the Fast486 API */
256 Fast486InterruptSignal(&EmulatorContext);
257 }
258
259 VOID EmulatorSetA20(BOOLEAN Enabled)
260 {
261 A20Line = Enabled;
262 }
263
264 static VOID WINAPI EmulatorDebugBreakBop(LPWORD Stack)
265 {
266 DPRINT1("NTVDM: BOP_DEBUGGER\n");
267 DebugBreak();
268 }
269
270 static BYTE WINAPI Port61hRead(USHORT Port)
271 {
272 return Port61hState;
273 }
274
275 static VOID WINAPI Port61hWrite(USHORT Port, BYTE Data)
276 {
277 // BOOLEAN SpeakerStateChange = FALSE;
278 BYTE OldPort61hState = Port61hState;
279
280 /* Only the four lowest bytes can be written */
281 Port61hState = (Port61hState & 0xF0) | (Data & 0x0F);
282
283 if ((OldPort61hState ^ Port61hState) & 0x01)
284 {
285 DPRINT("PIT 2 Gate %s\n", Port61hState & 0x01 ? "on" : "off");
286 PitSetGate(2, !!(Port61hState & 0x01));
287 // SpeakerStateChange = TRUE;
288 }
289
290 if ((OldPort61hState ^ Port61hState) & 0x02)
291 {
292 /* There were some change for the speaker... */
293 DPRINT("Speaker %s\n", Port61hState & 0x02 ? "on" : "off");
294 // SpeakerStateChange = TRUE;
295 }
296 // if (SpeakerStateChange) SpeakerChange(Port61hState);
297 SpeakerChange(Port61hState);
298 }
299
300 static VOID WINAPI PitChan0Out(LPVOID Param, BOOLEAN State)
301 {
302 if (State)
303 {
304 DPRINT("PicInterruptRequest\n");
305 PicInterruptRequest(0); // Raise IRQ 0
306 }
307 // else < Lower IRQ 0 >
308 }
309
310 static VOID WINAPI PitChan1Out(LPVOID Param, BOOLEAN State)
311 {
312 #if 0
313 if (State)
314 {
315 /* Set bit 4 of Port 61h */
316 Port61hState |= 1 << 4;
317 }
318 else
319 {
320 /* Clear bit 4 of Port 61h */
321 Port61hState &= ~(1 << 4);
322 }
323 #else
324 Port61hState = (Port61hState & 0xEF) | (State << 4);
325 #endif
326 }
327
328 static VOID WINAPI PitChan2Out(LPVOID Param, BOOLEAN State)
329 {
330 BYTE OldPort61hState = Port61hState;
331
332 #if 0
333 if (State)
334 {
335 /* Set bit 5 of Port 61h */
336 Port61hState |= 1 << 5;
337 }
338 else
339 {
340 /* Clear bit 5 of Port 61h */
341 Port61hState &= ~(1 << 5);
342 }
343 #else
344 Port61hState = (Port61hState & 0xDF) | (State << 5);
345 #endif
346
347 if ((OldPort61hState ^ Port61hState) & 0x20)
348 {
349 DPRINT("PitChan2Out -- Port61hState changed\n");
350 SpeakerChange(Port61hState);
351 }
352 }
353
354
355 static DWORD
356 WINAPI
357 PumpConsoleInput(LPVOID Parameter)
358 {
359 HANDLE ConsoleInput = (HANDLE)Parameter;
360 INPUT_RECORD InputRecord;
361 DWORD Count;
362
363 while (VdmRunning)
364 {
365 /* Make sure the task event is signaled */
366 WaitForSingleObject(VdmTaskEvent, INFINITE);
367
368 /* Wait for an input record */
369 if (!ReadConsoleInput(ConsoleInput, &InputRecord, 1, &Count))
370 {
371 DWORD LastError = GetLastError();
372 DPRINT1("Error reading console input (0x%p, %lu) - Error %lu\n", ConsoleInput, Count, LastError);
373 return LastError;
374 }
375
376 ASSERT(Count != 0);
377
378 /* Check the event type */
379 switch (InputRecord.EventType)
380 {
381 /*
382 * Hardware events
383 */
384 case KEY_EVENT:
385 KeyboardEventHandler(&InputRecord.Event.KeyEvent);
386 break;
387
388 case MOUSE_EVENT:
389 MouseEventHandler(&InputRecord.Event.MouseEvent);
390 break;
391
392 case WINDOW_BUFFER_SIZE_EVENT:
393 ScreenEventHandler(&InputRecord.Event.WindowBufferSizeEvent);
394 break;
395
396 /*
397 * Interface events
398 */
399 case MENU_EVENT:
400 MenuEventHandler(&InputRecord.Event.MenuEvent);
401 break;
402
403 case FOCUS_EVENT:
404 FocusEventHandler(&InputRecord.Event.FocusEvent);
405 break;
406
407 default:
408 break;
409 }
410 }
411
412 return 0;
413 }
414
415 static VOID EnableExtraHardware(HANDLE ConsoleInput)
416 {
417 DWORD ConInMode;
418
419 if (GetConsoleMode(ConsoleInput, &ConInMode))
420 {
421 #if 0
422 // GetNumberOfConsoleMouseButtons();
423 // GetSystemMetrics(SM_CMOUSEBUTTONS);
424 // GetSystemMetrics(SM_MOUSEPRESENT);
425 if (MousePresent)
426 {
427 #endif
428 /* Support mouse input events if there is a mouse on the system */
429 ConInMode |= ENABLE_MOUSE_INPUT;
430 #if 0
431 }
432 else
433 {
434 /* Do not support mouse input events if there is no mouse on the system */
435 ConInMode &= ~ENABLE_MOUSE_INPUT;
436 }
437 #endif
438
439 SetConsoleMode(ConsoleInput, ConInMode);
440 }
441 }
442
443 /* PUBLIC FUNCTIONS ***********************************************************/
444
445 static VOID
446 DumpMemoryRaw(HANDLE hFile)
447 {
448 PVOID Buffer;
449 SIZE_T Size;
450
451 /* Dump the VM memory */
452 SetFilePointer(hFile, 0, NULL, FILE_BEGIN);
453 Buffer = REAL_TO_PHYS(NULL);
454 Size = MAX_ADDRESS - (ULONG_PTR)(NULL);
455 WriteFile(hFile, Buffer, Size, &Size, NULL);
456 }
457
458 static VOID
459 DumpMemoryTxt(HANDLE hFile)
460 {
461 #define LINE_SIZE 75 + 2
462 ULONG i;
463 PBYTE Ptr1, Ptr2;
464 CHAR LineBuffer[LINE_SIZE];
465 PCHAR Line;
466 SIZE_T LineSize;
467
468 /* Dump the VM memory */
469 SetFilePointer(hFile, 0, NULL, FILE_BEGIN);
470 Ptr1 = Ptr2 = REAL_TO_PHYS(NULL);
471 while (MAX_ADDRESS - (ULONG_PTR)PHYS_TO_REAL(Ptr1) > 0)
472 {
473 Ptr1 = Ptr2;
474 Line = LineBuffer;
475
476 /* Print the address */
477 Line += snprintf(Line, LINE_SIZE + LineBuffer - Line, "%08x ", PHYS_TO_REAL(Ptr1));
478
479 /* Print up to 16 bytes... */
480
481 /* ... in hexadecimal form first... */
482 i = 0;
483 while (i++ <= 0x0F && (MAX_ADDRESS - (ULONG_PTR)PHYS_TO_REAL(Ptr1) > 0))
484 {
485 Line += snprintf(Line, LINE_SIZE + LineBuffer - Line, " %02x", *Ptr1);
486 ++Ptr1;
487 }
488
489 /* ... align with spaces if needed... */
490 RtlFillMemory(Line, 0x0F + 4 - i, ' ');
491 Line += 0x0F + 4 - i;
492
493 /* ... then in character form. */
494 i = 0;
495 while (i++ <= 0x0F && (MAX_ADDRESS - (ULONG_PTR)PHYS_TO_REAL(Ptr2) > 0))
496 {
497 *Line++ = ((*Ptr2 >= 0x20 && *Ptr2 <= 0x7E) || (*Ptr2 >= 0x80 && *Ptr2 < 0xFF) ? *Ptr2 : '.');
498 ++Ptr2;
499 }
500
501 /* Newline */
502 *Line++ = '\r';
503 *Line++ = '\n';
504
505 /* Finally write the line to the file */
506 LineSize = Line - LineBuffer;
507 WriteFile(hFile, LineBuffer, LineSize, &LineSize, NULL);
508 }
509 }
510
511 VOID DumpMemory(BOOLEAN TextFormat)
512 {
513 static ULONG DumpNumber = 0;
514
515 HANDLE hFile;
516 WCHAR FileName[MAX_PATH];
517
518 /* Build a suitable file name */
519 _snwprintf(FileName, MAX_PATH,
520 L"memdump%lu.%s",
521 DumpNumber,
522 TextFormat ? L"txt" : L"dat");
523 ++DumpNumber;
524
525 DPRINT1("Creating memory dump file '%S'...\n", FileName);
526
527 /* Always create the dump file */
528 hFile = CreateFileW(FileName,
529 GENERIC_WRITE,
530 0,
531 NULL,
532 CREATE_ALWAYS,
533 FILE_ATTRIBUTE_NORMAL,
534 NULL);
535
536 if (hFile == INVALID_HANDLE_VALUE)
537 {
538 DPRINT1("Error when creating '%S' for memory dumping, GetLastError() = %u\n",
539 FileName, GetLastError());
540 return;
541 }
542
543 /* Dump the VM memory in the chosen format */
544 if (TextFormat)
545 DumpMemoryTxt(hFile);
546 else
547 DumpMemoryRaw(hFile);
548
549 /* Close the file */
550 CloseHandle(hFile);
551
552 DPRINT1("Memory dump done\n");
553 }
554
555 BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
556 {
557 /* Allocate memory for the 16-bit address space */
558 BaseAddress = HeapAlloc(GetProcessHeap(), /*HEAP_ZERO_MEMORY*/ 0, MAX_ADDRESS);
559 if (BaseAddress == NULL)
560 {
561 wprintf(L"FATAL: Failed to allocate VDM memory.\n");
562 return FALSE;
563 }
564 /*
565 * For diagnostics purposes, we fill the memory with INT 0x03 codes
566 * so that if a program wants to execute random code in memory, we can
567 * retrieve the exact CS:IP where the problem happens.
568 */
569 RtlFillMemory(BaseAddress, MAX_ADDRESS, 0xCC);
570
571 /* Initialize I/O ports */
572 /* Initialize RAM */
573
574 /* Initialize the CPU */
575
576 /* Initialize the internal clock */
577 if (!ClockInitialize())
578 {
579 wprintf(L"FATAL: Failed to initialize the clock\n");
580 return FALSE;
581 }
582
583 /* Initialize the CPU */
584 CpuInitialize();
585 // Fast486Initialize(&EmulatorContext,
586 // EmulatorReadMemory,
587 // EmulatorWriteMemory,
588 // EmulatorReadIo,
589 // EmulatorWriteIo,
590 // NULL,
591 // EmulatorBiosOperation,
592 // EmulatorIntAcknowledge,
593 // NULL /* TODO: Use a TLB */);
594
595 /* Initialize DMA */
596
597 /* Initialize the PIC, the PIT, the CMOS and the PC Speaker */
598 PicInitialize();
599 PitInitialize();
600 CmosInitialize();
601 SpeakerInitialize();
602
603 /* Set output functions */
604 PitSetOutFunction(0, NULL, PitChan0Out);
605 PitSetOutFunction(1, NULL, PitChan1Out);
606 PitSetOutFunction(2, NULL, PitChan2Out);
607
608 /* Register the I/O Ports */
609 RegisterIoPort(CONTROL_SYSTEM_PORT61H, Port61hRead, Port61hWrite);
610
611 /* Set the console input mode */
612 // FIXME: Activate ENABLE_WINDOW_INPUT when we will want to perform actions
613 // upon console window events (screen buffer resize, ...).
614 SetConsoleMode(ConsoleInput, ENABLE_PROCESSED_INPUT /* | ENABLE_WINDOW_INPUT */);
615 // SetConsoleMode(ConsoleOutput, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
616
617 /**/EnableExtraHardware(ConsoleInput);/**/
618
619 /* Initialize the PS/2 port */
620 PS2Initialize();
621
622 /* Initialize the keyboard and mouse and connect them to their PS/2 ports */
623 KeyboardInit(0);
624 MouseInit(1);
625
626 /**************** ATTACH INPUT WITH CONSOLE *****************/
627 /* Start the input thread */
628 InputThread = CreateThread(NULL, 0, &PumpConsoleInput, ConsoleInput, 0, NULL);
629 if (InputThread == NULL)
630 {
631 DisplayMessage(L"Failed to create the console input thread.");
632 return FALSE;
633 }
634 /************************************************************/
635
636 /* Initialize the VGA */
637 if (!VgaInitialize(ConsoleOutput))
638 {
639 DisplayMessage(L"Failed to initialize VGA support.");
640 return FALSE;
641 }
642
643 /* Initialize the software callback system and register the emulator BOPs */
644 InitializeInt32();
645 RegisterBop(BOP_DEBUGGER , EmulatorDebugBreakBop);
646 // RegisterBop(BOP_UNSIMULATE, CpuUnsimulateBop);
647
648 /* Initialize VDD support */
649 VDDSupInitialize();
650
651 return TRUE;
652 }
653
654 VOID EmulatorCleanup(VOID)
655 {
656 VgaCleanup();
657
658 /* Close the input thread handle */
659 if (InputThread != NULL) CloseHandle(InputThread);
660 InputThread = NULL;
661
662 PS2Cleanup();
663
664 SpeakerCleanup();
665 CmosCleanup();
666 // PitCleanup();
667 // PicCleanup();
668
669 CpuCleanup();
670
671 /* Free the memory allocated for the 16-bit address space */
672 if (BaseAddress != NULL) HeapFree(GetProcessHeap(), 0, BaseAddress);
673 }
674
675
676
677 VOID
678 WINAPI
679 VDDSimulate16(VOID)
680 {
681 CpuSimulate();
682 }
683
684 VOID
685 WINAPI
686 VDDTerminateVDM(VOID)
687 {
688 /* Stop the VDM */
689 EmulatorTerminate();
690 }
691
692 PBYTE
693 WINAPI
694 Sim32pGetVDMPointer(IN ULONG Address,
695 IN BOOLEAN ProtectedMode)
696 {
697 // FIXME
698 UNREFERENCED_PARAMETER(ProtectedMode);
699
700 /*
701 * HIWORD(Address) == Segment (if ProtectedMode == FALSE)
702 * or Selector (if ProtectedMode == TRUE )
703 * LOWORD(Address) == Offset
704 */
705 return (PBYTE)FAR_POINTER(Address);
706 }
707
708 PBYTE
709 WINAPI
710 MGetVdmPointer(IN ULONG Address,
711 IN ULONG Size,
712 IN BOOLEAN ProtectedMode)
713 {
714 UNREFERENCED_PARAMETER(Size);
715 return Sim32pGetVDMPointer(Address, ProtectedMode);
716 }
717
718 PVOID
719 WINAPI
720 VdmMapFlat(IN USHORT Segment,
721 IN ULONG Offset,
722 IN VDM_MODE Mode)
723 {
724 // FIXME
725 UNREFERENCED_PARAMETER(Mode);
726
727 return SEG_OFF_TO_PTR(Segment, Offset);
728 }
729
730 BOOL
731 WINAPI
732 VdmFlushCache(IN USHORT Segment,
733 IN ULONG Offset,
734 IN ULONG Size,
735 IN VDM_MODE Mode)
736 {
737 // FIXME
738 UNIMPLEMENTED;
739 return TRUE;
740 }
741
742 BOOL
743 WINAPI
744 VdmUnmapFlat(IN USHORT Segment,
745 IN ULONG Offset,
746 IN PVOID Buffer,
747 IN VDM_MODE Mode)
748 {
749 // FIXME
750 UNIMPLEMENTED;
751 return TRUE;
752 }
753
754 /* EOF */