mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 14:40:53 +00:00
kernel32: In Win9x mode UnmapViewOfFile requires base address of a mapping.
Signed-off-by: Michael Müller <michael@fds-team.de> Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1311c8157b
commit
1b26d38095
|
@ -576,7 +576,19 @@ LPVOID WINAPI MapViewOfFileEx( HANDLE handle, DWORD access,
|
|||
*/
|
||||
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) );
|
||||
return !status;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue