=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: kernel32/tests: Explicitly set SizeOfRawData.

Alexandre Julliard julliard at winehq.org
Mon Aug 8 11:09:28 CDT 2016


Module: wine
Branch: master
Commit: e685bed6cce88e496e6cb069e61d3ce16ab7a219
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e685bed6cce88e496e6cb069e61d3ce16ab7a219

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Aug  7 22:15:45 2016 +0200

kernel32/tests: Explicitly set SizeOfRawData.

Signed-off-by: André Hentschel <nerv at dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/loader.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 0b38445..f59f674 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -143,9 +143,9 @@ static const IMAGE_NT_HEADERS nt_header_template =
 static IMAGE_SECTION_HEADER section =
 {
     ".rodata", /* Name */
-    { 0x10 }, /* Misc */
+    { 0 }, /* Misc */
     0, /* VirtualAddress */
-    0x0a, /* SizeOfRawData */
+    0, /* SizeOfRawData */
     0, /* PointerToRawData */
     0, /* PointerToRelocations */
     0, /* PointerToLinenumbers */
@@ -196,6 +196,8 @@ static DWORD create_test_dll( const IMAGE_DOS_HEADER *dos_header, UINT dos_size,
     assert(nt_header->FileHeader.NumberOfSections <= 1);
     if (nt_header->FileHeader.NumberOfSections)
     {
+        section.SizeOfRawData = 10;
+
         if (nt_header->OptionalHeader.SectionAlignment >= page_size)
         {
             section.PointerToRawData = dos_size;
@@ -2722,7 +2724,8 @@ static void test_ResolveDelayLoadedAPI(void)
     /* sections */
     section.PointerToRawData = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress;
     section.VirtualAddress = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress;
-    section.Misc.VirtualSize = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size;
+    section.Misc.VirtualSize = 2 * sizeof(idd);
+    section.SizeOfRawData = section.Misc.VirtualSize;
     section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ;
     SetLastError(0xdeadbeef);
     ret = WriteFile(hfile, &section, sizeof(section), &dummy, NULL);
@@ -2734,6 +2737,7 @@ static void test_ResolveDelayLoadedAPI(void)
     section.Misc.VirtualSize = sizeof(test_dll) + sizeof(hint) + sizeof(test_func) + sizeof(HMODULE) +
                                2 * (i + 1) * sizeof(IMAGE_THUNK_DATA);
     ok(section.Misc.VirtualSize <= 0x1000, "Too much tests, add a new section!\n");
+    section.SizeOfRawData = section.Misc.VirtualSize;
     section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE;
     SetLastError(0xdeadbeef);
     ret = WriteFile(hfile, &section, sizeof(section), &dummy, NULL);




More information about the wine-cvs mailing list