Dmitry Timoshkov : winebuild: Check if a given forward does exist in one of the imported dlls, fix a couple of problems detected.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 9 07:36:02 CDT 2007


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

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Apr  9 14:40:57 2007 +0900

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 0134954..1ab4993 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 1f67722..61017ce 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 c6a1e1b..44c7802 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)




More information about the wine-cvs mailing list