mirror of
https://github.com/reactos/wine.git
synced 2025-02-22 13:53:38 +00:00
ntdll: Return STATUS_IMAGE_NOT_AT_BASE when an image mapping has to be relocated.
This commit is contained in:
parent
74a059d21b
commit
83c272a258
@ -545,7 +545,7 @@ LPVOID WINAPI MapViewOfFileEx( HANDLE handle, DWORD access,
|
||||
if (access & FILE_MAP_EXECUTE) protect <<= 4;
|
||||
|
||||
if ((status = NtMapViewOfSection( handle, GetCurrentProcess(), &addr, 0, 0, &offset,
|
||||
&count, ViewShare, 0, protect )))
|
||||
&count, ViewShare, 0, protect )) < 0)
|
||||
{
|
||||
SetLastError( RtlNtStatusToDosError(status) );
|
||||
addr = NULL;
|
||||
|
@ -1498,7 +1498,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
|
||||
status = NtMapViewOfSection( mapping, NtCurrentProcess(),
|
||||
&module, 0, 0, &size, &len, ViewShare, 0, PAGE_READONLY );
|
||||
NtClose( mapping );
|
||||
if (status != STATUS_SUCCESS) return status;
|
||||
if (status < 0) return status;
|
||||
|
||||
/* create the MODREF */
|
||||
|
||||
|
@ -1296,6 +1296,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
|
||||
#ifdef VALGRIND_LOAD_PDB_DEBUGINFO
|
||||
VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta);
|
||||
#endif
|
||||
if (ptr != base) return STATUS_IMAGE_NOT_AT_BASE;
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
error:
|
||||
@ -2409,7 +2410,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
|
||||
res = NTDLL_queue_process_apc( process, &call, &result );
|
||||
if (res != STATUS_SUCCESS) return res;
|
||||
|
||||
if (result.map_view.status == STATUS_SUCCESS)
|
||||
if ((NTSTATUS)result.map_view.status >= 0)
|
||||
{
|
||||
*addr_ptr = wine_server_get_ptr( result.map_view.addr );
|
||||
*size_ptr = result.map_view.size;
|
||||
@ -2461,7 +2462,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
|
||||
-1, dup_mapping, addr_ptr );
|
||||
}
|
||||
if (needs_close) close( unix_handle );
|
||||
if (!res) *size_ptr = size;
|
||||
if (res >= 0) *size_ptr = size;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user