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

oldstable
Sebastian Lackner 2015-05-02 18:43:05 +02:00 committed by Alexandre Julliard
parent 1119da47ee
commit 5f069c1601
2 changed files with 6 additions and 3 deletions

View File

@ -302,6 +302,7 @@ BOOL DOSMEM_InitDosMemory(void)
{ {
static BOOL done; static BOOL done;
static HANDLE hRunOnce; static HANDLE hRunOnce;
DWORD old_prot;
if (done) return TRUE; if (done) return TRUE;
@ -317,7 +318,7 @@ BOOL DOSMEM_InitDosMemory(void)
/* ok, we're the winning thread */ /* ok, we're the winning thread */
if (!(ret = VirtualProtect( DOSMEM_dosmem + DOSMEM_protect, if (!(ret = VirtualProtect( DOSMEM_dosmem + DOSMEM_protect,
DOSMEM_SIZE - DOSMEM_protect, DOSMEM_SIZE - DOSMEM_protect,
PAGE_READWRITE, NULL ))) PAGE_READWRITE, &old_prot )))
ERR("Cannot load access low 1Mb, DOS subsystem unavailable\n"); ERR("Cannot load access low 1Mb, DOS subsystem unavailable\n");
RemoveVectoredExceptionHandler( vectored_handler ); RemoveVectoredExceptionHandler( vectored_handler );
@ -650,10 +651,11 @@ UINT DOSMEM_Available(void)
BOOL DOSMEM_MapDosLayout(void) BOOL DOSMEM_MapDosLayout(void)
{ {
static BOOL already_mapped; static BOOL already_mapped;
DWORD old_prot;
if (!already_mapped) 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" ); ERR( "Need full access to the first megabyte for DOS mode\n" );
ExitProcess(1); ExitProcess(1);

View File

@ -827,6 +827,7 @@ LPVOID DOSVM_AllocDataUMB( DWORD size, WORD *segment, WORD *selector )
*/ */
void DOSVM_InitSegments(void) void DOSVM_InitSegments(void)
{ {
DWORD old_prot;
LPSTR ptr; LPSTR ptr;
int i; int i;
@ -966,7 +967,7 @@ void DOSVM_InitSegments(void)
/* /*
* As we store code in UMB we should make sure it is executable * 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); event_notifier = CreateEventW(NULL, FALSE, FALSE, NULL);
} }