Alexandre Julliard : ntdll: Add support for ordinal forwards.

Alexandre Julliard julliard at winehq.org
Fri Sep 25 10:24:40 CDT 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Sep 25 13:12:02 2009 +0200

ntdll: Add support for ordinal forwards.

---

 dlls/ntdll/loader.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index cc9904b..71d7ecd 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -116,6 +116,8 @@ static WINE_MODREF *last_failed_modref;
 
 static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm );
 static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved );
+static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
+                                    DWORD exp_size, DWORD ordinal, LPCWSTR load_path );
 static FARPROC find_named_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
                                   DWORD exp_size, const char *name, int hint, LPCWSTR load_path );
 
@@ -403,7 +405,13 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS
     }
     if ((exports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
                                                  IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size )))
-        proc = find_named_export( wm->ldr.BaseAddress, exports, exp_size, end + 1, -1, load_path );
+    {
+        const char *name = end + 1;
+        if (*name == '#')  /* ordinal */
+            proc = find_ordinal_export( wm->ldr.BaseAddress, exports, exp_size, atoi(name+1), load_path );
+        else
+            proc = find_named_export( wm->ldr.BaseAddress, exports, exp_size, name, -1, load_path );
+    }
 
     if (!proc)
     {




More information about the wine-cvs mailing list