mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 01:25:56 +00:00
[NTDLL_WINETESTS] Fix the test so that it works on W2K3
It's an addendum to ad547c9
This commit is contained in:
parent
43a6843e9d
commit
d055c9f16f
1 changed files with 9 additions and 10 deletions
|
@ -1883,9 +1883,7 @@ static void test_queryvirtualmemory(void)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
SIZE_T readcount;
|
SIZE_T readcount;
|
||||||
#ifndef __REACTOS__
|
|
||||||
static const WCHAR windowsW[] = {'w','i','n','d','o','w','s'};
|
static const WCHAR windowsW[] = {'w','i','n','d','o','w','s'};
|
||||||
#endif
|
|
||||||
static const char teststring[] = "test string";
|
static const char teststring[] = "test string";
|
||||||
static char datatestbuf[42] = "abc";
|
static char datatestbuf[42] = "abc";
|
||||||
static char rwtestbuf[42];
|
static char rwtestbuf[42];
|
||||||
|
@ -1893,10 +1891,13 @@ static void test_queryvirtualmemory(void)
|
||||||
char stackbuf[42];
|
char stackbuf[42];
|
||||||
HMODULE module;
|
HMODULE module;
|
||||||
char buffer_name[sizeof(MEMORY_SECTION_NAME) + MAX_PATH * sizeof(WCHAR)];
|
char buffer_name[sizeof(MEMORY_SECTION_NAME) + MAX_PATH * sizeof(WCHAR)];
|
||||||
MEMORY_SECTION_NAME *msn = (MEMORY_SECTION_NAME *)buffer_name;
|
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
|
MEMORY_SECTION_NAME *msn = (MEMORY_SECTION_NAME *)buffer_name;
|
||||||
|
#endif
|
||||||
BOOL found;
|
BOOL found;
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
MEMORY_SECTION_NAME *msn = HeapAlloc(GetProcessHeap(), 0, sizeof(buffer_name));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
module = GetModuleHandleA( "ntdll.dll" );
|
module = GetModuleHandleA( "ntdll.dll" );
|
||||||
|
@ -1998,7 +1999,6 @@ static void test_queryvirtualmemory(void)
|
||||||
memset(buffer_name, 0x77, sizeof(buffer_name));
|
memset(buffer_name, 0x77, sizeof(buffer_name));
|
||||||
readcount = 0;
|
readcount = 0;
|
||||||
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemorySectionName, msn, sizeof(buffer_name), &readcount);
|
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemorySectionName, msn, sizeof(buffer_name), &readcount);
|
||||||
#ifndef __REACTOS__
|
|
||||||
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
|
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
|
||||||
ok( readcount > 0, "Expected readcount to be > 0\n");
|
ok( readcount > 0, "Expected readcount to be > 0\n");
|
||||||
trace ("Section Name: %s\n", wine_dbgstr_w(msn->SectionFileName.Buffer));
|
trace ("Section Name: %s\n", wine_dbgstr_w(msn->SectionFileName.Buffer));
|
||||||
|
@ -2006,18 +2006,17 @@ static void test_queryvirtualmemory(void)
|
||||||
for (found = FALSE, i = (msn->SectionFileName.Length - sizeof(windowsW)) / sizeof(WCHAR); i >= 0; i--)
|
for (found = FALSE, i = (msn->SectionFileName.Length - sizeof(windowsW)) / sizeof(WCHAR); i >= 0; i--)
|
||||||
found |= !memcmp( &msn->SectionFileName.Buffer[i], windowsW, sizeof(windowsW) );
|
found |= !memcmp( &msn->SectionFileName.Buffer[i], windowsW, sizeof(windowsW) );
|
||||||
ok( found, "Section name does not contain \"Windows\"\n");
|
ok( found, "Section name does not contain \"Windows\"\n");
|
||||||
#else
|
|
||||||
/* W2K3 will return this, because the buffer is not ULONG-aligned */
|
|
||||||
ok( status == STATUS_DATATYPE_MISALIGNMENT, "Expected STATUS_DATATYPE_MISALIGNMENT, got %08x\n", status);
|
|
||||||
ok( readcount == 0, "Expected readcount to be 0: %ld\n", readcount);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
trace("Check section name of non mapped memory\n");
|
trace("Check section name of non mapped memory\n");
|
||||||
memset(msn, 0, sizeof(*msn));
|
memset(msn, 0, sizeof(buffer_name));
|
||||||
readcount = 0;
|
readcount = 0;
|
||||||
status = pNtQueryVirtualMemory(NtCurrentProcess(), &buffer_name, MemorySectionName, msn, sizeof(buffer_name), &readcount);
|
status = pNtQueryVirtualMemory(NtCurrentProcess(), &buffer_name, MemorySectionName, msn, sizeof(buffer_name), &readcount);
|
||||||
ok( status == STATUS_INVALID_ADDRESS, "Expected STATUS_INVALID_ADDRESS, got %08x\n", status);
|
ok( status == STATUS_INVALID_ADDRESS, "Expected STATUS_INVALID_ADDRESS, got %08x\n", status);
|
||||||
ok( readcount == 0 || broken(readcount != 0) /* wow64 */, "Expected readcount to be 0\n");
|
ok( readcount == 0 || broken(readcount != 0) /* wow64 */, "Expected readcount to be 0\n");
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
HeapFree(GetProcessHeap(), 0, msn);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_affinity(void)
|
static void test_affinity(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue