Commit c808e67d authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed wrong file offset used when mapping the import directory from a

shared section.
parent 8534f791
......@@ -645,7 +645,8 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, DWORD total_size
UINT_PTR end = base + ROUND_SIZE( imports->VirtualAddress, imports->Size );
if (end > sec->VirtualAddress + size) end = sec->VirtualAddress + size;
if (end > base) VIRTUAL_mmap( shared_fd, ptr + base, end - base,
pos, 0, PROT_READ|PROT_WRITE|PROT_EXEC,
pos + (base - sec->VirtualAddress), 0,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, NULL );
}
pos += size;
......@@ -1245,7 +1246,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
info->BaseAddress = (LPVOID)base;
info->AllocationBase = (LPVOID)alloc_base;
info->RegionSize = size - (base - alloc_base);
*res_len = sizeof(*info);
if (res_len) *res_len = sizeof(*info);
return STATUS_SUCCESS;
}
......
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