From d6455eb2f3ff2f6d8d663c8254a42c310564c39e Mon Sep 17 00:00:00 2001 From: Mark Jansen Date: Thu, 14 May 2015 00:52:42 +0200 Subject: imagehlp/tests: msvc compatibility fixes. --- dlls/imagehlp/tests/image.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/imagehlp/tests/image.c b/dlls/imagehlp/tests/image.c index 74068dd..8299630 100644 --- a/dlls/imagehlp/tests/image.c +++ b/dlls/imagehlp/tests/image.c @@ -60,7 +60,7 @@ struct Imports { } ibn; char dllname[0x10]; }; -#define EXIT_PROCESS (VA_START+RVA_IDATA+FIELD_OFFSET(struct Imports, thunks[0])) +#define EXIT_PROCESS (VA_START+RVA_IDATA+FIELD_OFFSET(struct Imports, thunks)) static struct _PeImage { IMAGE_DOS_HEADER dos_header; @@ -74,9 +74,9 @@ static struct _PeImage { char __alignment3[FILE_TOTAL-FILE_IDATA-sizeof(struct Imports)]; } bin = { /* dos header */ - {IMAGE_DOS_SIGNATURE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, 0, 0, {}, FILE_PE_START}, + {IMAGE_DOS_SIGNATURE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0}, 0, 0, {0}, FILE_PE_START}, /* alignment before PE header */ - {}, + {0}, /* nt headers */ {IMAGE_NT_SIGNATURE, /* basic headers - 3 sections, no symbols, EXE file */ @@ -103,7 +103,7 @@ static struct _PeImage { 0, 0, 0, IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE} }, /* alignment before first section */ - {}, + {0}, /* .text section */ { 0x31, 0xC0, /* xor eax, eax */ @@ -126,7 +126,7 @@ static struct _PeImage { "KERNEL32.DLL" }, /* final alignment */ - {} + {0} }; #include @@ -226,7 +226,8 @@ static const struct expected_blob b1[] = { {FILE_IDATA-FILE_TEXT, &bin.text_section}, {sizeof(bin.idata_section.descriptors[0].u.OriginalFirstThunk), &bin.idata_section.descriptors[0].u.OriginalFirstThunk}, - {FIELD_OFFSET(struct Imports, thunks)-FIELD_OFFSET(struct Imports, descriptors[0].Name), + {FIELD_OFFSET(struct Imports, thunks)- + (FIELD_OFFSET(struct Imports, descriptors)+FIELD_OFFSET(IMAGE_IMPORT_DESCRIPTOR, Name)), &bin.idata_section.descriptors[0].Name}, {FILE_TOTAL-FILE_IDATA-FIELD_OFFSET(struct Imports, ibn), &bin.idata_section.ibn} -- 2.4.0