diff --git a/reactos/subsystems/ntvdm/dos/dem.c b/reactos/subsystems/ntvdm/dos/dem.c index 2e20a9c4003..0389ac1863b 100644 --- a/reactos/subsystems/ntvdm/dos/dem.c +++ b/reactos/subsystems/ntvdm/dos/dem.c @@ -134,8 +134,8 @@ static VOID WINAPI DosCmdInterpreterBop(LPWORD Stack) strcpy(CommandLine, "cmd.exe /c "); strcat(CommandLine, Command); - ZeroMemory(&StartupInfo, sizeof(StartupInfo)); - ZeroMemory(&ProcessInformation, sizeof(ProcessInformation)); + RtlZeroMemory(&StartupInfo, sizeof(StartupInfo)); + RtlZeroMemory(&ProcessInformation, sizeof(ProcessInformation)); StartupInfo.cb = sizeof(StartupInfo); @@ -209,7 +209,7 @@ CommandThreadProc(LPVOID Parameter) do { /* Clear the structure */ - ZeroMemory(&CommandInfo, sizeof(CommandInfo)); + RtlZeroMemory(&CommandInfo, sizeof(CommandInfo)); /* Initialize the structure members */ CommandInfo.TaskId = SessionId; diff --git a/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c b/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c index 428807e0699..5c0fbcc7d34 100644 --- a/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c +++ b/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c @@ -168,7 +168,7 @@ BOOLEAN DosBIOSInitialize(VOID) #if 0 /* Clear the current directory buffer */ - ZeroMemory(CurrentDirectories, sizeof(CurrentDirectories)); + RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories)); /* Get the current directory */ if (!GetCurrentDirectoryA(MAX_PATH, CurrentDirectory)) diff --git a/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c b/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c index 3b9620589a8..f98ef757ba0 100644 --- a/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c +++ b/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c @@ -860,7 +860,7 @@ VOID DosInitializePsp(WORD PspSegment, LPCSTR CommandLine, WORD ProgramSize, WOR PDOS_PSP PspBlock = SEGMENT_TO_PSP(PspSegment); LPDWORD IntVecTable = (LPDWORD)((ULONG_PTR)BaseAddress); - ZeroMemory(PspBlock, sizeof(DOS_PSP)); + RtlZeroMemory(PspBlock, sizeof(*PspBlock)); /* Set the exit interrupt */ PspBlock->Exit[0] = 0xCD; // int 0x20 @@ -1204,8 +1204,8 @@ WORD DosCreateProcess(DOS_EXEC_TYPE LoadType, } /* Set up the startup info structure */ - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOA)); - StartupInfo.cb = sizeof(STARTUPINFOA); + RtlZeroMemory(&StartupInfo, sizeof(StartupInfo)); + StartupInfo.cb = sizeof(StartupInfo); /* Create the process */ if (!CreateProcessA(ProgramName, @@ -1230,7 +1230,7 @@ WORD DosCreateProcess(DOS_EXEC_TYPE LoadType, case SCS_WOW_BINARY: { /* Clear the structure */ - ZeroMemory(&CommandInfo, sizeof(CommandInfo)); + RtlZeroMemory(&CommandInfo, sizeof(CommandInfo)); /* Initialize the structure members */ CommandInfo.TaskId = SessionId; @@ -1362,7 +1362,7 @@ Done: GetNextVDMCommand(&CommandInfo); /* Clear the structure */ - ZeroMemory(&CommandInfo, sizeof(CommandInfo)); + RtlZeroMemory(&CommandInfo, sizeof(CommandInfo)); /* Update the VDM state of the task */ CommandInfo.TaskId = SessionId; @@ -2901,7 +2901,7 @@ BOOLEAN DosKRNLInitialize(VOID) WCHAR Buffer[256]; /* Clear the current directory buffer */ - ZeroMemory(CurrentDirectories, sizeof(CurrentDirectories)); + RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories)); /* Get the current directory */ if (!GetCurrentDirectoryA(MAX_PATH, CurrentDirectory)) diff --git a/reactos/subsystems/ntvdm/dos/mouse32.c b/reactos/subsystems/ntvdm/dos/mouse32.c index 5b0a526844e..acf3f83f951 100644 --- a/reactos/subsystems/ntvdm/dos/mouse32.c +++ b/reactos/subsystems/ntvdm/dos/mouse32.c @@ -665,7 +665,7 @@ VOID MouseBiosUpdateButtons(WORD ButtonState) BOOLEAN DosMouseInitialize(VOID) { /* Clear the state */ - ZeroMemory(&DriverState, sizeof(DriverState)); + RtlZeroMemory(&DriverState, sizeof(DriverState)); /* Initialize the interrupt handler */ RegisterDosInt32(BIOS_MOUSE_INTERRUPT, BiosMouseService); diff --git a/reactos/subsystems/ntvdm/hardware/cmos.c b/reactos/subsystems/ntvdm/hardware/cmos.c index 47306ebcd8d..72393681ded 100644 --- a/reactos/subsystems/ntvdm/hardware/cmos.c +++ b/reactos/subsystems/ntvdm/hardware/cmos.c @@ -428,7 +428,7 @@ VOID CmosInitialize(VOID) ASSERT(hCmosRam == INVALID_HANDLE_VALUE); /* Clear the CMOS memory */ - ZeroMemory(&CmosMemory, sizeof(CmosMemory)); + RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); /* Always open (and if needed, create) a RAM file with shared access */ SetLastError(0); // For debugging purposes @@ -452,7 +452,7 @@ VOID CmosInitialize(VOID) { /* Bad CMOS Ram file. Reinitialize the CMOS memory. */ DPRINT1("Invalid CMOS file, read bytes %u, expected bytes %u\n", CmosSize, sizeof(CmosMemory)); - ZeroMemory(&CmosMemory, sizeof(CmosMemory)); + RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); } DPRINT1("CMOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); SetFilePointer(hCmosRam, 0, NULL, FILE_BEGIN); diff --git a/reactos/subsystems/ntvdm/hardware/mouse.c b/reactos/subsystems/ntvdm/hardware/mouse.c index 9c5c84ec7b8..f480d5ba4e5 100644 --- a/reactos/subsystems/ntvdm/hardware/mouse.c +++ b/reactos/subsystems/ntvdm/hardware/mouse.c @@ -12,6 +12,7 @@ #include "mouse.h" #include "ps2.h" +// #include "pic.h" // HACK: For the PS/2 bypass and MOUSE.COM driver direct call #include "dos/mouse32.h" @@ -69,7 +70,7 @@ static VOID MouseReset(VOID) static VOID MouseGetPacket(PMOUSE_PACKET Packet) { /* Clear the packet */ - ZeroMemory(Packet, sizeof(MOUSE_PACKET)); + RtlZeroMemory(Packet, sizeof(*Packet)); Packet->Flags |= MOUSE_ALWAYS_SET; diff --git a/reactos/subsystems/ntvdm/hardware/vga.c b/reactos/subsystems/ntvdm/hardware/vga.c index 2200c574981..94d17b786c5 100644 --- a/reactos/subsystems/ntvdm/hardware/vga.c +++ b/reactos/subsystems/ntvdm/hardware/vga.c @@ -976,8 +976,8 @@ static BOOL VgaEnterGraphicsMode(PCOORD Resolution) } /* Fill the bitmap info header */ - ZeroMemory(&BitmapInfo->bmiHeader, sizeof(BITMAPINFOHEADER)); - BitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + RtlZeroMemory(&BitmapInfo->bmiHeader, sizeof(BitmapInfo->bmiHeader)); + BitmapInfo->bmiHeader.biSize = sizeof(BitmapInfo->bmiHeader); BitmapInfo->bmiHeader.biWidth = Width; BitmapInfo->bmiHeader.biHeight = Height; BitmapInfo->bmiHeader.biBitCount = 8; @@ -1006,7 +1006,7 @@ static BOOL VgaEnterGraphicsMode(PCOORD Resolution) ConsoleMutex = GraphicsBufferInfo.hMutex; /* Clear the framebuffer */ - ZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage); + RtlZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage); /* Set the active buffer */ VgaSetActiveScreenBuffer(GraphicsConsoleBuffer); @@ -1901,7 +1901,7 @@ VOID VgaWriteMemory(DWORD Address, LPBYTE Buffer, DWORD Size) VOID VgaClearMemory(VOID) { - ZeroMemory(VgaMemory, sizeof(VgaMemory)); + RtlZeroMemory(VgaMemory, sizeof(VgaMemory)); } VOID VgaResetPalette(VOID) diff --git a/reactos/subsystems/ntvdm/io.c b/reactos/subsystems/ntvdm/io.c index 9a85a114cf5..7fa28918fd0 100644 --- a/reactos/subsystems/ntvdm/io.c +++ b/reactos/subsystems/ntvdm/io.c @@ -342,7 +342,7 @@ VOID UnregisterIoPort(ULONG Port) * the hVdd gets unregistered as well as all the handlers. */ // IoPortProc[Port] = {NULL}; - ZeroMemory(&IoPortProc[Port], sizeof(IoPortProc[Port])); + RtlZeroMemory(&IoPortProc[Port], sizeof(IoPortProc[Port])); } VOID WINAPI @@ -594,7 +594,7 @@ VDDDeInstallIOHook(HANDLE hVdd, * the hVdd gets unregistered as well as all the handlers. */ // IoPortProc[i] = {NULL}; - ZeroMemory(&IoPortProc[i], sizeof(IoPortProc[i])); + RtlZeroMemory(&IoPortProc[i], sizeof(IoPortProc[i])); } /* Go to the next range */