Commit 0eec45a9 authored by Alexandre Julliard's avatar Alexandre Julliard

Force loadorder of 16-bit dlls to builtin if their 32-bit counterpart

has already been loaded as builtin.
parent 40043ed2
......@@ -155,6 +155,25 @@ static const BUILTIN16_DESCRIPTOR *find_dll_descr( const char *dllname )
/***********************************************************************
* BUILTIN_IsPresent
*
* Check if a builtin dll descriptor is present (because we loaded its 32-bit counterpart).
*/
BOOL BUILTIN_IsPresent( LPCSTR name )
{
char dllname[20], *p;
if (strlen(name) >= sizeof(dllname)-4) return FALSE;
strcpy( dllname, name );
p = strrchr( dllname, '.' );
if (!p) strcat( dllname, ".dll" );
for (p = dllname; *p; p++) *p = FILE_tolower(*p);
return (find_dll_descr( dllname ) != NULL);
}
/***********************************************************************
* BUILTIN_LoadModule
*
* Load a built-in module.
......
......@@ -88,8 +88,6 @@ enum arg_types
#define ARG_RET16 0x80000000 /* function returns 16-bit value */
#define ARG_REGISTER 0x40000000 /* function is register */
extern HMODULE16 BUILTIN_LoadModule( LPCSTR name );
extern WORD __wine_call_from_16_word();
extern LONG __wine_call_from_16_long();
extern void __wine_call_from_16_regs();
......
......@@ -272,6 +272,10 @@ extern HMODULE BUILTIN32_LoadExeModule( HMODULE main );
extern void *BUILTIN32_dlopen( const char *name );
extern int BUILTIN32_dlclose( void *handle );
/* if1632/builtin.c */
extern HMODULE16 BUILTIN_LoadModule( LPCSTR name );
extern BOOL BUILTIN_IsPresent( LPCSTR name );
/* USER signal proc flags and codes */
/* See PROCESS_CallUserSignalProc for comments */
#define USIG_FLAGS_WIN32 0x0001
......
......@@ -494,7 +494,18 @@ void MODULE_GetLoadOrder( enum loadorder_type loadorder[], const char *path, BOO
/* Strip path information for 16 bit modules or if the module
* resides in the system directory */
if (!win32) path = get_basename( path );
if (!win32)
{
path = get_basename( path );
if (BUILTIN_IsPresent(path))
{
TRACE( "forcing loadorder to builtin for %s\n", debugstr_a(path) );
/* force builtin loadorder since the dll is already in memory */
loadorder[0] = LOADORDER_BI;
loadorder[1] = LOADORDER_INVALID;
return;
}
}
else
{
char sysdir[MAX_PATH+1];
......
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