[NTDLL_APITEST] Fix LdrEnumResources testdata initialization 3329/head
authorMark Jansen <mark.jansen@reactos.org>
Wed, 28 Oct 2020 19:14:34 +0000 (20:14 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 29 Oct 2020 19:17:58 +0000 (20:17 +0100)
ROSTESTS-361

modules/rostests/apitests/ntdll/LdrEnumResources.c

index 7dfd08b..e20cfd2 100644 (file)
@@ -172,6 +172,7 @@ InitializeTestImage(
     TestImage->NtHeaders.OptionalHeader.ImageBase = (DWORD_PTR)TestImage;
     TestImage->NtHeaders.OptionalHeader.SizeOfImage = sizeof(TEST_IMAGE);
     TestImage->NtHeaders.OptionalHeader.SizeOfHeaders = sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS);
+    TestImage->NtHeaders.OptionalHeader.NumberOfRvaAndSizes = ARRAYSIZE(TestImage->NtHeaders.OptionalHeader.DataDirectory);
 
     ResourceDirectory = &TestImage->NtHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
     ResourceDirectory->VirtualAddress = FIELD_OFFSET(TEST_IMAGE, Resources);
@@ -359,6 +360,7 @@ Test_Parameters(PTEST_IMAGE TestImage)
 START_TEST(LdrEnumResources)
 {
     TEST_IMAGE TestImage;
+    RtlZeroMemory(&TestImage, sizeof(TestImage));
 
     Test_Parameters(&TestImage);
     Test_Data(&TestImage);