From d57872567dad54da0ee4c5742108e5387986b2bd Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 9 Apr 2007 14:40:57 +0900 Subject: [PATCH] winebuild: Check if a given forward does exist in one of the imported dlls, fix a couple of problems detected. --- dlls/imm32/imm32.spec | 2 +- dlls/w32skrnl/Makefile.in | 2 +- tools/winebuild/import.c | 42 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/dlls/imm32/imm32.spec b/dlls/imm32/imm32.spec index 01349540d1..1ab4993d57 100644 --- a/dlls/imm32/imm32.spec +++ b/dlls/imm32/imm32.spec @@ -93,7 +93,7 @@ @ stdcall ImmSetCompositionStringW(long long ptr long ptr long) @ stdcall ImmSetCompositionWindow(long ptr) @ stdcall ImmSetConversionStatus(long long long) -@ stdcall ImmSetHotKey(long long long ptr) user32.CliImmSetHotKey +#@ stdcall ImmSetHotKey(long long long ptr) user32.CliImmSetHotKey @ stdcall ImmSetOpenStatus(long long) @ stdcall ImmSetStatusWindowPos(long ptr) @ stub ImmShowSoftKeyboard diff --git a/dlls/w32skrnl/Makefile.in b/dlls/w32skrnl/Makefile.in index 1f67722bd7..61017ce63c 100644 --- a/dlls/w32skrnl/Makefile.in +++ b/dlls/w32skrnl/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = w32skrnl.dll -IMPORTS = kernel32 +IMPORTS = kernel32 ntdll C_SRCS = \ w32skernel.c \ diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index c6a1e1b9f4..44c7802a3b 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -429,6 +429,42 @@ static int check_unused( const struct import* imp, const DLLSPEC *spec ) return 1; } +/* check if a given forward does exist in one of the imported dlls */ +static void check_undefined_forward( DLLSPEC *spec, ORDDEF *odp ) +{ + char *link_name, *api_name, *dll_name, *p; + int i, found = 0; + + assert( odp->flags & FLAG_FORWARD ); + + link_name = xstrdup( odp->link_name ); + p = strrchr( link_name, '.' ); + *p = 0; + api_name = p + 1; + dll_name = get_dll_name( link_name, NULL ); + + for (i = 0; i < nb_imports; i++) + { + struct import *imp = dll_imports[i]; + + if (!strcasecmp( imp->spec->file_name, dll_name )) + { + if (find_export( api_name, imp->exports, imp->nb_exports )) + { + found = 1; + break; + } + } + } + + free( link_name ); + free( dll_name ); + + if (!found) + warning( "%s:%d: forward '%s' not found in the imported dll list\n", + spec->src_name, odp->lineno, odp->link_name ); +} + /* flag the dll exports that link to an undefined symbol */ static void check_undefined_exports( DLLSPEC *spec ) { @@ -438,7 +474,11 @@ static void check_undefined_exports( DLLSPEC *spec ) { ORDDEF *odp = &spec->entry_points[i]; if (odp->type == TYPE_STUB) continue; - if (odp->flags & FLAG_FORWARD) continue; + if (odp->flags & FLAG_FORWARD) + { + check_undefined_forward( spec, odp ); + continue; + } if (find_name( odp->link_name, &undef_symbols )) { switch(odp->type) -- 2.32.0.93.g670b81a890