From c2bb91087750d504aa5b17c55ce53a4e3bc847d8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 4 Oct 2005 15:54:55 +0000 Subject: [PATCH] Ignore the size of the import directory, process imports until we find a null entry. --- dlls/ntdll/loader.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index e305f2270e1..bfd1d3a656e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -588,15 +588,9 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) IMAGE_DIRECTORY_ENTRY_IMPORT, &size ))) return STATUS_SUCCESS; - nb_imports = size / sizeof(*imports); - for (i = 0; i < nb_imports; i++) - { - if (!imports[i].Name) - { - nb_imports = i; - break; - } - } + nb_imports = 0; + while (imports[nb_imports].Name && imports[nb_imports].FirstThunk) nb_imports++; + if (!nb_imports) return STATUS_SUCCESS; /* no imports */ /* Allocate module dependency list */