Remap zero-pages when decomitting a page range (based on a patch by

Gerard Patel).
This commit is contained in:
Alexandre Julliard 1999-11-08 02:12:30 +00:00
parent 9103daf300
commit 6cd2c9ebd5
1 changed files with 6 additions and 1 deletions

View File

@ -697,7 +697,12 @@ BOOL WINAPI VirtualFree(
return TRUE;
}
/* Decommit the pages */
/* Decommit the pages by unmapping them and remapping zero-pages instead */
FILE_munmap( (LPVOID)base, 0, size );
if (FILE_dommap( -1, (LPVOID)base, 0, size, 0, 0,
VIRTUAL_GetUnixProt( 0 ), MAP_PRIVATE ) == (LPVOID)-1)
ERR( "Could not remap pages, expect trouble\n" );
return VIRTUAL_SetProt( view, base, size, 0 );
}