Commit 1b26d380 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

kernel32: In Win9x mode UnmapViewOfFile requires base address of a mapping.

parent 1311c815
...@@ -576,7 +576,19 @@ LPVOID WINAPI MapViewOfFileEx( HANDLE handle, DWORD access, ...@@ -576,7 +576,19 @@ LPVOID WINAPI MapViewOfFileEx( HANDLE handle, DWORD access,
*/ */
BOOL WINAPI UnmapViewOfFile( LPCVOID addr ) BOOL WINAPI UnmapViewOfFile( LPCVOID addr )
{ {
NTSTATUS status = NtUnmapViewOfSection( GetCurrentProcess(), (void *)addr ); NTSTATUS status;
if (GetVersion() & 0x80000000)
{
MEMORY_BASIC_INFORMATION info;
if (!VirtualQuery( addr, &info, sizeof(info) ) || info.AllocationBase != addr)
{
SetLastError( ERROR_INVALID_ADDRESS );
return FALSE;
}
}
status = NtUnmapViewOfSection( GetCurrentProcess(), (void *)addr );
if (status) SetLastError( RtlNtStatusToDosError(status) ); if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status; return !status;
} }
......
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