https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad547c960fce62b49c641…
commit ad547c960fce62b49c64172f12e1230566be14db
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Sep 29 14:13:55 2019 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Sep 29 14:13:55 2019 +0200
[NTDLL_WINETESTS] Section name query test is broken on W2K3 and will lead to a crash
Comment out the test for now and add a more "appropriate" test code for now
---
modules/rostests/winetests/ntdll/info.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/modules/rostests/winetests/ntdll/info.c
b/modules/rostests/winetests/ntdll/info.c
index 14ddf20d1eb..3d2c6318840 100644
--- a/modules/rostests/winetests/ntdll/info.c
+++ b/modules/rostests/winetests/ntdll/info.c
@@ -1883,7 +1883,9 @@ static void test_queryvirtualmemory(void)
{
NTSTATUS status;
SIZE_T readcount;
+#ifndef __REACTOS__
static const WCHAR windowsW[] =
{'w','i','n','d','o','w','s'};
+#endif
static const char teststring[] = "test string";
static char datatestbuf[42] = "abc";
static char rwtestbuf[42];
@@ -1892,8 +1894,10 @@ static void test_queryvirtualmemory(void)
HMODULE module;
char buffer_name[sizeof(MEMORY_SECTION_NAME) + MAX_PATH * sizeof(WCHAR)];
MEMORY_SECTION_NAME *msn = (MEMORY_SECTION_NAME *)buffer_name;
+#ifndef __REACTOS__
BOOL found;
int i;
+#endif
module = GetModuleHandleA( "ntdll.dll" );
trace("Check flags of the PE header of NTDLL.DLL at %p\n", module);
@@ -1994,6 +1998,7 @@ static void test_queryvirtualmemory(void)
memset(buffer_name, 0x77, sizeof(buffer_name));
readcount = 0;
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemorySectionName, msn,
sizeof(buffer_name), &readcount);
+#ifndef __REACTOS__
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n",
status);
ok( readcount > 0, "Expected readcount to be > 0\n");
trace ("Section Name: %s\n",
wine_dbgstr_w(msn->SectionFileName.Buffer));
@@ -2001,6 +2006,11 @@ static void test_queryvirtualmemory(void)
for (found = FALSE, i = (msn->SectionFileName.Length - sizeof(windowsW)) /
sizeof(WCHAR); i >= 0; i--)
found |= !memcmp( &msn->SectionFileName.Buffer[i], windowsW,
sizeof(windowsW) );
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");
memset(msn, 0, sizeof(*msn));