From cff04b34ac7bc252799932a5c376a93094e6f115 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 3 Aug 2020 11:44:33 +0200 Subject: [PATCH] winebuild: Always use DllMain as entry point for the 32-bit side of a 16-bit module. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49559 Signed-off-by: Alexandre Julliard --- tools/winebuild/import.c | 1 + tools/winebuild/parser.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 34761ea4c5d..da9ad620225 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -475,6 +475,7 @@ static int has_stubs( const DLLSPEC *spec ) static void add_extra_undef_symbols( DLLSPEC *spec ) { add_extra_ld_symbol( spec->init_func ); + if (spec->type == SPEC_WIN16) add_extra_ld_symbol( "DllMain" ); if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" ); if (delayed_imports.count) add_extra_ld_symbol( "__wine_spec_delay_load" ); } diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index 9822456fe57..54fffd8a1b2 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -836,6 +836,7 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ) spec32->file_name = xstrdup( spec16->file_name ); spec32->characteristics = IMAGE_FILE_DLL; + spec32->init_func = xstrdup( "DllMain" ); /* add an export for the NE module */