Commit 94ac9895 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Fix the failing loader tests.

parent 34c40097
......@@ -294,16 +294,12 @@ START_TEST(loader)
{
ok(info.BaseAddress == (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: %p != %p\n",
i, info.BaseAddress, (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize));
todo_wine {
ok(info.AllocationBase == 0, "%d: %p != 0\n", i, info.AllocationBase);
}
ok(info.AllocationProtect == 0, "%d: %x != 0\n", i, info.AllocationProtect);
/*ok(info.RegionSize == not_practical_value, "%d: %lx != not_practical_value\n", i, info.RegionSize);*/
ok(info.State == MEM_FREE, "%d: %x != MEM_FREE\n", i, info.State);
ok(info.Type == 0, "%d: %x != 0\n", i, info.Type);
todo_wine {
ok(info.Protect == PAGE_NOACCESS, "%d: %x != PAGE_NOACCESS\n", i, info.Protect);
}
}
else
{
......@@ -322,14 +318,6 @@ todo_wine {
}
else
{ /* LoadLibrary has failed */
if (hlib) /* remove completely once Wine is fixed */
{
todo_wine ok(!hlib, "%d: LoadLibrary should fail\n", i);
FreeLibrary(hlib);
DeleteFile(dll_name);
continue;
}
ok(!hlib, "%d: LoadLibrary should fail\n", i);
if (GetLastError() == ERROR_GEN_FAILURE) /* Win9x, broken behaviour */
......
......@@ -1021,6 +1021,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
removable ) != STATUS_SUCCESS) goto error;
/* check that all sections are loaded at the right offset */
if (nt->OptionalHeader.FileAlignment != nt->OptionalHeader.SectionAlignment) goto error;
for (i = 0; i < nt->FileHeader.NumberOfSections; i++)
{
if (sec[i].VirtualAddress != sec[i].PointerToRawData)
......@@ -1710,7 +1711,8 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
if (!view)
{
info->State = MEM_FREE;
info->Protect = 0;
info->Protect = PAGE_NOACCESS;
info->AllocationBase = 0;
info->AllocationProtect = 0;
info->Type = 0;
}
......@@ -1719,6 +1721,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
BYTE vprot = view->prot[(base - alloc_base) >> page_shift];
info->State = (vprot & VPROT_COMMITTED) ? MEM_COMMIT : MEM_RESERVE;
info->Protect = VIRTUAL_GetWin32Prot( vprot );
info->AllocationBase = alloc_base;
info->AllocationProtect = VIRTUAL_GetWin32Prot( view->protect );
if (view->protect & VPROT_IMAGE) info->Type = MEM_IMAGE;
else if (view->flags & VFLAG_VALLOC) info->Type = MEM_PRIVATE;
......@@ -1728,8 +1731,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
}
RtlLeaveCriticalSection(&csVirtual);
info->BaseAddress = (LPVOID)base;
info->AllocationBase = (LPVOID)alloc_base;
info->BaseAddress = base;
info->RegionSize = size - (base - alloc_base);
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