mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 05:51:26 +08:00
[NTDLL_APITEST] Fix some tests
- Fix DllLoadNotification test on Vista (which seems to be broken) - Fix NtAcceptConnectPort test on 64 bit - Fix NtAllocateVirtualMemory test on Vista+ - Fix NtMapViewOfSection test on 64 bit - Fix NtSetDefaultLocale test on Vista+ - Fix RtlBitmapApi test on Vista - Fix RtlCaptureContext test
This commit is contained in:
@@ -187,6 +187,7 @@ START_TEST(DllLoadNotification)
|
||||
Status = pfnLdrRegisterDllNotification(0, DllLoadCallback, &hNotifiedDllBase, &Cookie2);
|
||||
ok_eq_bool(NT_SUCCESS(Status), TRUE);
|
||||
ok(Cookie2 != NULL, "Cookie2 is NULL\n");
|
||||
ok(Cookie2 != Cookie1, "Cookie2 is equal to Cookie1\n");
|
||||
|
||||
/* Load the test DLL */
|
||||
hTestDll = LoadLibraryW(g_szDllPath);
|
||||
@@ -219,7 +220,8 @@ START_TEST(DllLoadNotification)
|
||||
if (FreeLibrary(hTestDll))
|
||||
{
|
||||
/* The count will decrease 1 because the last callback still there */
|
||||
ok_eq_long(g_lDllLoadCount, 1L);
|
||||
ok(g_lDllLoadCount == 1L || /* Vista */ broken(g_lDllLoadCount == 2L),
|
||||
"Wrong g_lDllLoadCount: %lu, expected 1\n", g_lDllLoadCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -108,9 +108,14 @@ ServerThread(
|
||||
&Message.Header);
|
||||
ok_hex(Status, STATUS_SUCCESS);
|
||||
|
||||
ok(Message.Header.u1.s1.TotalLength == sizeof(Message),
|
||||
"TotalLength = %u, expected %Iu\n",
|
||||
Message.Header.u1.s1.TotalLength, sizeof(Message));
|
||||
#ifdef _WIN64
|
||||
/* On 64 bit systems TotalLength does not include the padding bytes in the TEST_MESSAGE structure. */
|
||||
ok_eq_ulong(Message.Header.u1.s1.TotalLength, RTL_SIZEOF_THROUGH_FIELD(TEST_MESSAGE, Message));
|
||||
#else
|
||||
/* On native 32 bit systems TotalLength includes the padding that comes from the 8 byte alignment of PORT_MESSAGE */
|
||||
ok_eq_ulong(Message.Header.u1.s1.TotalLength, sizeof(Message));
|
||||
#endif
|
||||
|
||||
ok(Message.Header.u1.s1.DataLength == sizeof(Message.Message),
|
||||
"DataLength = %u\n", Message.Header.u1.s1.DataLength);
|
||||
ok(Message.Header.u2.s2.Type == LPC_DATAGRAM,
|
||||
@@ -140,6 +145,7 @@ ClientThread(
|
||||
ULONG ConnectInfoLength;
|
||||
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||
TEST_MESSAGE Message;
|
||||
ULONG MaxMessageLength;
|
||||
|
||||
SecurityQos.Length = sizeof(SecurityQos);
|
||||
SecurityQos.ImpersonationLevel = SecurityIdentification;
|
||||
@@ -150,6 +156,7 @@ ClientThread(
|
||||
ConnectInfo.Signature = TEST_CONNECTION_INFO_SIGNATURE1;
|
||||
ConnectInfoLength = sizeof(ConnectInfo);
|
||||
PortHandle = (PVOID)(ULONG_PTR)0x55555555;
|
||||
MaxMessageLength = 0xAAAAAAAA;
|
||||
Status = NtConnectPort(&PortHandle,
|
||||
&PortName,
|
||||
&SecurityQos,
|
||||
@@ -160,6 +167,7 @@ ClientThread(
|
||||
&ConnectInfoLength);
|
||||
ok_hex(Status, STATUS_PORT_CONNECTION_REFUSED);
|
||||
ok(PortHandle == (PVOID)(ULONG_PTR)0x55555555, "PortHandle = %p\n", PortHandle);
|
||||
ok_eq_ulong(MaxMessageLength, 0xAAAAAAAA);
|
||||
|
||||
/* Try again, this time it will be accepted */
|
||||
ConnectInfo.Signature = TEST_CONNECTION_INFO_SIGNATURE2;
|
||||
@@ -199,6 +207,14 @@ START_TEST(NtAcceptConnectPort)
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
HANDLE PortHandle;
|
||||
HANDLE ThreadHandles[2];
|
||||
BOOL bIsWow64;
|
||||
|
||||
IsWow64Process(GetCurrentProcess(), &bIsWow64);
|
||||
if (bIsWow64)
|
||||
{
|
||||
skip("Skipping NtAcceptConnectPort on WOW64, due to LPC message layout differences.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&PortName,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* PURPOSE: Test for NtAllocateVirtualMemory
|
||||
* COPYRIGHT: Copyright 2011 Thomas Faber <thomas.faber@reactos.org>
|
||||
* Copyright 2013 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||
* Copyright 2015 Jérôme Gardou <jerome.gardou@reactos.org>
|
||||
* Copyright 2015 Jérôme Gardou <jerome.gardou@reactos.org>
|
||||
* Copyright 2018 Serge Gautherie <reactos-git_serge_171003@gautherie.fr>
|
||||
*/
|
||||
|
||||
@@ -591,7 +591,24 @@ CheckSomeDefaultAddresses(VOID)
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
|
||||
// 0x00000000, 64k: Free.
|
||||
/* Try to reserve memory at the shared user page */
|
||||
BaseAddress = (PVOID)USER_SHARED_DATA;
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, (GetNTVersion() >= _WIN32_WINNT_VISTA) ? STATUS_CONFLICTING_ADDRESSES : STATUS_INVALID_PARAMETER_2);
|
||||
|
||||
/* Try to unmap the shared user page */
|
||||
BaseAddress = (PVOID)USER_SHARED_DATA;
|
||||
Size = 0x1000;
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, (GetNTVersion() >= _WIN32_WINNT_VISTA) ? STATUS_INVALID_PAGE_PROTECTION : STATUS_MEMORY_NOT_ALLOCATED);
|
||||
|
||||
// 0x00000000, 64k: Free on XP/2K3, reserved later.
|
||||
|
||||
/* Reserve and commit memory at 0x00000000, after round down */
|
||||
BaseAddress = UlongToPtr(0x00000000 + 0x0FFF);
|
||||
@@ -602,16 +619,27 @@ CheckSomeDefaultAddresses(VOID)
|
||||
&Size,
|
||||
MEM_RESERVE | MEM_COMMIT,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
ok_ptr(BaseAddress, 0x00000000);
|
||||
if (GetNTVersion() >= _WIN32_WINNT_WIN10)
|
||||
{
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
}
|
||||
else if (GetNTVersion() >= _WIN32_WINNT_VISTA)
|
||||
{
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok_ntstatus(Status, GetNTVersion() >= _WIN32_WINNT_VISTA ? STATUS_INVALID_PARAMETER_2 : STATUS_SUCCESS);
|
||||
ok_ptr(BaseAddress, 0x00000000);
|
||||
|
||||
// Double-check that it is not forbidden "in order to catch null pointer accesses".
|
||||
StartSeh()
|
||||
*(int*)UlongToPtr(0x00000000) = 1;
|
||||
EndSeh(STATUS_SUCCESS)
|
||||
// Double-check that it is not forbidden "in order to catch null pointer accesses".
|
||||
StartSeh()
|
||||
*(int*)UlongToPtr(0x00000000) = 1;
|
||||
EndSeh(STATUS_SUCCESS)
|
||||
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Reserve memory above 0x00000000 */
|
||||
BaseAddress = UlongToPtr(0x00000000 + 0x1000);
|
||||
@@ -622,15 +650,20 @@ CheckSomeDefaultAddresses(VOID)
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
|
||||
/* The following checks assume very default addresses,
|
||||
* no address space layout randomization (ASLR). */
|
||||
#ifdef _WIN64
|
||||
ok(FALSE, "ToDo, 64-bit: Check/Adapt 32-bit results\n");
|
||||
#endif
|
||||
if (GetNTVersion() >= _WIN32_WINNT_WIN10)
|
||||
{
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
}
|
||||
else if (GetNTVersion() >= _WIN32_WINNT_VISTA)
|
||||
{
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
// 0x00010000, 4k: Private Data.
|
||||
// 0x00011000, 60k: Unusable.
|
||||
@@ -644,104 +677,121 @@ CheckSomeDefaultAddresses(VOID)
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
|
||||
/* Reserve memory at 0x00010000:
|
||||
* Windows NT legacy default executable image base */
|
||||
BaseAddress = UlongToPtr(0x00010000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
if (NT_SUCCESS(Status))
|
||||
{ // Unexpected, cleanup.
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
// 0x00400000: Image base.
|
||||
|
||||
/* Reserve memory below 0x00400000 */
|
||||
BaseAddress = UlongToPtr(0x00400000 - 0x1000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
if (NT_SUCCESS(Status))
|
||||
if (GetNTVersion() >= _WIN32_WINNT_WIN10)
|
||||
{
|
||||
trace("Below 0x00400000 is available, as on ReactOS and Windows S03\n");
|
||||
// 0x003F0000, 64k: Free.
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
}
|
||||
else if (GetNTVersion() >= _WIN32_WINNT_VISTA)
|
||||
{
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2);
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("Below 0x00400000 is not available, as on Windows XP\n");
|
||||
// 0x003F0000, 4k: Shareable.
|
||||
// 0x003F1000, 60k: Unusable.
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
}
|
||||
|
||||
/* Reserve memory at 0x00400000:
|
||||
* Windows NT legacy default DLL image base,
|
||||
* (ReactOS and) Windows 95 new default executable image base */
|
||||
BaseAddress = UlongToPtr(0x00400000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
if (NT_SUCCESS(Status))
|
||||
{ // Unexpected, cleanup.
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
// 0x10000000: Free.
|
||||
/* The following checks assume very default addresses,
|
||||
* no address space layout randomization (ASLR). */
|
||||
if (GetNTVersion() >= _WIN32_WINNT_VISTA)
|
||||
{
|
||||
skip("Skipping default address checks on Vista+\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/* Reserve memory below 0x10000000 */
|
||||
BaseAddress = UlongToPtr(0x10000000 - 0x1000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
/* Reserve memory at 0x00010000:
|
||||
* Windows NT legacy default executable image base */
|
||||
BaseAddress = UlongToPtr(0x00010000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
if (NT_SUCCESS(Status))
|
||||
{ // Unexpected, cleanup.
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Reserve memory at 0x10000000:
|
||||
* Windows new default non-OS DLL image base */
|
||||
BaseAddress = UlongToPtr(0x10000000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
// 0x00400000: Image base.
|
||||
|
||||
#ifdef _WIN64
|
||||
skip("ToDo, 64-bit: Add 0x140000000/Exe and 0x180000000/DLL checks\n");
|
||||
#endif
|
||||
/* Reserve memory below 0x00400000 */
|
||||
BaseAddress = UlongToPtr(0x00400000 - 0x1000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
trace("Below 0x00400000 is available, as on ReactOS and Windows S03\n");
|
||||
// 0x003F0000, 64k: Free.
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("Below 0x00400000 is not available, as on Windows XP\n");
|
||||
// 0x003F0000, 4k: Shareable.
|
||||
// 0x003F1000, 60k: Unusable.
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
}
|
||||
|
||||
/* Reserve memory at 0x00400000:
|
||||
* Windows NT legacy default DLL image base,
|
||||
* (ReactOS and) Windows 95 new default executable image base */
|
||||
BaseAddress = UlongToPtr(0x00400000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES);
|
||||
if (NT_SUCCESS(Status))
|
||||
{ // Unexpected, cleanup.
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
// 0x10000000: Free.
|
||||
|
||||
/* Reserve memory below 0x10000000 */
|
||||
BaseAddress = UlongToPtr(0x10000000 - 0x1000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
|
||||
/* Reserve memory at 0x10000000:
|
||||
* Windows new default non-OS DLL image base */
|
||||
BaseAddress = UlongToPtr(0x10000000);
|
||||
Size = 0x1000;
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
0,
|
||||
&Size,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
#define RUNS 32
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
|
||||
#include <pseh/pseh2.h>
|
||||
|
||||
#ifdef _M_IX86
|
||||
#define IsX86() TRUE
|
||||
#else
|
||||
#define IsX86() FALSE
|
||||
#endif
|
||||
|
||||
void
|
||||
Test_PageFileSection(void)
|
||||
{
|
||||
@@ -641,7 +647,7 @@ Test_PageFileSection(void)
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(), &BaseAddress2, &ViewSize, PAGE_READWRITE, &OldProtect);
|
||||
ok_ntstatus(Status, STATUS_SECTION_PROTECTION);
|
||||
#ifdef _WIN64
|
||||
ok(OldProtect == 0, "Wrong protection returned: 0x%lx\n", OldProtect);
|
||||
ok(OldProtect == PAGE_NOACCESS, "Wrong protection returned: 0x%lx\n", OldProtect);
|
||||
#else
|
||||
// Windows 2003 returns bogus
|
||||
#endif
|
||||
@@ -1171,12 +1177,16 @@ static struct _SECTION_CONTENTS_IMAGE_FILE
|
||||
{
|
||||
IMAGE_DOS_HEADER doshdr;
|
||||
WORD stub[32];
|
||||
IMAGE_NT_HEADERS32 nthdrs;
|
||||
IMAGE_NT_HEADERS nthdrs;
|
||||
IMAGE_SECTION_HEADER text_header;
|
||||
IMAGE_SECTION_HEADER rossym_header;
|
||||
IMAGE_SECTION_HEADER rsrc_header;
|
||||
IMAGE_SECTION_HEADER clc_header;
|
||||
#ifdef _WIN64
|
||||
BYTE pad[472];
|
||||
#else
|
||||
BYTE pad[488];
|
||||
#endif
|
||||
BYTE text_data[0x400];
|
||||
BYTE rossym_data[0x400];
|
||||
BYTE rsrc_data[0x400];
|
||||
@@ -1195,24 +1205,32 @@ static struct _SECTION_CONTENTS_IMAGE_FILE
|
||||
0x7220, 0x6E75, 0x6920, 0x206E, 0x4F44, 0x2053, 0x6F6D, 0x6564, 0x0D2E,
|
||||
0x0A0D, 0x0024, 0x0000, 0x0000, 0x0000
|
||||
},
|
||||
/* IMAGE_NT_HEADERS32 */
|
||||
/* IMAGE_NT_HEADERS */
|
||||
{
|
||||
IMAGE_NT_SIGNATURE, /* Signature */
|
||||
/* IMAGE_FILE_HEADER */
|
||||
{
|
||||
IMAGE_FILE_MACHINE_I386, /* Machine */
|
||||
IMAGE_FILE_MACHINE_NATIVE, /* Machine */
|
||||
4, /* NumberOfSections */
|
||||
0x47EFDF09, /* TimeDateStamp */
|
||||
0, /* PointerToSymbolTable */
|
||||
0, /* NumberOfSymbols */
|
||||
#ifdef _WIN64
|
||||
0xF0, /* SizeOfOptionalHeader */
|
||||
#else
|
||||
0xE0, /* SizeOfOptionalHeader */
|
||||
#endif
|
||||
IMAGE_FILE_32BIT_MACHINE | IMAGE_FILE_LOCAL_SYMS_STRIPPED |
|
||||
IMAGE_FILE_LINE_NUMS_STRIPPED | IMAGE_FILE_EXECUTABLE_IMAGE |
|
||||
IMAGE_FILE_DLL, /* Characteristics */
|
||||
},
|
||||
/* IMAGE_OPTIONAL_HEADER32 */
|
||||
/* IMAGE_OPTIONAL_HEADER */
|
||||
{
|
||||
#ifdef _WIN64
|
||||
IMAGE_NT_OPTIONAL_HDR64_MAGIC, /* Magic */
|
||||
#else
|
||||
IMAGE_NT_OPTIONAL_HDR32_MAGIC, /* Magic */
|
||||
#endif
|
||||
8, /* MajorLinkerVersion */
|
||||
0, /* MinorLinkerVersion */
|
||||
0x400, /* SizeOfCode */
|
||||
@@ -1220,7 +1238,9 @@ static struct _SECTION_CONTENTS_IMAGE_FILE
|
||||
0, /* SizeOfUninitializedData */
|
||||
0x2000, /* AddressOfEntryPoint */
|
||||
0x2000, /* BaseOfCode */
|
||||
#ifndef _WIN64
|
||||
0x0000, /* BaseOfData */
|
||||
#endif
|
||||
0x400000, /* ImageBase */
|
||||
0x2000, /* SectionAlignment */
|
||||
0x200, /* FileAlignment */
|
||||
@@ -1399,8 +1419,12 @@ Test_SectionContents(BOOL Relocate)
|
||||
}
|
||||
if (Relocate)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
ok((ULONG_PTR)GetModuleHandle(NULL) <= 0x00007FFFFFFFFFFF, "Module at %p\n", GetModuleHandle(NULL));
|
||||
#else
|
||||
ok((ULONG_PTR)GetModuleHandle(NULL) <= 0x80000000, "Module at %p\n", GetModuleHandle(NULL));
|
||||
SectionContentsImageFile.nthdrs.OptionalHeader.ImageBase = (ULONG)(ULONG_PTR)GetModuleHandle(NULL);
|
||||
#endif
|
||||
SectionContentsImageFile.nthdrs.OptionalHeader.ImageBase = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1800,7 +1824,7 @@ Test_RawSize(ULONG TestNumber)
|
||||
ViewShare,
|
||||
0,
|
||||
PAGE_READWRITE);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
ok_ntstatus(Status, IsX86() ? STATUS_SUCCESS : STATUS_IMAGE_MACHINE_TYPE_MISMATCH);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
PUCHAR Bytes = BaseAddress;
|
||||
|
||||
@@ -9,28 +9,50 @@
|
||||
|
||||
START_TEST(NtSetDefaultLocale)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
NTSTATUS Status, ExpectedStatus;
|
||||
|
||||
if (GetNTVersion() >= _WIN32_WINNT_WIN10)
|
||||
{
|
||||
ExpectedStatus = STATUS_SUCCESS;
|
||||
}
|
||||
else if (GetNTVersion() >= _WIN32_WINNT_VISTA)
|
||||
{
|
||||
ExpectedStatus = STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
}
|
||||
else
|
||||
{
|
||||
ExpectedStatus = STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0xffffffff);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0xfffffffe);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0x7fffffff);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0x7ffffffe);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0x80000000);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0x80000001);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 0x10000);
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
|
||||
ok_ntstatus(Status, ExpectedStatus);
|
||||
|
||||
if (GetNTVersion() >= _WIN32_WINNT_WIN10)
|
||||
{
|
||||
ExpectedStatus = STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
ExpectedStatus = STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
}
|
||||
|
||||
Status = NtSetDefaultLocale(TRUE, 1);
|
||||
ok_ntstatus(Status, STATUS_OBJECT_NAME_NOT_FOUND);
|
||||
|
||||
@@ -603,7 +603,7 @@ Test_RtlFindLongestRunClear(void)
|
||||
START_TEST(RtlBitmap)
|
||||
{
|
||||
/* Windows 2003 has broken bitmap code that modifies the buffer */
|
||||
if (!IsWindows7OrGreater() && !IsReactOS())
|
||||
if (!IsWindowsVistaOrGreater() && !IsReactOS())
|
||||
{
|
||||
IsBroken = TRUE;
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ START_TEST(RtlCaptureContext)
|
||||
ok_eq_hex(CapturedContext.FltSave.StatusWord, OriginalContext.FltSave.StatusWord);
|
||||
ok_eq_hex(CapturedContext.FltSave.TagWord, OriginalContext.FltSave.TagWord);
|
||||
ok_eq_hex(CapturedContext.FltSave.Reserved1, 0x00);
|
||||
ok_eq_hex(CapturedContext.FltSave.MxCsr_Mask, 0xffff);
|
||||
ok_eq_hex(CapturedContext.FltSave.ErrorOpcode, 0x00000083);
|
||||
ok_eq_hex(CapturedContext.FltSave.ErrorOffset, 0x00850084);
|
||||
ok_eq_hex(CapturedContext.FltSave.ErrorSelector, 0x0086);
|
||||
ok_eq_hex(CapturedContext.FltSave.MxCsr_Mask, 0x2ffff);
|
||||
ok_eq_hex(CapturedContext.FltSave.ErrorOpcode, 0x0000);
|
||||
ok_eq_hex(CapturedContext.FltSave.ErrorOffset, 0x00000000);
|
||||
ok_eq_hex(CapturedContext.FltSave.ErrorSelector, 0x0000);
|
||||
ok_eq_hex(CapturedContext.FltSave.Reserved2, 0x0000);
|
||||
ok_eq_hex(CapturedContext.FltSave.DataOffset, 0x00890088);
|
||||
ok_eq_hex(CapturedContext.FltSave.DataSelector, 0x008a);
|
||||
ok_eq_hex(CapturedContext.FltSave.DataOffset, 0x00000000);
|
||||
ok_eq_hex(CapturedContext.FltSave.DataSelector, 0x0000);
|
||||
ok_eq_hex(CapturedContext.FltSave.Reserved3, 0x0000);
|
||||
|
||||
/* We get the value from OriginalContext.MxCsr, since we set that later in the wrapper */
|
||||
|
||||
Reference in New Issue
Block a user