Commit 5f069c16 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

krnl386.exe16: Do not omit mandatory argument for VirtualProtect.

parent 1119da47
......@@ -302,6 +302,7 @@ BOOL DOSMEM_InitDosMemory(void)
{
static BOOL done;
static HANDLE hRunOnce;
DWORD old_prot;
if (done) return TRUE;
......@@ -317,7 +318,7 @@ BOOL DOSMEM_InitDosMemory(void)
/* ok, we're the winning thread */
if (!(ret = VirtualProtect( DOSMEM_dosmem + DOSMEM_protect,
DOSMEM_SIZE - DOSMEM_protect,
PAGE_READWRITE, NULL )))
PAGE_READWRITE, &old_prot )))
ERR("Cannot load access low 1Mb, DOS subsystem unavailable\n");
RemoveVectoredExceptionHandler( vectored_handler );
......@@ -650,10 +651,11 @@ UINT DOSMEM_Available(void)
BOOL DOSMEM_MapDosLayout(void)
{
static BOOL already_mapped;
DWORD old_prot;
if (!already_mapped)
{
if (DOSMEM_dosmem || !VirtualProtect( NULL, DOSMEM_SIZE, PAGE_EXECUTE_READWRITE, NULL ))
if (DOSMEM_dosmem || !VirtualProtect( NULL, DOSMEM_SIZE, PAGE_EXECUTE_READWRITE, &old_prot ))
{
ERR( "Need full access to the first megabyte for DOS mode\n" );
ExitProcess(1);
......
......@@ -827,6 +827,7 @@ LPVOID DOSVM_AllocDataUMB( DWORD size, WORD *segment, WORD *selector )
*/
void DOSVM_InitSegments(void)
{
DWORD old_prot;
LPSTR ptr;
int i;
......@@ -966,7 +967,7 @@ void DOSVM_InitSegments(void)
/*
* As we store code in UMB we should make sure it is executable
*/
VirtualProtect((void *)DOSVM_UMB_BOTTOM, DOSVM_UMB_TOP - DOSVM_UMB_BOTTOM, PAGE_EXECUTE_READWRITE, NULL);
VirtualProtect((void *)DOSVM_UMB_BOTTOM, DOSVM_UMB_TOP - DOSVM_UMB_BOTTOM, PAGE_EXECUTE_READWRITE, &old_prot);
event_notifier = CreateEventW(NULL, FALSE, FALSE, NULL);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment