Skip to content

Commit ad547c9

Browse files
committed
[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
1 parent a66bee2 commit ad547c9

File tree

1 file changed

+10
-0
lines changed
  • modules/rostests/winetests/ntdll

1 file changed

+10
-0
lines changed

modules/rostests/winetests/ntdll/info.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,9 @@ static void test_queryvirtualmemory(void)
18831883
{
18841884
NTSTATUS status;
18851885
SIZE_T readcount;
1886+
#ifndef __REACTOS__
18861887
static const WCHAR windowsW[] = {'w','i','n','d','o','w','s'};
1888+
#endif
18871889
static const char teststring[] = "test string";
18881890
static char datatestbuf[42] = "abc";
18891891
static char rwtestbuf[42];
@@ -1892,8 +1894,10 @@ static void test_queryvirtualmemory(void)
18921894
HMODULE module;
18931895
char buffer_name[sizeof(MEMORY_SECTION_NAME) + MAX_PATH * sizeof(WCHAR)];
18941896
MEMORY_SECTION_NAME *msn = (MEMORY_SECTION_NAME *)buffer_name;
1897+
#ifndef __REACTOS__
18951898
BOOL found;
18961899
int i;
1900+
#endif
18971901

18981902
module = GetModuleHandleA( "ntdll.dll" );
18991903
trace("Check flags of the PE header of NTDLL.DLL at %p\n", module);
@@ -1994,13 +1998,19 @@ static void test_queryvirtualmemory(void)
19941998
memset(buffer_name, 0x77, sizeof(buffer_name));
19951999
readcount = 0;
19962000
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemorySectionName, msn, sizeof(buffer_name), &readcount);
2001+
#ifndef __REACTOS__
19972002
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
19982003
ok( readcount > 0, "Expected readcount to be > 0\n");
19992004
trace ("Section Name: %s\n", wine_dbgstr_w(msn->SectionFileName.Buffer));
20002005
pRtlDowncaseUnicodeString( &msn->SectionFileName, &msn->SectionFileName, FALSE );
20012006
for (found = FALSE, i = (msn->SectionFileName.Length - sizeof(windowsW)) / sizeof(WCHAR); i >= 0; i--)
20022007
found |= !memcmp( &msn->SectionFileName.Buffer[i], windowsW, sizeof(windowsW) );
20032008
ok( found, "Section name does not contain \"Windows\"\n");
2009+
#else
2010+
/* W2K3 will return this, because the buffer is not ULONG-aligned */
2011+
ok( status == STATUS_DATATYPE_MISALIGNMENT, "Expected STATUS_DATATYPE_MISALIGNMENT, got %08x\n", status);
2012+
ok( readcount == 0, "Expected readcount to be 0: %ld\n", readcount);
2013+
#endif
20042014

20052015
trace("Check section name of non mapped memory\n");
20062016
memset(msn, 0, sizeof(*msn));

0 commit comments

Comments
 (0)