Commit 16b44116 authored by Alexandre Julliard's avatar Alexandre Julliard

Removed MODULE_GetLoadOrderA.

parent c762f5d7
......@@ -1212,6 +1212,7 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_
}
else
{
UNICODE_STRING pathW;
WCHAR buffer[MAX_PATH], *p;
if (!GetModuleFileNameW( 0, buffer, MAX_PATH )) p = NULL;
......@@ -1220,7 +1221,9 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_
if ((p = strrchrW( buffer, '\\' ))) p++;
else p = buffer;
}
MODULE_GetLoadOrderA(loadorder, p, basename, FALSE);
RtlCreateUnicodeStringFromAsciiz( &pathW, basename );
MODULE_GetLoadOrderW( loadorder, p, pathW.Buffer );
RtlFreeUnicodeString( &pathW );
}
for(i = 0; i < LOADORDER_NTYPES; i++)
......
......@@ -182,7 +182,7 @@ static HANDLE open_exe_file( const WCHAR *name )
name = buffer;
}
MODULE_GetLoadOrderW( loadorder, NULL, name, TRUE );
MODULE_GetLoadOrderW( loadorder, NULL, name );
for(i = 0; i < LOADORDER_NTYPES; i++)
{
......@@ -245,7 +245,7 @@ static BOOL find_exe_file( const WCHAR *name, WCHAR *buffer, int buflen, HANDLE
return FALSE;
}
MODULE_GetLoadOrderW( loadorder, NULL, buffer, TRUE );
MODULE_GetLoadOrderW( loadorder, NULL, buffer );
for(i = 0; i < LOADORDER_NTYPES; i++)
{
......
......@@ -1442,7 +1442,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
}
main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
MODULE_GetLoadOrderW( loadorder, main_exe->ldr.BaseDllName.Buffer, filename, TRUE);
MODULE_GetLoadOrderW( loadorder, main_exe->ldr.BaseDllName.Buffer, filename );
nts = STATUS_DLL_NOT_FOUND;
for (i = 0; i < LOADORDER_NTYPES; i++)
......
......@@ -510,7 +510,7 @@ BOOL MODULE_GetSystemDirectory( UNICODE_STRING *sysdir )
* the specific dll. Otherwise the default load order is returned.
*/
void MODULE_GetLoadOrderW( enum loadorder_type loadorder[], const WCHAR *app_name,
const WCHAR *path, BOOL win32 )
const WCHAR *path )
{
static const WCHAR DllOverridesW[] = {'M','a','c','h','i','n','e','\\',
'S','o','f','t','w','a','r','e','\\',
......@@ -520,8 +520,11 @@ void MODULE_GetLoadOrderW( enum loadorder_type loadorder[], const WCHAR *app_nam
'D','l','l','O','v','e','r','r','i','d','e','s',0};
static HKEY std_key = (HKEY)-1; /* key to standard section, cached */
static UNICODE_STRING sysdir;
HKEY app_key = 0;
WCHAR *module, *basename;
UNICODE_STRING path_str;
int len;
if (!init_done) init_load_order();
......@@ -531,21 +534,14 @@ void MODULE_GetLoadOrderW( enum loadorder_type loadorder[], const WCHAR *app_nam
loadorder[0] = LOADORDER_INVALID; /* in case something bad happens below */
/* Strip path information if the module resides in the system directory
* (path is already stripped by caller for 16-bit modules)
*/
if (win32)
if (!sysdir.Buffer && !MODULE_GetSystemDirectory( &sysdir )) return;
RtlInitUnicodeString( &path_str, path );
if (RtlPrefixUnicodeString( &sysdir, &path_str, TRUE ))
{
UNICODE_STRING path_str, sysdir;
if (!MODULE_GetSystemDirectory( &sysdir )) return;
RtlInitUnicodeString( &path_str, path );
if (RtlPrefixUnicodeString( &sysdir, &path_str, TRUE ))
{
const WCHAR *p = path + sysdir.Length / sizeof(WCHAR);
while (*p == '\\' || *p == '/') p++;
if (!strchrW( p, '\\' ) && !strchrW( p, '/' )) path = p;
}
RtlFreeUnicodeString( &sysdir );
const WCHAR *p = path + sysdir.Length / sizeof(WCHAR);
while (*p == '\\' || *p == '/') p++;
if (!strchrW( p, '\\' ) && !strchrW( p, '/' )) path = p;
}
if (!(len = strlenW(path))) return;
......@@ -660,24 +656,3 @@ void MODULE_GetLoadOrderW( enum loadorder_type loadorder[], const WCHAR *app_nam
if (app_key) NtClose( app_key );
RtlFreeHeap( GetProcessHeap(), 0, module );
}
/***************************************************************************
* MODULE_GetLoadOrderA (internal)
*
* Locate the loadorder of a module.
* Any path is stripped from the path-argument and so are the extension
* '.dll' and '.exe'. A lookup in the table can yield an override for
* the specific dll. Otherwise the default load order is returned.
*
* FIXME: should be removed, everything should be Unicode.
*/
void MODULE_GetLoadOrderA( enum loadorder_type loadorder[], const WCHAR *app_name,
const char *path, BOOL win32 )
{
UNICODE_STRING pathW;
RtlCreateUnicodeStringFromAsciiz( &pathW, path );
MODULE_GetLoadOrderW( loadorder, app_name, pathW.Buffer, win32 );
RtlFreeUnicodeString( &pathW );
}
......@@ -1080,7 +1080,6 @@
#
@ cdecl CDROM_InitRegistry(long long str)
@ cdecl MODULE_DllThreadAttach(ptr)
@ cdecl MODULE_GetLoadOrderA(ptr str str long)
@ cdecl MODULE_GetLoadOrderW(ptr wstr wstr long)
@ cdecl MODULE_GetLoadOrderW(ptr wstr wstr)
@ cdecl VERSION_Init(wstr)
@ cdecl VIRTUAL_SetFaultHandler(ptr ptr ptr)
......@@ -184,8 +184,6 @@ extern void TASK_InstallTHHook( THHOOK *pNewThook );
/* loadorder.c */
extern void MODULE_GetLoadOrderW( enum loadorder_type plo[], const WCHAR *app_name,
const WCHAR *path, BOOL win32 );
extern void MODULE_GetLoadOrderA( enum loadorder_type plo[], const WCHAR *app_name,
const char *path, BOOL win32 );
const WCHAR *path );
#endif /* __WINE_MODULE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment