From 3dd8644961b343967d69d61a0eef64fc8e07de4c Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Thu, 21 Jun 2012 11:44:54 +0200 Subject: wintrust/tests: Fix build with MSVC. --- dlls/wintrust/tests/softpub.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c index 0987f9c..5466e95 100644 --- a/dlls/wintrust/tests/softpub.c +++ b/dlls/wintrust/tests/softpub.c @@ -582,9 +582,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 */ @@ -611,12 +611,11 @@ 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 */ - 0xFF, 0x25, EXIT_PROCESS&0xFF, (EXIT_PROCESS>>8)&0xFF, (EXIT_PROCESS>>16)&0xFF, - (EXIT_PROCESS>>24)&0xFF, /* jmp ExitProcess */ + /* jmp ExitProcess filled in at runtime */ 0 }, /* .idata section */ @@ -634,7 +633,7 @@ static struct _PeImage { "KERNEL32.DLL" }, /* final alignment */ - {} + {0} }; #include @@ -667,6 +666,16 @@ static void test_sip_create_indirect_data(void) ret = CryptSIPCreateIndirectData_p(&subjinfo, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + /* add 'jmp ExitProcess' instruction */ + count = 2; + bin.text_section[count++] = 0xFF; + bin.text_section[count++] = 0x25; + bin.text_section[count++] = EXIT_PROCESS&0xFF; + bin.text_section[count++] = (EXIT_PROCESS>>8)&0xFF; + bin.text_section[count++] = (EXIT_PROCESS>>16)&0xFF; + bin.text_section[count++] = (EXIT_PROCESS>>24)&0xFF; + file = create_temp_file(temp_file); if (file == INVALID_HANDLE_VALUE) { -- 1.7.10.msysgit.1