Alexandre Julliard : ntdll: Pass an NT filename to get_load_order().

Alexandre Julliard julliard at winehq.org
Fri Feb 8 16:16:28 CST 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Feb  8 22:07:54 2019 +0100

ntdll: Pass an NT filename to get_load_order().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/loader.c     | 2 +-
 dlls/ntdll/loadorder.c  | 5 ++++-
 dlls/ntdll/ntdll_misc.h | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 0d8fc57..7e26098 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2546,7 +2546,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
 
     filename = nt_name.Buffer + 4;  /* \??\ prefix */
     main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
-    loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, filename );
+    loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, &nt_name );
 
     if (handle && is_fake_dll( handle ))
     {
diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c
index c6c0245..b965b96 100644
--- a/dlls/ntdll/loadorder.c
+++ b/dlls/ntdll/loadorder.c
@@ -429,16 +429,19 @@ static enum loadorder get_load_order_value( HANDLE std_key, HANDLE app_key, cons
  * Return the loadorder of a module.
  * The system directory and '.dll' extension is stripped from the path.
  */
-enum loadorder get_load_order( const WCHAR *app_name, const WCHAR *path )
+enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name )
 {
+    static const WCHAR nt_prefixW[] = {'\\','?','?','\\',0};
     enum loadorder ret = LO_INVALID;
     HANDLE std_key, app_key = 0;
+    const WCHAR *path = nt_name->Buffer;
     WCHAR *module, *basename;
     int len;
 
     if (!init_done) init_load_order();
     std_key = get_standard_key();
     if (app_name) app_key = get_app_key( app_name );
+    if (!strncmpW( path, nt_prefixW, 4 )) path += 4;
 
     TRACE("looking for %s\n", debugstr_w(path));
 
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 1630978..5b32abc 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -216,7 +216,7 @@ enum loadorder
     LO_DEFAULT          /* nothing specified, use default strategy */
 };
 
-extern enum loadorder get_load_order( const WCHAR *app_name, const WCHAR *path ) DECLSPEC_HIDDEN;
+extern enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name ) DECLSPEC_HIDDEN;
 
 struct debug_info
 {




More information about the wine-cvs mailing list