Alexandre Julliard : ntdll: Don't pass the application name to get_load_order().
Alexandre Julliard
julliard at winehq.org
Fri Mar 26 16:03:30 CDT 2021
Module: wine
Branch: master
Commit: e8ec7a8cec819ec40341fdc8b58a759c909979ec
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e8ec7a8cec819ec40341fdc8b58a759c909979ec
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Mar 26 16:04:22 2021 +0100
ntdll: Don't pass the application name to get_load_order().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/loader.c | 4 +---
dlls/ntdll/unix/loader.c | 6 +-----
dlls/ntdll/unix/loadorder.c | 6 +++++-
dlls/ntdll/unix/unix_private.h | 2 +-
dlls/ntdll/unixlib.h | 4 ++--
5 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 01644df7763..1e89edf3bec 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2691,7 +2691,6 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
DWORD flags, WINE_MODREF** pwm )
{
enum loadorder loadorder;
- WINE_MODREF *main_exe;
UNICODE_STRING nt_name;
struct file_id id;
HANDLE mapping = 0;
@@ -2716,8 +2715,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
if (nts && nts != STATUS_DLL_NOT_FOUND && nts != STATUS_INVALID_IMAGE_NOT_MZ) goto done;
- main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
- loadorder = unix_funcs->get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, &nt_name );
+ loadorder = unix_funcs->get_load_order( &nt_name );
prev = NtCurrentTeb()->Tib.ArbitraryUserPointer;
NtCurrentTeb()->Tib.ArbitraryUserPointer = nt_name.Buffer + 4;
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index dd966729763..d9db518ee76 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1395,13 +1395,9 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, const WCHAR *filename,
UNICODE_STRING nt_name;
SECTION_IMAGE_INFORMATION info;
enum loadorder loadorder;
- const WCHAR *app_name = NULL;
-
- if (NtCurrentTeb()->Peb->ImageBaseAddress)
- app_name = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer;
init_unicode_string( &nt_name, filename );
- loadorder = get_load_order( app_name, &nt_name );
+ loadorder = get_load_order( &nt_name );
if (image_info->image_flags & IMAGE_FLAGS_WineBuiltin)
{
diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c
index f7360bdf7e1..67a7473dc7f 100644
--- a/dlls/ntdll/unix/loadorder.c
+++ b/dlls/ntdll/unix/loadorder.c
@@ -378,15 +378,19 @@ static enum loadorder get_load_order_value( HANDLE std_key, HANDLE app_key, WCHA
* Return the loadorder of a module.
* The system directory and '.dll' extension is stripped from the path.
*/
-enum loadorder CDECL get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name )
+enum loadorder CDECL get_load_order( const UNICODE_STRING *nt_name )
{
static const WCHAR prefixW[] = {'\\','?','?','\\'};
enum loadorder ret = LO_INVALID;
HANDLE std_key, app_key = 0;
const WCHAR *path = nt_name->Buffer;
+ const WCHAR *app_name = NULL;
WCHAR *module, *basename;
int len;
+ if (NtCurrentTeb()->Peb->ImageBaseAddress)
+ app_name = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer;
+
if (!init_done) init_load_order();
std_key = get_standard_key();
if (app_name) app_key = get_app_key( app_name );
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index c51aee2d8e4..1557aa2371a 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -400,7 +400,7 @@ static inline void context_init_xstate( CONTEXT *context, void *xstate_buffer )
}
#endif
-extern enum loadorder CDECL get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name ) DECLSPEC_HIDDEN;
+extern enum loadorder CDECL get_load_order( const UNICODE_STRING *nt_name ) DECLSPEC_HIDDEN;
static inline size_t ntdll_wcslen( const WCHAR *str )
{
diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h
index 71cc4177c06..80e4eaefc75 100644
--- a/dlls/ntdll/unixlib.h
+++ b/dlls/ntdll/unixlib.h
@@ -37,7 +37,7 @@ enum loadorder
};
/* increment this when you change the function table */
-#define NTDLL_UNIXLIB_VERSION 118
+#define NTDLL_UNIXLIB_VERSION 119
struct unix_funcs
{
@@ -91,7 +91,7 @@ struct unix_funcs
NTSTATUS (CDECL *init_unix_lib)( void *module, DWORD reason, const void *ptr_in, void *ptr_out );
NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context );
- enum loadorder (CDECL *get_load_order)( const WCHAR *app_name, const UNICODE_STRING *nt_name );
+ enum loadorder (CDECL *get_load_order)( const UNICODE_STRING *nt_name );
/* debugging functions */
unsigned char (CDECL *dbg_get_channel_flags)( struct __wine_debug_channel *channel );
More information about the wine-cvs
mailing list