Author: hbelusca
Date: Sun Apr 19 00:01:03 2015
New Revision: 67283
URL:
http://svn.reactos.org/svn/reactos?rev=67283&view=rev
Log:
[NTVDM]
- Rearrange header inclusions. Put almost all NDK stuff in ntvdm.h.
- sizeof(array)/sizeof(array[0]) --> ARRAYSIZE(array) : increase code readability.
- Use Rtl heap functions (other parts of the code already did use them).
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32p.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.h
trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.h
trunk/reactos/subsystems/mvdm/ntvdm/clock.c
trunk/reactos/subsystems/mvdm/ntvdm/clock.h
trunk/reactos/subsystems/mvdm/ntvdm/cpu/bop.c
trunk/reactos/subsystems/mvdm/ntvdm/cpu/callback.c
trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.c
trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.h
trunk/reactos/subsystems/mvdm/ntvdm/cpu/registers.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.h
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.h
trunk/reactos/subsystems/mvdm/ntvdm/emulator.c
trunk/reactos/subsystems/mvdm/ntvdm/emulator.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h
trunk/reactos/subsystems/mvdm/ntvdm/int32.c
trunk/reactos/subsystems/mvdm/ntvdm/io.c
trunk/reactos/subsystems/mvdm/ntvdm/memory.c
trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c
trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h
trunk/reactos/subsystems/mvdm/ntvdm/utils.c
trunk/reactos/subsystems/mvdm/ntvdm/utils.h
trunk/reactos/subsystems/mvdm/ntvdm/vddsup.c
trunk/reactos/subsystems/mvdm/ntvdm/vddsup.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "memory.h"
#include "cpu/callback.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,7 +11,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
#include "kbdbios.h"
#include "vidbios.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -13,6 +13,7 @@
/* For BIOS Version number */
#include <reactos/buildno.h>
+#include "ntvdm.h"
#include "emulator.h"
#include "cpu/cpu.h" // for EMULATOR_FLAG_CF
#include "cpu/bop.h"
@@ -32,9 +33,6 @@
#include "hardware/cmos.h"
#include "hardware/pic.h"
#include "hardware/pit.h"
-
-/* Extra PSDK/NDK Headers */
-#include <ndk/kefuncs.h>
/* PRIVATE VARIABLES **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,7 +11,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
// #include <bios/bios.h>
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32p.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32p.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,7 +11,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
#include <bios/bios.h>
/**/ #include "int32.h" /**/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,10 +10,9 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "bios/bios32/bios32p.h"
-#include <ndk/rtltypes.h>
-#include <ndk/rtlfuncs.h>
#include "ems.h"
#include "memory.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,14 +10,14 @@
#define NDEBUG
-#include "emulator.h"
-#include "cpu/cpu.h" // for EMULATOR_FLAG_ZF
-#include "int32.h"
+#include "ntvdm.h"
#include "kbdbios32.h"
#include <bios/kbdbios.h>
#include "bios32p.h"
+#include "int32.h"
+#include "cpu/cpu.h" // for EMULATOR_FLAG_ZF
#include "io.h"
#include "hardware/ps2.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -8,10 +8,6 @@
#ifndef _KBDBIOS32_H_
#define _KBDBIOS32_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "moubios32.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -8,10 +8,6 @@
#ifndef _MOUBIOS32_H_
#define _MOUBIOS32_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -12,7 +12,7 @@
#define NDEBUG
-#include "emulator.h"
+#include "ntvdm.h"
#include "int32.h"
#include "vidbios32.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/vidbios32.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,10 +11,6 @@
#ifndef _VIDBIOS32_H_
#define _VIDBIOS32_H_
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
-
/* DEFINES ********************************************************************/
// #define BIOS_VIDEO_INTERRUPT 0x10
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "cpu/bop.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/kbdbios.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -8,10 +8,6 @@
#ifndef _KBDBIOS_H_
#define _KBDBIOS_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,11 +10,12 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "cpu/callback.h"
+#include "rom.h"
+
#include "utils.h"
-
-#include "rom.h"
/* PRIVATE FUNCTIONS **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/rom.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -8,10 +8,6 @@
#ifndef _ROM_H_
#define _ROM_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "cpu/cpu.h"
#include "cpu/bop.h"
@@ -2235,13 +2236,13 @@
{
/* VGA modes */
Palette = VgaPalette;
- Size = sizeof(VgaPalette)/sizeof(VgaPalette[0]);
+ Size = ARRAYSIZE(VgaPalette);
}
else if (ModeNumber == 0x10) // || (ModeNumber == 0x0D) || (ModeNumber == 0x0E)
{
/* EGA HiRes mode */
Palette = EgaPalette__HiRes;
- Size = sizeof(EgaPalette__HiRes)/sizeof(EgaPalette__HiRes[0]);
+ Size = ARRAYSIZE(EgaPalette__HiRes);
}
#if 0
else if ((ModeNumber == 0x04) || (ModeNumber == 0x05))
@@ -2251,14 +2252,14 @@
* bright versions of CGA palettes 0 and 1
*/
Palette = CgaPalette2;
- Size = sizeof(CgaPalette2)/sizeof(CgaPalette2[0]);
+ Size = ARRAYSIZE(CgaPalette2);
}
#endif
else // if ((ModeNumber == 0x0D) || (ModeNumber == 0x0E))
{
/* EGA modes */
Palette = EgaPalette__16Colors;
- Size = sizeof(EgaPalette__16Colors)/sizeof(EgaPalette__16Colors[0]);
+ Size = ARRAYSIZE(EgaPalette__16Colors);
}
VgaSetPalette(Palette, Size);
@@ -2388,7 +2389,7 @@
/* Retrieve the real mode number and check its validity */
ModeNumber &= 0x7F;
- // if (ModeNumber >= sizeof(VideoModes)/sizeof(VideoModes[0]))
+ // if (ModeNumber >= ARRAYSIZE(VideoModes))
if (ModeNumber > BIOS_MAX_VIDEO_MODE)
{
DPRINT1("VidBiosSetVideoMode -- Mode %02Xh invalid\n", ModeNumber);
@@ -3045,7 +3046,7 @@
// FIXME: Use BL and DL for the number of screen rows
/* Write the default font to the VGA font plane */
- VgaWriteFont(0, Font8x8, sizeof(Font8x8)/sizeof(Font8x8[0]) /
VGA_FONT_CHARACTERS);
+ VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
/* Update the BIOS INT 43h vector */
// Far pointer to the 8x8 characters 00h-...
@@ -3060,7 +3061,7 @@
// FIXME: Use BL and DL for the number of screen rows
/* Write the default font to the VGA font plane */
- VgaWriteFont(0, Font8x16, sizeof(Font8x16)/sizeof(Font8x16[0]) /
VGA_FONT_CHARACTERS);
+ VgaWriteFont(0, Font8x16, ARRAYSIZE(Font8x16) /
VGA_FONT_CHARACTERS);
/* Update the BIOS INT 43h vector */
// Far pointer to the 8x16 characters 00h-...
@@ -3293,7 +3294,7 @@
Font8x14, sizeof(Font8x14));
/* Write the default font to the VGA font plane */
- VgaWriteFont(0, Font8x16, sizeof(Font8x16)/sizeof(Font8x16[0]) /
VGA_FONT_CHARACTERS);
+ VgaWriteFont(0, Font8x16, ARRAYSIZE(Font8x16) / VGA_FONT_CHARACTERS);
//
// FIXME: At the moment we always set a VGA mode. In the future,
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/vidbios.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -9,10 +9,6 @@
#ifndef _VIDBIOS_H_
#define _VIDBIOS_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/clock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cloc…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/clock.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/clock.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,19 +11,16 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "clock.h"
+
#include "cpu/cpu.h"
-
-#include "clock.h"
-
#include "hardware/cmos.h"
#include "hardware/ps2.h"
#include "hardware/pit.h"
#include "hardware/video/vga.h"
#include "hardware/mouse.h"
-
-/* Extra PSDK/NDK Headers */
-#include <ndk/kefuncs.h>
/* DEFINES ********************************************************************/
@@ -128,7 +125,7 @@
{
PHARDWARE_TIMER Timer;
- Timer = (PHARDWARE_TIMER)RtlAllocateHeap(RtlGetProcessHeap(), 0,
sizeof(HARDWARE_TIMER));
+ Timer = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(*Timer));
if (Timer == NULL) return NULL;
Timer->Flags = Flags & ~HARDWARE_TIMER_ENABLED;
Modified: trunk/reactos/subsystems/mvdm/ntvdm/clock.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cloc…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/clock.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/clock.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -9,8 +9,6 @@
#ifndef _CLOCK_H_
#define _CLOCK_H_
-
-#include <ndk/rtlfuncs.h>
/* DEFINITIONS ****************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/cpu/bop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cpu/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/cpu/bop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/cpu/bop.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "bop.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/cpu/callback.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cpu/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/cpu/callback.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/cpu/callback.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -19,10 +19,11 @@
#define NDEBUG
+#include "ntvdm.h"
+#include "emulator.h"
+#include "callback.h"
+
#include "cpu.h"
-#include "callback.h"
-#include "emulator.h"
-
#include "bop.h"
#include <isvbop.h>
Modified: trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cpu/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,14 +10,14 @@
#define NDEBUG
+#include "ntvdm.h"
+#include "emulator.h"
#include "cpu.h"
-#include "emulator.h"
#include "memory.h"
#include "callback.h"
#include "bop.h"
#include <isvbop.h>
-#include <pseh/pseh2.h>
#include "clock.h"
#include "bios/rom.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cpu/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/cpu/cpu.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,7 +11,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
#include <fast486.h>
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/cpu/registers.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cpu/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/cpu/registers.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/cpu/registers.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "cpu.h"
#include "x86context.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -14,6 +14,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "utils.h"
@@ -22,9 +23,6 @@
#include "bios/bios.h"
#include "mouse32.h"
-
-/* Extra PSDK/NDK Headers */
-#include <ndk/obtypes.h>
/* PRIVATE VARIABLES **********************************************************/
@@ -201,7 +199,7 @@
CHAR Desktop[MAX_PATH];
CHAR Title[MAX_PATH];
ULONG EnvSize = 256;
- PVOID Env = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, EnvSize);
+ PVOID Env = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, EnvSize);
UNREFERENCED_PARAMETER(Parameter);
ASSERT(Env != NULL);
@@ -236,7 +234,7 @@
{
/* Expand the environment size */
EnvSize = CommandInfo.EnvLen;
- CommandInfo.Env = Env = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
Env, EnvSize);
+ CommandInfo.Env = Env = RtlReAllocateHeap(RtlGetProcessHeap(),
HEAP_ZERO_MEMORY, Env, EnvSize);
/* Repeat the request */
goto Command;
@@ -259,7 +257,7 @@
}
while (AcceptCommands);
- HeapFree(GetProcessHeap(), 0, Env);
+ RtlFreeHeap(RtlGetProcessHeap(), 0, Env);
return 0;
}
#endif
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dem.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -15,7 +15,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
#include "dos32krnl/dos.h"
/* FUNCTIONS ******************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "int32.h"
@@ -221,7 +222,7 @@
Stream = _wfopen(DOS_CONFIG_PATH, L"r");
if (Stream != NULL)
{
- while (fgetws(Buffer, sizeof(Buffer)/sizeof(Buffer[0]), Stream))
+ while (fgetws(Buffer, ARRAYSIZE(Buffer), Stream))
{
// TODO: Parse the line
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "dos.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,11 +10,13 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "device.h"
+
#include "dos.h"
#include "dos/dem.h"
#include "memory.h"
-#include "device.h"
/* PRIVATE VARIABLES **********************************************************/
@@ -212,9 +214,7 @@
return FALSE;
}
- Node = (PDOS_DEVICE_NODE)RtlAllocateHeap(RtlGetProcessHeap(),
- HEAP_ZERO_MEMORY,
- sizeof(DOS_DEVICE_NODE));
+ Node = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*Node));
if (Node == NULL) return NULL;
Node->DeviceAttributes = Attributes;
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -8,8 +8,6 @@
#ifndef _DEVICE_H_
#define _DEVICE_H_
-
-#include <ndk/rtlfuncs.h>
/* DEFINITIONS ****************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "cpu/cpu.h"
#include "int32.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,7 +11,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
#include "device.h"
/**/ #include "int32.h" /**/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "../../memory.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -9,6 +9,8 @@
/* INCLUDES *******************************************************************/
#define NDEBUG
+
+#include "ntvdm.h"
#include "dos.h"
#include "dos/dem.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,11 +10,12 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "memory.h"
#include "dos.h"
#include "dos/dem.h"
-#include "memory.h"
/* PUBLIC VARIABLES ***********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,7 +10,9 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+
#include "cpu/cpu.h"
#include "int32.h"
#include "hardware/mouse.h"
@@ -187,7 +189,7 @@
setDI(DI);
}
- for (i = 0; i < sizeof(DriverState.Handlers)/sizeof(DriverState.Handlers[0]);
++i)
+ for (i = 0; i < ARRAYSIZE(DriverState.Handlers); ++i)
{
/* Call the suitable handlers */
if ((DriverState.Handlers[i].CallMask & CallMask) != 0 &&
@@ -654,7 +656,7 @@
* Find the handler entry corresponding to the given
* callback and undefine it.
*/
- for (i = 0; i <
sizeof(DriverState.Handlers)/sizeof(DriverState.Handlers[0]); ++i)
+ for (i = 0; i < ARRAYSIZE(DriverState.Handlers); ++i)
{
if (DriverState.Handlers[i].Callback == Callback)
{
@@ -672,7 +674,7 @@
* Find the handler entry corresponding to the given
* callmask and undefine it.
*/
- for (i = 0; i <
sizeof(DriverState.Handlers)/sizeof(DriverState.Handlers[0]); ++i)
+ for (i = 0; i < ARRAYSIZE(DriverState.Handlers); ++i)
{
if (DriverState.Handlers[i].CallMask == CallMask)
{
@@ -694,7 +696,7 @@
USHORT EmptyHandler = 0xFFFF; // Invalid handler
- for (i = 0; i <
sizeof(DriverState.Handlers)/sizeof(DriverState.Handlers[0]); ++i)
+ for (i = 0; i < ARRAYSIZE(DriverState.Handlers); ++i)
{
/* Find the first empty handler */
if (EmptyHandler == 0xFFFF &&
@@ -719,7 +721,7 @@
* an empty handler, set it.
*/
if (!Success && EmptyHandler != 0xFFFF
- /* && EmptyHandler <
sizeof(DriverState.Handlers)/sizeof(DriverState.Handlers[0]) */)
+ /* && EmptyHandler < ARRAYSIZE(DriverState.Handlers) */)
{
DriverState.Handlers[EmptyHandler].CallMask = CallMask;
DriverState.Handlers[EmptyHandler].Callback = Callback;
@@ -744,7 +746,7 @@
/*
* Find the handler entry corresponding to the given callmask.
*/
- for (i = 0; i <
sizeof(DriverState.Handlers)/sizeof(DriverState.Handlers[0]); ++i)
+ for (i = 0; i < ARRAYSIZE(DriverState.Handlers); ++i)
{
if (DriverState.Handlers[i].CallMask == CallMask)
{
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -8,10 +8,6 @@
#ifndef _MOUSE32_H_
#define _MOUSE32_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emul…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "memory.h"
@@ -34,10 +35,6 @@
#include "vddsup.h"
#include "io.h"
-
-/* Extra PSDK/NDK Headers */
-#include <ndk/psfuncs.h>
-#include <ndk/mmfuncs.h>
/* PRIVATE VARIABLES **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emul…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/emulator.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,7 +11,6 @@
/* INCLUDES *******************************************************************/
-#include "ntvdm.h"
#include <fast486.h>
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "cmos.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -8,10 +8,6 @@
#ifndef _CMOS_H_
#define _CMOS_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -11,9 +11,11 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "dma.h"
+
#include "io.h"
-#include "dma.h"
/* PRIVATE VARIABLES **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/dma.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -9,10 +9,6 @@
#ifndef _DMA_H_
#define _DMA_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "keyboard.h"
#include "ps2.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/keyboard.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -8,10 +8,6 @@
#ifndef _KEYBOARD_H_
#define _KEYBOARD_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,8 +10,10 @@
#define NDEBUG
+#include "ntvdm.h"
#include "mouse.h"
#include "ps2.h"
+
#include "clock.h"
#include "video/vga.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -8,10 +8,6 @@
#ifndef _MOUSE_H_
#define _MOUSE_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -11,9 +11,11 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "pic.h"
+
#include "io.h"
-#include "pic.h"
/* PRIVATE VARIABLES **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/pic.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -9,10 +9,6 @@
#ifndef _PIC_H_
#define _PIC_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -12,9 +12,11 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "pit.h"
+
#include "io.h"
-#include "pit.h"
#include "pic.h"
#include "clock.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -10,10 +10,6 @@
#ifndef _PIT_H_
#define _PIT_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -11,9 +11,11 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "ps2.h"
+
#include "io.h"
-#include "ps2.h"
#include "pic.h"
#include "clock.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.h [iso-8859-1] Sun Apr 19 00:01:03
2015
@@ -9,10 +9,6 @@
#ifndef _PS2_H_
#define _PS2_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,17 +10,12 @@
#define NDEBUG
-#include "emulator.h"
+#include "ntvdm.h"
#include "speaker.h"
#include "hardware/pit.h"
/* Extra PSDK/NDK Headers */
#include <ndk/iofuncs.h>
-#include <ndk/obfuncs.h>
-#include <ndk/rtlfuncs.h>
-
-/* Extra PSDK/NDK Headers */
-#include <ndk/kefuncs.h>
/* DDK Driver Headers */
#include <ntddbeep.h>
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/sound/speaker.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -9,12 +9,6 @@
#ifndef _SPEAKER_H_
#define _SPEAKER_H_
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
-
-/* DEFINES ********************************************************************/
-
/* FUNCTIONS ******************************************************************/
VOID SpeakerChange(UCHAR Port61hValue);
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "vga.h"
#include <bios/vidbios.h>
@@ -356,26 +357,26 @@
VDMBufferSize = dwVDMBufferSize;
/* HACK: Cache -- to be removed in the real implementation */
- CharBuff = HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- VDMBufferSize.X * VDMBufferSize.Y
- * sizeof(CHAR_INFO));
+ CharBuff = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ VDMBufferSize.X * VDMBufferSize.Y
+ * sizeof(*CharBuff));
ASSERT(CharBuff);
- VDMBuffer = HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- VDMBufferSize.X * VDMBufferSize.Y
- * sizeof(CHAR_CELL));
+ VDMBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ VDMBufferSize.X * VDMBufferSize.Y
+ * sizeof(*VDMBuffer));
*lpVDMBuffer = VDMBuffer;
return (VDMBuffer != NULL);
}
else
{
/* HACK: Cache -- to be removed in the real implementation */
- if (CharBuff) HeapFree(GetProcessHeap(), 0, CharBuff);
+ if (CharBuff) RtlFreeHeap(RtlGetProcessHeap(), 0, CharBuff);
CharBuff = NULL;
- if (VDMBuffer) HeapFree(GetProcessHeap(), 0, VDMBuffer);
+ if (VDMBuffer) RtlFreeHeap(RtlGetProcessHeap(), 0, VDMBuffer);
VDMBuffer = NULL;
VDMBufferSize.X = VDMBufferSize.Y = 0;
@@ -500,10 +501,10 @@
}
#ifdef USE_REAL_REGISTERCONSOLEVDM
- CharBuff = HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- TextResolution.X * TextResolution.Y
- * sizeof(CHAR_INFO));
+ CharBuff = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ TextResolution.X * TextResolution.Y
+ * sizeof(*CharBuff));
ASSERT(CharBuff);
#endif
@@ -568,7 +569,7 @@
}
#ifdef USE_REAL_REGISTERCONSOLEVDM
- if (CharBuff) HeapFree(GetProcessHeap(), 0, CharBuff);
+ if (CharBuff) RtlFreeHeap(RtlGetProcessHeap(), 0, CharBuff);
#endif
VgaUpdateCursorPosition();
@@ -773,14 +774,14 @@
LPLOGPALETTE Palette, TextPalette;
/* Allocate storage space for the palettes */
- Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- sizeof(LOGPALETTE) +
- VGA_MAX_COLORS * sizeof(PALETTEENTRY));
- TextPalette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- sizeof(LOGPALETTE) +
- (VGA_AC_PAL_F_REG + 1) *
sizeof(PALETTEENTRY));
+ Palette = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ sizeof(LOGPALETTE) +
+ VGA_MAX_COLORS * sizeof(PALETTEENTRY));
+ TextPalette = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ sizeof(LOGPALETTE) +
+ (VGA_AC_PAL_F_REG + 1) * sizeof(PALETTEENTRY));
if ((Palette == NULL) || (TextPalette == NULL)) goto Cleanup;
/* Initialize the palettes */
@@ -813,8 +814,8 @@
Cleanup:
/* Free the palettes */
- if (Palette) HeapFree(GetProcessHeap(), 0, Palette);
- if (TextPalette) HeapFree(GetProcessHeap(), 0, TextPalette);
+ if (Palette) RtlFreeHeap(RtlGetProcessHeap(), 0, Palette);
+ if (TextPalette) RtlFreeHeap(RtlGetProcessHeap(), 0, TextPalette);
if (!Result)
{
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.h [iso-8859-1] Sun Apr 19
00:01:03 2015
@@ -8,10 +8,6 @@
#ifndef _VGA_H_
#define _VGA_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* DEFINES ********************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/int32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/int3…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/int32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/int32.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "int32.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/io.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/io.c…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/io.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/io.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -11,6 +11,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "io.h"
Modified: trunk/reactos/subsystems/mvdm/ntvdm/memory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/memo…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/memory.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/memory.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,10 +10,12 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
+#include "memory.h"
+
+/* Extra PSDK/NDK Headers */
#include <ndk/mmfuncs.h>
-#include <ndk/rtlfuncs.h>
-#include "memory.h"
/* PRIVATE VARIABLES **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/ntvd…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -12,9 +12,9 @@
#include "ntvdm.h"
#include "emulator.h"
+
+#include "bios/bios.h"
#include "cpu/cpu.h"
-
-#include "bios/bios.h"
#include "resource.h"
@@ -85,7 +85,7 @@
if (LoadStringW(GetModuleHandle(NULL),
Items[i].uID,
szMenuString,
- sizeof(szMenuString) / sizeof(szMenuString[0])) > 0)
+ ARRAYSIZE(szMenuString)) > 0)
{
if (Items[i].SubMenu != NULL)
{
@@ -169,7 +169,7 @@
if (LoadStringW(GetModuleHandle(NULL),
(!ShowPtr ? IDS_SHOW_MOUSE : IDS_HIDE_MOUSE),
szMenuString,
- sizeof(szMenuString) / sizeof(szMenuString[0])) > 0)
+ ARRAYSIZE(szMenuString)) > 0)
{
ModifyMenu(hConsoleMenu, ID_SHOWHIDE_MOUSE,
MF_BYCOMMAND, ID_SHOWHIDE_MOUSE, szMenuString);
@@ -226,9 +226,9 @@
* an auxiliary buffer; otherwise use the static buffer.
*/
MsgLen = _vscwprintf(Format, Parameters) + 1; // NULL-terminated
- if (MsgLen > sizeof(StaticBuffer)/sizeof(StaticBuffer[0]))
- {
- Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MsgLen * sizeof(WCHAR));
+ if (MsgLen > ARRAYSIZE(StaticBuffer))
+ {
+ Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, MsgLen *
sizeof(WCHAR));
if (Buffer == NULL)
{
/* Allocation failed, use the static buffer and display a suitable error
message */
@@ -238,7 +238,7 @@
}
}
#else
- MsgLen = sizeof(Buffer)/sizeof(Buffer[0]);
+ MsgLen = ARRAYSIZE(Buffer);
#endif
/* Display the message */
@@ -248,7 +248,7 @@
#ifndef WIN2K_COMPLIANT
/* Free the buffer if needed */
- if (Buffer != StaticBuffer) HeapFree(GetProcessHeap(), 0, Buffer);
+ if (Buffer != StaticBuffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
#endif
va_end(Parameters);
Modified: trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/ntvd…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/ntvdm.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -13,9 +13,9 @@
#include <stdio.h>
#include <stdarg.h>
-#include <conio.h>
#include <wchar.h>
+/* PSDK/NDK Headers */
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
@@ -29,6 +29,15 @@
#include <vddsvc.h>
DWORD WINAPI SetLastConsoleEventActive(VOID);
+
+#define NTOS_MODE_USER
+#include <ndk/kefuncs.h>
+#include <ndk/obfuncs.h>
+#include <ndk/rtlfuncs.h>
+#include <ndk/rtltypes.h>
+
+/* PSEH for SEH Support */
+#include <pseh/pseh2.h>
#include <debug.h>
Modified: trunk/reactos/subsystems/mvdm/ntvdm/utils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/util…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/utils.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/utils.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,7 +10,7 @@
#define NDEBUG
-#include "emulator.h"
+#include "ntvdm.h"
/* PRIVATE FUNCTIONS **********************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/utils.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/util…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/utils.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/utils.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -8,10 +8,6 @@
#ifndef _UTILS_H_
#define _UTILS_H_
-
-/* INCLUDES *******************************************************************/
-
-#include "ntvdm.h"
/* FUNCTIONS ******************************************************************/
Modified: trunk/reactos/subsystems/mvdm/ntvdm/vddsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/vdds…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/vddsup.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/vddsup.c [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -10,6 +10,7 @@
#define NDEBUG
+#include "ntvdm.h"
#include "emulator.h"
#include "vddsup.h"
@@ -41,7 +42,7 @@
static USHORT GetNextFreeVDDEntry(VOID)
{
USHORT Entry = MAX_VDD_MODULES;
- for (Entry = 0; Entry < sizeof(VDDList)/sizeof(VDDList[0]); ++Entry)
+ for (Entry = 0; Entry < ARRAYSIZE(VDDList); ++Entry)
{
if (VDDList[Entry].hDll == NULL) break;
}
@@ -296,7 +297,7 @@
/* Allocate the buffer */
BufSize = (BufSize < 2*sizeof(WCHAR) ? 2*sizeof(WCHAR) : BufSize);
- VDDList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufSize);
+ VDDList = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, BufSize);
if (VDDList == NULL)
{
DisplayMessage(ERROR_MEMORYVDD);
@@ -338,7 +339,7 @@
VDDList = VDDValueName;
Quit:
- if (VDDList) HeapFree(GetProcessHeap(), 0, VDDList);
+ if (VDDList) RtlFreeHeap(RtlGetProcessHeap(), 0, VDDList);
RegCloseKey(hVDDKey);
return Success;
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/vddsup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/vdds…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/vddsup.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/vddsup.h [iso-8859-1] Sun Apr 19 00:01:03 2015
@@ -9,8 +9,6 @@
#ifndef _VDDSUP_H_
#define _VDDSUP_H_
-/* DEFINES ********************************************************************/
-
/* FUNCTIONS ******************************************************************/
VOID VDDSupInitialize(VOID);