- Added support for app-specific dll overrides using
AppDefaults\<appname>\DllOverrides configuration section. - Better support for multiple --dll options. - Added warning message to discourage putting multiple dlls in a single override entry.
This commit is contained in:
parent
857abbf398
commit
b9c9cdc5d4
@ -68,7 +68,6 @@ WINE REGISTRY Version 2
|
|||||||
# <wineconf>
|
# <wineconf>
|
||||||
|
|
||||||
[DllDefaults]
|
[DllDefaults]
|
||||||
"EXTRA_LD_LIBRARY_PATH" = "${HOME}/wine/cvs/lib"
|
|
||||||
"DefaultLoadOrder" = "native, builtin, so"
|
"DefaultLoadOrder" = "native, builtin, so"
|
||||||
|
|
||||||
[DllOverrides]
|
[DllOverrides]
|
||||||
@ -82,8 +81,6 @@ WINE REGISTRY Version 2
|
|||||||
"lz32" = "builtin, native"
|
"lz32" = "builtin, native"
|
||||||
"comctl32" = "builtin, native"
|
"comctl32" = "builtin, native"
|
||||||
"commctrl" = "builtin, native"
|
"commctrl" = "builtin, native"
|
||||||
"wsock32" = "builtin"
|
|
||||||
"winsock" = "builtin"
|
|
||||||
"advapi32" = "builtin, native"
|
"advapi32" = "builtin, native"
|
||||||
"crtdll" = "builtin, native"
|
"crtdll" = "builtin, native"
|
||||||
"mpr" = "builtin, native"
|
"mpr" = "builtin, native"
|
||||||
@ -91,8 +88,6 @@ WINE REGISTRY Version 2
|
|||||||
"ddraw" = "builtin, native"
|
"ddraw" = "builtin, native"
|
||||||
"dinput" = "builtin, native"
|
"dinput" = "builtin, native"
|
||||||
"dsound" = "builtin, native"
|
"dsound" = "builtin, native"
|
||||||
"mmsystem" = "builtin"
|
|
||||||
"winmm" = "builtin"
|
|
||||||
"msvcrt" = "native, builtin"
|
"msvcrt" = "native, builtin"
|
||||||
"msvideo" = "builtin, native"
|
"msvideo" = "builtin, native"
|
||||||
"msvfw32" = "builtin, native"
|
"msvfw32" = "builtin, native"
|
||||||
@ -105,8 +100,6 @@ WINE REGISTRY Version 2
|
|||||||
"msacm" = "builtin, native"
|
"msacm" = "builtin, native"
|
||||||
"msacm32" = "builtin, native"
|
"msacm32" = "builtin, native"
|
||||||
"midimap.drv" = "builtin, native"
|
"midimap.drv" = "builtin, native"
|
||||||
"wnaspi32" = "builtin"
|
|
||||||
"icmp" = "builtin"
|
|
||||||
|
|
||||||
[x11drv]
|
[x11drv]
|
||||||
; Number of colors to allocate from the system palette
|
; Number of colors to allocate from the system palette
|
||||||
|
@ -103,7 +103,7 @@ Use a desktop window of the given geometry, e.g. "640x480"
|
|||||||
.I --display name
|
.I --display name
|
||||||
Use the specified X display
|
Use the specified X display
|
||||||
.TP
|
.TP
|
||||||
.I --dll name[,name[,...]]={native|so|builtin}[,{n|s|b}[,...]][+...]
|
.I --dll name[,name[,...]]={native|so|builtin}[,{n|s|b}[,...]]
|
||||||
Selects the override type and load order of dll used in the loading
|
Selects the override type and load order of dll used in the loading
|
||||||
process for any dll. The default is set in the configuration
|
process for any dll. The default is set in the configuration
|
||||||
file. There are currently three types of libraries that can be loaded
|
file. There are currently three types of libraries that can be loaded
|
||||||
@ -119,13 +119,12 @@ internal dlls (
|
|||||||
.I n, s, b
|
.I n, s, b
|
||||||
). Each sequence of orders must be separated by commas.
|
). Each sequence of orders must be separated by commas.
|
||||||
.br
|
.br
|
||||||
Each dll may have its own specific load order. The load order determines
|
Each dll may have its own specific load order. The load order
|
||||||
which version of the dll is attempted to be loaded into the address space. If
|
determines which version of the dll is attempted to be loaded into the
|
||||||
the first fails, then the next is tried and so on. Different load orders can
|
address space. If the first fails, then the next is tried and so
|
||||||
be specified by separating the entries with a plus sign. Multiple libraries
|
on. Multiple libraries with the same load order can be separated with
|
||||||
with the same load order can be separated with commas. It is also possible to
|
commas. It is also possible to use the --dll option several times, to
|
||||||
use the --dll option several times, to specify different loadorders for different
|
specify different loadorders for different libraries
|
||||||
libraries
|
|
||||||
.br
|
.br
|
||||||
Examples:
|
Examples:
|
||||||
.br
|
.br
|
||||||
@ -139,7 +138,7 @@ the builtin version if the native load fails.
|
|||||||
Try to load the libraries shell and shell32 as native windows dlls. Furthermore, if
|
Try to load the libraries shell and shell32 as native windows dlls. Furthermore, if
|
||||||
an application request to load c:\(rsfoo\(rsbar\(rsbaz.dll load the builtin library baz.
|
an application request to load c:\(rsfoo\(rsbar\(rsbaz.dll load the builtin library baz.
|
||||||
.br
|
.br
|
||||||
.I --dll comdlg32,commdlg=b,n:shell,shell32=b+comctl32,commctrl=n
|
.I --dll comdlg32,commdlg=b,n --dll shell,shell32=b --dll comctl32,commctrl=n
|
||||||
.br
|
.br
|
||||||
Try to load comdlg32 and commdlg as builtin first and try the native version
|
Try to load comdlg32 and commdlg as builtin first and try the native version
|
||||||
if the builtin load fails; load shell32/shell always as builtin and
|
if the builtin load fails; load shell32/shell always as builtin and
|
||||||
|
@ -9,19 +9,18 @@
|
|||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
|
|
||||||
#define MODULE_LOADORDER_INVALID 0 /* Must be 0 */
|
enum loadorder_type
|
||||||
#define MODULE_LOADORDER_DLL 1 /* Native DLLs */
|
{
|
||||||
#define MODULE_LOADORDER_SO 2 /* Native .so libraries */
|
LOADORDER_INVALID = 0, /* Must be 0 */
|
||||||
#define MODULE_LOADORDER_BI 3 /* Built-in modules */
|
LOADORDER_DLL, /* Native DLLs */
|
||||||
#define MODULE_LOADORDER_NTYPES 3
|
LOADORDER_SO, /* Native .so libraries */
|
||||||
|
LOADORDER_BI, /* Built-in modules */
|
||||||
|
LOADORDER_NTYPES
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct module_loadorder {
|
extern void MODULE_InitLoadOrder(void);
|
||||||
char *modulename;
|
extern void MODULE_GetLoadOrder( enum loadorder_type plo[], const char *path, BOOL win32 );
|
||||||
char loadorder[MODULE_LOADORDER_NTYPES];
|
extern void MODULE_AddLoadOrderOption( const char *option );
|
||||||
} module_loadorder_t;
|
|
||||||
|
|
||||||
BOOL MODULE_InitLoadOrder(void);
|
|
||||||
module_loadorder_t *MODULE_GetLoadOrder(const char *path, BOOL win32);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ struct options
|
|||||||
{
|
{
|
||||||
char * desktopGeometry; /* NULL when no desktop */
|
char * desktopGeometry; /* NULL when no desktop */
|
||||||
char * display; /* display name */
|
char * display; /* display name */
|
||||||
char *dllFlags; /* -dll flags (hack for Winelib support) */
|
|
||||||
int synchronous; /* X synchronous mode */
|
int synchronous; /* X synchronous mode */
|
||||||
int managed; /* Managed windows */
|
int managed; /* Managed windows */
|
||||||
};
|
};
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
|
#include "winreg.h"
|
||||||
|
#include "winerror.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "loadorder.h"
|
#include "loadorder.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
@ -19,80 +21,103 @@
|
|||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(module);
|
DEFAULT_DEBUG_CHANNEL(module);
|
||||||
|
|
||||||
|
|
||||||
/* #define DEBUG_LOADORDER */
|
|
||||||
|
|
||||||
#define LOADORDER_ALLOC_CLUSTER 32 /* Allocate with 32 entries at a time */
|
#define LOADORDER_ALLOC_CLUSTER 32 /* Allocate with 32 entries at a time */
|
||||||
|
|
||||||
static module_loadorder_t default_loadorder;
|
typedef struct module_loadorder
|
||||||
static module_loadorder_t *module_loadorder = NULL;
|
{
|
||||||
static int nmodule_loadorder = 0;
|
const char *modulename;
|
||||||
static int nmodule_loadorder_alloc = 0;
|
enum loadorder_type loadorder[LOADORDER_NTYPES];
|
||||||
|
} module_loadorder_t;
|
||||||
|
|
||||||
/* DLL order is irrelevant ! Gets sorted later. */
|
struct loadorder_list
|
||||||
static struct tagDllOverride {
|
{
|
||||||
char *key,*value;
|
int count;
|
||||||
} DefaultDllOverrides[] = {
|
int alloc;
|
||||||
/* "system" DLLs */
|
module_loadorder_t *order;
|
||||||
{"kernel32,gdi32,user32", "builtin"},
|
|
||||||
{"krnl386,gdi,user", "builtin"},
|
|
||||||
{"toolhelp", "builtin"},
|
|
||||||
{"windebug", "native,builtin"},
|
|
||||||
{"system,display", "builtin"},
|
|
||||||
{"w32skrnl,wow32", "builtin"},
|
|
||||||
{"advapi32,crtdll,ntdll", "builtin,native"},
|
|
||||||
{"lz32,lzexpand", "builtin,native"},
|
|
||||||
{"version,ver", "builtin,native"},
|
|
||||||
{"msvcrt", "native,builtin"},
|
|
||||||
/* "new" interface */
|
|
||||||
{"comdlg32,commdlg", "builtin,native"},
|
|
||||||
{"shell32,shell", "builtin,native"},
|
|
||||||
{"shlwapi", "native,builtin"},
|
|
||||||
{"shfolder", "builtin,native"},
|
|
||||||
{"comctl32,commctrl", "builtin,native"},
|
|
||||||
/* network */
|
|
||||||
{"wsock32,ws2_32,winsock", "builtin"},
|
|
||||||
{"icmp", "builtin"},
|
|
||||||
/* multimedia */
|
|
||||||
{"ddraw,dinput,dsound", "builtin,native"},
|
|
||||||
{"winmm,mmsystem", "builtin"},
|
|
||||||
{"msvfw32,msvideo", "builtin,native"},
|
|
||||||
{"mcicda.drv,mciseq.drv", "builtin,native"},
|
|
||||||
{"mciwave.drv", "builtin,native"},
|
|
||||||
{"mciavi.drv,mcianim.drv", "native,builtin"},
|
|
||||||
{"msacm.drv,midimap.drv", "builtin,native"},
|
|
||||||
{"msacm,msacm32", "builtin,native"},
|
|
||||||
{"opengl32", "builtin,native"},
|
|
||||||
/* we have to use libglideXx.so instead of glideXx.dll ... */
|
|
||||||
{"glide2x,glide3x", "so,native"},
|
|
||||||
/* other stuff */
|
|
||||||
{"mpr,winspool.drv", "builtin,native"},
|
|
||||||
{"wnaspi32,winaspi", "builtin"},
|
|
||||||
{"odbc32", "builtin"},
|
|
||||||
{"rpcrt4", "native,builtin"},
|
|
||||||
/* non-windows DLLs */
|
|
||||||
{"wineps,wprocs,x11drv", "builtin"},
|
|
||||||
{NULL,NULL},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct tagDllPair {
|
/* default load-order if nothing specified */
|
||||||
const char *dll1, *dll2;
|
/* the list must remain sorted by dll name */
|
||||||
} DllPairs[] = {
|
static module_loadorder_t default_order_list[] =
|
||||||
{ "krnl386", "kernel32" },
|
{
|
||||||
{ "gdi", "gdi32" },
|
{ "advapi32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "user", "user32" },
|
{ "comctl32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "commdlg", "comdlg32" },
|
{ "comdlg32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "commctrl", "comctl32" },
|
{ "commctrl", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "ver", "version" },
|
{ "commdlg", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "shell", "shell32" },
|
{ "crtdll", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "lzexpand", "lz32" },
|
{ "ddraw", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "mmsystem", "winmm" },
|
{ "dinput", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "msvideo", "msvfw32" },
|
{ "display", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
{ "msacm", "msacm32" },
|
{ "dsound", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
{ "winsock", "wsock32" },
|
{ "gdi", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
{ NULL, NULL }
|
{ "gdi32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "glide2x", { LOADORDER_SO, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "glide3x", { LOADORDER_SO, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "icmp", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "kernel", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "kernel32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "keyboard", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "krnl386", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "lz32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "lzexpand", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "mcianim.drv", { LOADORDER_DLL, LOADORDER_BI, 0, 0 } },
|
||||||
|
{ "mciavi.drv", { LOADORDER_DLL, LOADORDER_BI, 0, 0 } },
|
||||||
|
{ "mcicda.drv", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "mciseq.drv", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "mciwave.drv", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "midimap.drv", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "mmsystem", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "mouse", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "mpr", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "msacm", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "msacm.drv", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "msacm32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "msvcrt", { LOADORDER_DLL, LOADORDER_BI, 0, 0 } },
|
||||||
|
{ "msvfw32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "msvideo", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "ntdll", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "odbc32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "opengl32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "rpcrt4", { LOADORDER_DLL, LOADORDER_BI, 0, 0 } },
|
||||||
|
{ "shell", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "shell32", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "shfolder", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "shlwapi", { LOADORDER_DLL, LOADORDER_BI, 0, 0 } },
|
||||||
|
{ "system", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "toolhelp", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "ttydrv", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "user", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "user32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "ver", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "version", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "w32skrnl", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "winaspi", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "windebug", { LOADORDER_DLL, LOADORDER_BI, 0, 0 } },
|
||||||
|
{ "winedos", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "wineps", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "wing", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "winmm", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "winsock", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "winspool.drv", { LOADORDER_BI, LOADORDER_DLL, 0, 0 } },
|
||||||
|
{ "wnaspi32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "wow32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "wprocs", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "ws2_32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "wsock32", { LOADORDER_BI, 0, 0, 0 } },
|
||||||
|
{ "x11drv", { LOADORDER_BI, 0, 0, 0 } }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct loadorder_list default_list =
|
||||||
|
{
|
||||||
|
sizeof(default_order_list)/sizeof(default_order_list[0]),
|
||||||
|
sizeof(default_order_list)/sizeof(default_order_list[0]),
|
||||||
|
default_order_list
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct loadorder_list cmdline_list;
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* cmp_sort_func (internal, static)
|
* cmp_sort_func (internal, static)
|
||||||
*
|
*
|
||||||
@ -151,50 +176,46 @@ static char *get_tok(const char *str, const char *delim)
|
|||||||
* Parses the loadorder options from the configuration and puts it into
|
* Parses the loadorder options from the configuration and puts it into
|
||||||
* a structure.
|
* a structure.
|
||||||
*/
|
*/
|
||||||
static BOOL ParseLoadOrder(char *order, module_loadorder_t *mlo)
|
static BOOL ParseLoadOrder(char *order, enum loadorder_type lo[])
|
||||||
{
|
{
|
||||||
static int warn;
|
static int warn;
|
||||||
char *cptr;
|
char *cptr;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
memset(mlo->loadorder, 0, sizeof(mlo->loadorder));
|
|
||||||
|
|
||||||
cptr = get_tok(order, ", \t");
|
cptr = get_tok(order, ", \t");
|
||||||
while(cptr)
|
while(cptr)
|
||||||
{
|
{
|
||||||
char type = MODULE_LOADORDER_INVALID;
|
enum loadorder_type type = LOADORDER_INVALID;
|
||||||
|
|
||||||
if(n >= MODULE_LOADORDER_NTYPES)
|
if(n >= LOADORDER_NTYPES-1)
|
||||||
{
|
{
|
||||||
ERR("More than existing %d module-types specified, rest ignored", MODULE_LOADORDER_NTYPES);
|
ERR("More than existing %d module-types specified, rest ignored\n", LOADORDER_NTYPES-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(*cptr)
|
switch(*cptr)
|
||||||
{
|
{
|
||||||
case 'N': /* Native */
|
case 'N': /* Native */
|
||||||
case 'n': type = MODULE_LOADORDER_DLL; break;
|
case 'n': type = LOADORDER_DLL; break;
|
||||||
|
|
||||||
case 'E': /* Elfdll */
|
case 'E': /* Elfdll */
|
||||||
case 'e':
|
case 'e':
|
||||||
if (!warn++) MESSAGE("Load order 'elfdll' no longer supported, ignored\n");
|
if (!warn++) MESSAGE("Load order 'elfdll' no longer supported, ignored\n");
|
||||||
break;
|
break;
|
||||||
case 'S': /* So */
|
case 'S': /* So */
|
||||||
case 's': type = MODULE_LOADORDER_SO; break;
|
case 's': type = LOADORDER_SO; break;
|
||||||
|
|
||||||
case 'B': /* Builtin */
|
case 'B': /* Builtin */
|
||||||
case 'b': type = MODULE_LOADORDER_BI; break;
|
case 'b': type = LOADORDER_BI; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Invalid load order module-type '%s', ignored\n", cptr);
|
ERR("Invalid load order module-type '%s', ignored\n", cptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type != MODULE_LOADORDER_INVALID)
|
if(type != LOADORDER_INVALID) lo[n++] = type;
|
||||||
{
|
|
||||||
mlo->loadorder[n++] = type;
|
|
||||||
}
|
|
||||||
cptr = get_tok(NULL, ", \t");
|
cptr = get_tok(NULL, ", \t");
|
||||||
}
|
}
|
||||||
|
lo[n] = LOADORDER_INVALID;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,44 +223,39 @@ static BOOL ParseLoadOrder(char *order, module_loadorder_t *mlo)
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* AddLoadOrder (internal, static)
|
* AddLoadOrder (internal, static)
|
||||||
*
|
*
|
||||||
* Adds an entry in the list of overrides. If the entry exists, then the
|
* Adds an entry in the list of command-line overrides.
|
||||||
* override parameter determines whether it will be overwritten.
|
|
||||||
*/
|
*/
|
||||||
static BOOL AddLoadOrder(module_loadorder_t *plo, BOOL override)
|
static BOOL AddLoadOrder(module_loadorder_t *plo)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* TRACE(module, "'%s' -> %08lx\n", plo->modulename, *(DWORD *)(plo->loadorder)); */
|
/* TRACE(module, "'%s' -> %08lx\n", plo->modulename, *(DWORD *)(plo->loadorder)); */
|
||||||
|
|
||||||
for(i = 0; i < nmodule_loadorder; i++)
|
for(i = 0; i < cmdline_list.count; i++)
|
||||||
{
|
{
|
||||||
if(!cmp_sort_func(plo, &module_loadorder[i]))
|
if(!cmp_sort_func(plo, &cmdline_list.order[i] ))
|
||||||
{
|
{
|
||||||
if(!override)
|
/* replace existing option */
|
||||||
ERR("Module '%s' is already in the list of overrides, using first definition\n", plo->modulename);
|
memcpy( cmdline_list.order[i].loadorder, plo->loadorder, sizeof(plo->loadorder));
|
||||||
else
|
|
||||||
memcpy(module_loadorder[i].loadorder, plo->loadorder, sizeof(plo->loadorder));
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nmodule_loadorder >= nmodule_loadorder_alloc)
|
if (i >= cmdline_list.alloc)
|
||||||
{
|
{
|
||||||
/* No space in current array, make it larger */
|
/* No space in current array, make it larger */
|
||||||
nmodule_loadorder_alloc += LOADORDER_ALLOC_CLUSTER;
|
cmdline_list.alloc += LOADORDER_ALLOC_CLUSTER;
|
||||||
module_loadorder = (module_loadorder_t *)HeapReAlloc(GetProcessHeap(),
|
cmdline_list.order = HeapReAlloc(GetProcessHeap(), 0, cmdline_list.order,
|
||||||
0,
|
cmdline_list.alloc * sizeof(module_loadorder_t));
|
||||||
module_loadorder,
|
if(!cmdline_list.order)
|
||||||
nmodule_loadorder_alloc * sizeof(module_loadorder_t));
|
|
||||||
if(!module_loadorder)
|
|
||||||
{
|
{
|
||||||
MESSAGE("Virtual memory exhausted\n");
|
MESSAGE("Virtual memory exhausted\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(module_loadorder[nmodule_loadorder].loadorder, plo->loadorder, sizeof(plo->loadorder));
|
memcpy(cmdline_list.order[i].loadorder, plo->loadorder, sizeof(plo->loadorder));
|
||||||
module_loadorder[nmodule_loadorder].modulename = HEAP_strdupA(GetProcessHeap(), 0, plo->modulename);
|
cmdline_list.order[i].modulename = HEAP_strdupA(GetProcessHeap(), 0, plo->modulename);
|
||||||
nmodule_loadorder++;
|
cmdline_list.count++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,17 +263,15 @@ static BOOL AddLoadOrder(module_loadorder_t *plo, BOOL override)
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* AddLoadOrderSet (internal, static)
|
* AddLoadOrderSet (internal, static)
|
||||||
*
|
*
|
||||||
* Adds a set of entries in the list of overrides from the key parameter.
|
* Adds a set of entries in the list of command-line overrides from the key parameter.
|
||||||
* If the entry exists, then the override parameter determines whether it
|
|
||||||
* will be overwritten.
|
|
||||||
*/
|
*/
|
||||||
static BOOL AddLoadOrderSet(char *key, char *order, BOOL override)
|
static BOOL AddLoadOrderSet(char *key, char *order)
|
||||||
{
|
{
|
||||||
module_loadorder_t ldo;
|
module_loadorder_t ldo;
|
||||||
char *cptr;
|
char *cptr;
|
||||||
|
|
||||||
/* Parse the loadorder before the rest because strtok is not reentrant */
|
/* Parse the loadorder before the rest because strtok is not reentrant */
|
||||||
if(!ParseLoadOrder(order, &ldo))
|
if(!ParseLoadOrder(order, ldo.loadorder))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
cptr = get_tok(key, ", \t");
|
cptr = get_tok(key, ", \t");
|
||||||
@ -272,8 +286,7 @@ static BOOL AddLoadOrderSet(char *key, char *order, BOOL override)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ldo.modulename = cptr;
|
ldo.modulename = cptr;
|
||||||
if(!AddLoadOrder(&ldo, override))
|
if(!AddLoadOrder(&ldo)) return FALSE;
|
||||||
return FALSE;
|
|
||||||
cptr = get_tok(NULL, ", \t");
|
cptr = get_tok(NULL, ", \t");
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -281,190 +294,220 @@ static BOOL AddLoadOrderSet(char *key, char *order, BOOL override)
|
|||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* ParseCommandlineOverrides (internal, static)
|
* MODULE_AddLoadOrderOption
|
||||||
*
|
*
|
||||||
* The commandline is in the form:
|
* The commandline option is in the form:
|
||||||
* name[,name,...]=native[,b,...][+...]
|
* name[,name,...]=native[,b,...]
|
||||||
*/
|
*/
|
||||||
static BOOL ParseCommandlineOverrides(void)
|
void MODULE_AddLoadOrderOption( const char *option )
|
||||||
{
|
{
|
||||||
char *cpy;
|
char *key = HEAP_strdupA(GetProcessHeap(), 0, option);
|
||||||
char *key;
|
char *value = strchr(key, '=');
|
||||||
char *next;
|
|
||||||
char *value;
|
|
||||||
BOOL retval = TRUE;
|
|
||||||
|
|
||||||
if(!Options.dllFlags)
|
if (!value) goto error;
|
||||||
return TRUE;
|
*value++ = '\0';
|
||||||
|
|
||||||
cpy = HEAP_strdupA(GetProcessHeap(), 0, Options.dllFlags);
|
|
||||||
key = cpy;
|
|
||||||
next = key;
|
|
||||||
for(; next; key = next)
|
|
||||||
{
|
|
||||||
next = strchr(key, '+');
|
|
||||||
if(next)
|
|
||||||
{
|
|
||||||
*next = '\0';
|
|
||||||
next++;
|
|
||||||
}
|
|
||||||
value = strchr(key, '=');
|
|
||||||
if(!value)
|
|
||||||
{
|
|
||||||
retval = FALSE;
|
|
||||||
goto endit;
|
|
||||||
}
|
|
||||||
*value = '\0';
|
|
||||||
value++;
|
|
||||||
|
|
||||||
TRACE("Commandline override '%s' = '%s'\n", key, value);
|
TRACE("Commandline override '%s' = '%s'\n", key, value);
|
||||||
|
|
||||||
if(!AddLoadOrderSet(key, value, TRUE))
|
if (!AddLoadOrderSet(key, value)) goto error;
|
||||||
{
|
HeapFree(GetProcessHeap(), 0, key);
|
||||||
retval = FALSE;
|
|
||||||
goto endit;
|
/* sort the array for quick lookup */
|
||||||
}
|
qsort(cmdline_list.order, cmdline_list.count, sizeof(cmdline_list.order[0]), cmp_sort_func);
|
||||||
}
|
return;
|
||||||
endit:
|
|
||||||
HeapFree(GetProcessHeap(), 0, cpy);
|
error:
|
||||||
return retval;;
|
MESSAGE( "Syntax: -dll name[,name[,...]]={native|so|builtin}[,{n|s|b}[,...]]\n"
|
||||||
|
" - 'name' is the name of any dll without extension\n"
|
||||||
|
" - the order of loading (native, so and builtin) can be abbreviated\n"
|
||||||
|
" with the first letter\n"
|
||||||
|
" - the option can be specified multiple times\n"
|
||||||
|
" Example:\n"
|
||||||
|
" -dll comdlg32,commdlg=n -dll shell,shell32=b\n" );
|
||||||
|
ExitProcess(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* MODULE_InitLoadOrder (internal)
|
* set_registry_keys
|
||||||
*
|
|
||||||
* Initialize the load order from the wine.conf file.
|
|
||||||
* The section has the following format:
|
|
||||||
* Section:
|
|
||||||
* [DllDefaults]
|
|
||||||
*
|
|
||||||
* Keys:
|
|
||||||
* DefaultLoadOrder=native,so,builtin
|
|
||||||
* A comma separated list of module types to try to load in that specific
|
|
||||||
* order. The DefaultLoadOrder key is used as a fallback when a module is
|
|
||||||
* not specified explicitly. If the DefaultLoadOrder key is not found,
|
|
||||||
* then the order "dll,so,bi" is used
|
|
||||||
* The possible module types are:
|
|
||||||
* - native Native windows dll files
|
|
||||||
* - so Native .so libraries mapped to dlls
|
|
||||||
* - builtin Built-in modules
|
|
||||||
*
|
|
||||||
* Case is not important and only the first letter of each type is enough to
|
|
||||||
* identify the type n[ative], s[o], b[uiltin]. Also whitespace is
|
|
||||||
* ignored.
|
|
||||||
* E.g.:
|
|
||||||
* n,s , b
|
|
||||||
* is equal to:
|
|
||||||
* native,so,builtin
|
|
||||||
*
|
|
||||||
* Section:
|
|
||||||
* [DllOverrides]
|
|
||||||
*
|
|
||||||
* Keys:
|
|
||||||
* There are no explicit keys defined other than module/library names. A comma
|
|
||||||
* separated list of modules is followed by an assignment of the load-order
|
|
||||||
* for these specific modules. See above for possible types. You should not
|
|
||||||
* specify an extension.
|
|
||||||
* Examples:
|
|
||||||
* kernel32, gdi32, user32 = builtin
|
|
||||||
* kernel, gdi, user = builtin
|
|
||||||
* comdlg32 = native, builtin
|
|
||||||
* commdlg = native, builtin
|
|
||||||
* version, ver = native, builtin
|
|
||||||
*
|
*
|
||||||
|
* Set individual registry keys for a multiple dll specification
|
||||||
|
* Helper for MODULE_InitLoadOrder().
|
||||||
*/
|
*/
|
||||||
|
inline static void set_registry_keys( HKEY hkey, char *module, const char *buffer )
|
||||||
#define BUFFERSIZE 1024
|
|
||||||
|
|
||||||
BOOL MODULE_InitLoadOrder(void)
|
|
||||||
{
|
{
|
||||||
char buffer[BUFFERSIZE];
|
static int warn;
|
||||||
char key[256];
|
char *p = get_tok( module, ", \t" );
|
||||||
int nbuffer;
|
|
||||||
int idx;
|
|
||||||
const struct tagDllPair *dllpair;
|
|
||||||
|
|
||||||
/* Get the default load order */
|
TRACE( "converting \"%s\" = \"%s\"\n", module, buffer );
|
||||||
nbuffer = PROFILE_GetWineIniString("DllDefaults", "DefaultLoadOrder", "n,b,s", buffer, sizeof(buffer));
|
|
||||||
if(!nbuffer)
|
if (!warn)
|
||||||
|
MESSAGE( "Warning: setting multiple modules in a single DllOverrides entry is no longer\n"
|
||||||
|
"recommended. It is suggested that you rewrite the configuration file entry:\n\n"
|
||||||
|
"\"%s\" = \"%s\"\n\n"
|
||||||
|
"into something like:\n\n", module, buffer );
|
||||||
|
while (p)
|
||||||
{
|
{
|
||||||
MESSAGE("MODULE_InitLoadOrder: mysteriously read nothing from default loadorder\n");
|
if (!warn) MESSAGE( "\"%s\" = \"%s\"\n", p, buffer );
|
||||||
|
/* only set it if not existing already */
|
||||||
|
if (RegQueryValueExA( hkey, p, 0, NULL, NULL, NULL ) == ERROR_FILE_NOT_FOUND)
|
||||||
|
RegSetValueExA( hkey, p, 0, REG_SZ, buffer, strlen(buffer)+1 );
|
||||||
|
p = get_tok( NULL, ", \t" );
|
||||||
|
}
|
||||||
|
if (!warn) MESSAGE( "\n" );
|
||||||
|
warn = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* MODULE_InitLoadOrder
|
||||||
|
*
|
||||||
|
* Convert entries containing multiple dll names (old syntax) to the
|
||||||
|
* new one dll module per entry syntax
|
||||||
|
*/
|
||||||
|
void MODULE_InitLoadOrder(void)
|
||||||
|
{
|
||||||
|
char module[80];
|
||||||
|
char buffer[1024];
|
||||||
|
char *p;
|
||||||
|
HKEY hkey;
|
||||||
|
DWORD index = 0;
|
||||||
|
|
||||||
|
if (RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\DllOverrides", &hkey ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
DWORD type, count = sizeof(buffer), name_len = sizeof(module);
|
||||||
|
|
||||||
|
if (RegEnumValueA( hkey, index, module, &name_len, NULL, &type, buffer, &count )) break;
|
||||||
|
p = module;
|
||||||
|
while (isspace(*p)) p++;
|
||||||
|
p += strcspn( p, ", \t" );
|
||||||
|
while (isspace(*p)) p++;
|
||||||
|
if (*p)
|
||||||
|
{
|
||||||
|
RegDeleteValueA( hkey, module );
|
||||||
|
set_registry_keys( hkey, module, buffer );
|
||||||
|
}
|
||||||
|
else index++;
|
||||||
|
}
|
||||||
|
RegCloseKey( hkey );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* get_list_load_order
|
||||||
|
*
|
||||||
|
* Get the load order for a given module from the command-line or
|
||||||
|
* default lists.
|
||||||
|
*/
|
||||||
|
static BOOL get_list_load_order( const char *module, const struct loadorder_list *list,
|
||||||
|
enum loadorder_type lo[] )
|
||||||
|
{
|
||||||
|
module_loadorder_t tmp, *res;
|
||||||
|
|
||||||
|
tmp.modulename = module;
|
||||||
|
if ((res = bsearch(&tmp, list->order, list->count, sizeof(list->order[0]), cmp_sort_func)))
|
||||||
|
memcpy( lo, res->loadorder, sizeof(res->loadorder) );
|
||||||
|
return (res != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* get_app_load_order
|
||||||
|
*
|
||||||
|
* Get the load order for a given module from the app-specific DllOverrides list
|
||||||
|
*/
|
||||||
|
static BOOL get_app_load_order( const char *module, enum loadorder_type lo[] )
|
||||||
|
{
|
||||||
|
HKEY hkey, appkey;
|
||||||
|
DWORD count, type, res;
|
||||||
|
char buffer[MAX_PATH+16], *appname, *p;
|
||||||
|
|
||||||
|
if (!GetModuleFileName16( GetCurrentTask(), buffer, MAX_PATH ) &&
|
||||||
|
!GetModuleFileNameA( 0, buffer, MAX_PATH ))
|
||||||
|
{
|
||||||
|
WARN( "could not get module file name loading %s\n", module );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
appname = buffer;
|
||||||
|
if ((p = strrchr( appname, '/' ))) appname = p + 1;
|
||||||
|
if ((p = strrchr( appname, '\\' ))) appname = p + 1;
|
||||||
|
|
||||||
TRACE("Setting default loadorder=%s\n", buffer);
|
TRACE( "searching '%s' in AppDefaults\\%s\\DllOverrides\n", module, appname );
|
||||||
|
|
||||||
if(!ParseLoadOrder(buffer, &default_loadorder))
|
if (RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\AppDefaults", &hkey ))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
default_loadorder.modulename = "<none>";
|
|
||||||
|
|
||||||
{
|
/* open AppDefaults\\appname\\DllOverrides key */
|
||||||
int i;
|
strcat( appname, "\\DllOverrides" );
|
||||||
for (i=0;DefaultDllOverrides[i].key;i++)
|
res = RegOpenKeyA( hkey, appname, &appkey );
|
||||||
AddLoadOrderSet(
|
RegCloseKey( hkey );
|
||||||
DefaultDllOverrides[i].key,
|
if (res) return FALSE;
|
||||||
DefaultDllOverrides[i].value,
|
|
||||||
FALSE
|
count = sizeof(buffer);
|
||||||
);
|
res = RegQueryValueExA( appkey, module, NULL, &type, buffer, &count );
|
||||||
|
RegCloseKey( appkey );
|
||||||
|
if (res) return FALSE;
|
||||||
|
TRACE( "got app loadorder '%s' for '%s'\n", buffer, module );
|
||||||
|
return ParseLoadOrder( buffer, lo );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the explicitly defined orders for specific modules as an entire section */
|
|
||||||
idx = 0;
|
/***************************************************************************
|
||||||
while (PROFILE_EnumWineIniString( "DllOverrides", idx++, key, sizeof(key),
|
* get_standard_load_order
|
||||||
buffer, sizeof(buffer)))
|
*
|
||||||
|
* Get the load order for a given module from the main DllOverrides list
|
||||||
|
*/
|
||||||
|
static BOOL get_standard_load_order( const char *module, enum loadorder_type lo[] )
|
||||||
{
|
{
|
||||||
TRACE("Key '%s' uses override '%s'\n", key, buffer);
|
HKEY hkey;
|
||||||
if(!AddLoadOrderSet(key, buffer, TRUE))
|
DWORD count, type, res;
|
||||||
|
char buffer[80];
|
||||||
|
|
||||||
|
if (RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\DllOverrides", &hkey ))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
count = sizeof(buffer);
|
||||||
|
res = RegQueryValueExA( hkey, module, NULL, &type, buffer, &count );
|
||||||
|
RegCloseKey( hkey );
|
||||||
|
if (res) return FALSE;
|
||||||
|
TRACE( "got standard loadorder '%s' for '%s'\n", buffer, module );
|
||||||
|
return ParseLoadOrder( buffer, lo );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add the command line overrides to the pool */
|
|
||||||
if(!ParseCommandlineOverrides())
|
/***************************************************************************
|
||||||
|
* get_default_load_order
|
||||||
|
*
|
||||||
|
* Get the default load order if nothing specified for a given dll.
|
||||||
|
*/
|
||||||
|
static void get_default_load_order( enum loadorder_type lo[] )
|
||||||
{
|
{
|
||||||
MESSAGE( "Syntax: -dll name[,name[,...]]={native|so|builtin}[,{n|s|b}[,...]][+...]\n"
|
DWORD res;
|
||||||
" - 'name' is the name of any dll without extension\n"
|
static enum loadorder_type default_loadorder[LOADORDER_NTYPES];
|
||||||
" - the order of loading (native, so and builtin) can be abbreviated\n"
|
static int loaded;
|
||||||
" with the first letter\n"
|
|
||||||
" - different loadorders for different dlls can be specified by separating the\n"
|
|
||||||
" command line entries with a '+'\n"
|
|
||||||
" Example:\n"
|
|
||||||
" -dll comdlg32,commdlg=n+shell,shell32=b\n"
|
|
||||||
);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sort the array for quick lookup */
|
if (!loaded)
|
||||||
qsort(module_loadorder, nmodule_loadorder, sizeof(module_loadorder[0]), cmp_sort_func);
|
|
||||||
|
|
||||||
/* Check the pairs of dlls */
|
|
||||||
dllpair = DllPairs;
|
|
||||||
while (dllpair->dll1)
|
|
||||||
{
|
{
|
||||||
module_loadorder_t *plo1, *plo2;
|
char buffer[80];
|
||||||
plo1 = MODULE_GetLoadOrder(dllpair->dll1, FALSE);
|
HKEY hkey;
|
||||||
plo2 = MODULE_GetLoadOrder(dllpair->dll2, FALSE);
|
|
||||||
assert(plo1 && plo2);
|
|
||||||
if(memcmp(plo1->loadorder, plo2->loadorder, sizeof(plo1->loadorder)))
|
|
||||||
MESSAGE("Warning: Modules '%s' and '%s' have different loadorder which may cause trouble\n", dllpair->dll1, dllpair->dll2);
|
|
||||||
dllpair++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(TRACE_ON(module))
|
if (!(res = RegOpenKeyA( HKEY_LOCAL_MACHINE,
|
||||||
|
"Software\\Wine\\Wine\\Config\\DllDefaults", &hkey )))
|
||||||
{
|
{
|
||||||
int i, j;
|
DWORD type, count = sizeof(buffer);
|
||||||
static char types[] = "-NSB";
|
|
||||||
|
|
||||||
for(i = 0; i < nmodule_loadorder; i++)
|
res = RegQueryValueExA( hkey, "DefaultLoadOrder", NULL, &type, buffer, &count );
|
||||||
{
|
RegCloseKey( hkey );
|
||||||
DPRINTF("%3d: %-12s:", i, module_loadorder[i].modulename);
|
|
||||||
for(j = 0; j < MODULE_LOADORDER_NTYPES; j++)
|
|
||||||
DPRINTF(" %c", types[module_loadorder[i].loadorder[j] % (MODULE_LOADORDER_NTYPES+1)]);
|
|
||||||
DPRINTF("\n");
|
|
||||||
}
|
}
|
||||||
|
if (res) strcpy( buffer, "n,b,s" );
|
||||||
|
ParseLoadOrder( buffer, default_loadorder );
|
||||||
|
loaded = 1;
|
||||||
|
TRACE( "got default loadorder '%s'\n", buffer );
|
||||||
}
|
}
|
||||||
|
memcpy( lo, default_loadorder, sizeof(default_loadorder) );
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -476,9 +519,8 @@ BOOL MODULE_InitLoadOrder(void)
|
|||||||
* '.dll' and '.exe'. A lookup in the table can yield an override for
|
* '.dll' and '.exe'. A lookup in the table can yield an override for
|
||||||
* the specific dll. Otherwise the default load order is returned.
|
* the specific dll. Otherwise the default load order is returned.
|
||||||
*/
|
*/
|
||||||
module_loadorder_t *MODULE_GetLoadOrder(const char *path, BOOL win32 )
|
void MODULE_GetLoadOrder( enum loadorder_type loadorder[], const char *path, BOOL win32 )
|
||||||
{
|
{
|
||||||
module_loadorder_t lo, *tmp;
|
|
||||||
char fname[256];
|
char fname[256];
|
||||||
char sysdir[MAX_PATH+1];
|
char sysdir[MAX_PATH+1];
|
||||||
char *cptr;
|
char *cptr;
|
||||||
@ -487,10 +529,7 @@ module_loadorder_t *MODULE_GetLoadOrder(const char *path, BOOL win32 )
|
|||||||
|
|
||||||
TRACE("looking for %s\n", path);
|
TRACE("looking for %s\n", path);
|
||||||
|
|
||||||
assert(path != NULL);
|
if ( ! GetSystemDirectoryA ( sysdir, MAX_PATH ) ) goto done;
|
||||||
|
|
||||||
if ( ! GetSystemDirectoryA ( sysdir, MAX_PATH ) )
|
|
||||||
return &default_loadorder; /* Hmmm ... */
|
|
||||||
|
|
||||||
/* Strip path information for 16 bit modules or if the module
|
/* Strip path information for 16 bit modules or if the module
|
||||||
resides in the system directory */
|
resides in the system directory */
|
||||||
@ -517,21 +556,27 @@ module_loadorder_t *MODULE_GetLoadOrder(const char *path, BOOL win32 )
|
|||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
if(len >= sizeof(fname) || len <= 0)
|
if(len >= sizeof(fname) || len <= 0)
|
||||||
{
|
{
|
||||||
ERR("Path '%s' -> '%s' reduces to zilch or just too large...\n", path, name);
|
WARN("Path '%s' -> '%s' reduces to zilch or just too large...\n", path, name);
|
||||||
return &default_loadorder;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(fname, name);
|
strcpy(fname, name);
|
||||||
if(len >= 4 && (!FILE_strcasecmp(fname+len-4, ".dll") || !FILE_strcasecmp(fname+len-4, ".exe")))
|
if(len >= 4 && (!FILE_strcasecmp(fname+len-4, ".dll") || !FILE_strcasecmp(fname+len-4, ".exe")))
|
||||||
fname[len-4] = '\0';
|
fname[len-4] = '\0';
|
||||||
|
|
||||||
lo.modulename = fname;
|
/* check command-line first */
|
||||||
tmp = bsearch(&lo, module_loadorder, nmodule_loadorder, sizeof(module_loadorder[0]), cmp_sort_func);
|
if (get_list_load_order( fname, &cmdline_list, loadorder )) return;
|
||||||
|
|
||||||
TRACE("Looking for '%s' (%s), found '%s'\n", path, fname, tmp ? tmp->modulename : "<nothing>");
|
/* then app-specific config */
|
||||||
|
if (get_app_load_order( fname, loadorder )) return;
|
||||||
|
|
||||||
if(!tmp)
|
/* then standard config */
|
||||||
return &default_loadorder;
|
if (get_standard_load_order( fname, loadorder )) return;
|
||||||
return tmp;
|
|
||||||
|
/* then compiled-in defaults */
|
||||||
|
if (get_list_load_order( fname, &default_list, loadorder )) return;
|
||||||
|
|
||||||
|
done:
|
||||||
|
/* last, return the default */
|
||||||
|
get_default_load_order( loadorder );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,12 +59,12 @@ BOOL MAIN_MainInit(void)
|
|||||||
/* Registry initialisation */
|
/* Registry initialisation */
|
||||||
SHELL_LoadRegistry();
|
SHELL_LoadRegistry();
|
||||||
|
|
||||||
|
/* Initialize module loadorder */
|
||||||
|
if (CLIENT_IsBootThread()) MODULE_InitLoadOrder();
|
||||||
|
|
||||||
/* Global boot finished, the rest is process-local */
|
/* Global boot finished, the rest is process-local */
|
||||||
CLIENT_BootDone( TRACE_ON(server) );
|
CLIENT_BootDone( TRACE_ON(server) );
|
||||||
|
|
||||||
/* Initialize module loadorder */
|
|
||||||
if (!MODULE_InitLoadOrder()) return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1305,7 +1305,7 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
|
|||||||
DWORD err = GetLastError();
|
DWORD err = GetLastError();
|
||||||
WINE_MODREF *pwm;
|
WINE_MODREF *pwm;
|
||||||
int i;
|
int i;
|
||||||
module_loadorder_t *plo;
|
enum loadorder_type loadorder[LOADORDER_NTYPES];
|
||||||
LPSTR filename, p;
|
LPSTR filename, p;
|
||||||
const char *filetype = "";
|
const char *filetype = "";
|
||||||
|
|
||||||
@ -1388,36 +1388,34 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
|
|||||||
return pwm;
|
return pwm;
|
||||||
}
|
}
|
||||||
|
|
||||||
plo = MODULE_GetLoadOrder(filename, TRUE);
|
MODULE_GetLoadOrder( loadorder, filename, TRUE);
|
||||||
|
|
||||||
for(i = 0; i < MODULE_LOADORDER_NTYPES; i++)
|
for(i = 0; i < LOADORDER_NTYPES; i++)
|
||||||
{
|
{
|
||||||
|
if (loadorder[i] == LOADORDER_INVALID) break;
|
||||||
SetLastError( ERROR_FILE_NOT_FOUND );
|
SetLastError( ERROR_FILE_NOT_FOUND );
|
||||||
switch(plo->loadorder[i])
|
|
||||||
|
switch(loadorder[i])
|
||||||
{
|
{
|
||||||
case MODULE_LOADORDER_DLL:
|
case LOADORDER_DLL:
|
||||||
TRACE("Trying native dll '%s'\n", filename);
|
TRACE("Trying native dll '%s'\n", filename);
|
||||||
pwm = PE_LoadLibraryExA(filename, flags);
|
pwm = PE_LoadLibraryExA(filename, flags);
|
||||||
filetype = "native";
|
filetype = "native";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODULE_LOADORDER_SO:
|
case LOADORDER_SO:
|
||||||
TRACE("Trying so-library '%s'\n", filename);
|
TRACE("Trying so-library '%s'\n", filename);
|
||||||
pwm = ELF_LoadLibraryExA(filename, flags);
|
pwm = ELF_LoadLibraryExA(filename, flags);
|
||||||
filetype = "so";
|
filetype = "so";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODULE_LOADORDER_BI:
|
case LOADORDER_BI:
|
||||||
TRACE("Trying built-in '%s'\n", filename);
|
TRACE("Trying built-in '%s'\n", filename);
|
||||||
pwm = BUILTIN32_LoadLibraryExA(filename, flags);
|
pwm = BUILTIN32_LoadLibraryExA(filename, flags);
|
||||||
filetype = "builtin";
|
filetype = "builtin";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Got invalid loadorder type %d (%s index %d)\n", plo->loadorder[i], plo->modulename, i);
|
|
||||||
/* Fall through */
|
|
||||||
|
|
||||||
case MODULE_LOADORDER_INVALID: /* We ignore this as it is an empty entry */
|
|
||||||
pwm = NULL;
|
pwm = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -891,35 +891,33 @@ static HINSTANCE16 NE_LoadModule( LPCSTR name, BOOL lib_only )
|
|||||||
*/
|
*/
|
||||||
static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_only )
|
static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_only )
|
||||||
{
|
{
|
||||||
HINSTANCE16 hinst;
|
HINSTANCE16 hinst = 2;
|
||||||
|
enum loadorder_type loadorder[LOADORDER_NTYPES];
|
||||||
int i;
|
int i;
|
||||||
module_loadorder_t *plo;
|
|
||||||
const char *filetype = "";
|
const char *filetype = "";
|
||||||
|
|
||||||
plo = MODULE_GetLoadOrder(libname, FALSE);
|
MODULE_GetLoadOrder(loadorder, libname, FALSE);
|
||||||
|
|
||||||
for(i = 0; i < MODULE_LOADORDER_NTYPES; i++)
|
for(i = 0; i < LOADORDER_NTYPES; i++)
|
||||||
{
|
{
|
||||||
switch(plo->loadorder[i])
|
if (loadorder[i] == LOADORDER_INVALID) break;
|
||||||
|
|
||||||
|
switch(loadorder[i])
|
||||||
{
|
{
|
||||||
case MODULE_LOADORDER_DLL:
|
case LOADORDER_DLL:
|
||||||
TRACE("Trying native dll '%s'\n", libname);
|
TRACE("Trying native dll '%s'\n", libname);
|
||||||
hinst = NE_LoadModule(libname, lib_only);
|
hinst = NE_LoadModule(libname, lib_only);
|
||||||
filetype = "native";
|
filetype = "native";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODULE_LOADORDER_BI:
|
case LOADORDER_BI:
|
||||||
TRACE("Trying built-in '%s'\n", libname);
|
TRACE("Trying built-in '%s'\n", libname);
|
||||||
hinst = BUILTIN_LoadModule(libname);
|
hinst = BUILTIN_LoadModule(libname);
|
||||||
filetype = "builtin";
|
filetype = "builtin";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LOADORDER_SO: /* This is not supported for NE modules */
|
||||||
default:
|
default:
|
||||||
ERR("Got invalid loadorder type %d (%s index %d)\n", plo->loadorder[i], plo->modulename, i);
|
|
||||||
/* Fall through */
|
|
||||||
|
|
||||||
case MODULE_LOADORDER_SO: /* This is not supported for NE modules */
|
|
||||||
case MODULE_LOADORDER_INVALID: /* We ignore this as it is an empty entry */
|
|
||||||
hinst = 2;
|
hinst = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "ntddk.h"
|
#include "ntddk.h"
|
||||||
#include "wine/library.h"
|
#include "wine/library.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "loadorder.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "debugtools.h"
|
#include "debugtools.h"
|
||||||
|
|
||||||
@ -31,7 +32,6 @@ struct options Options =
|
|||||||
{
|
{
|
||||||
NULL, /* desktopGeometry */
|
NULL, /* desktopGeometry */
|
||||||
NULL, /* display */
|
NULL, /* display */
|
||||||
NULL, /* dllFlags */
|
|
||||||
FALSE, /* synchronous */
|
FALSE, /* synchronous */
|
||||||
FALSE /* Managed windows */
|
FALSE /* Managed windows */
|
||||||
};
|
};
|
||||||
@ -62,7 +62,6 @@ static char *xstrdup( const char *str )
|
|||||||
static void do_debugmsg( const char *arg );
|
static void do_debugmsg( const char *arg );
|
||||||
static void do_desktop( const char *arg );
|
static void do_desktop( const char *arg );
|
||||||
static void do_display( const char *arg );
|
static void do_display( const char *arg );
|
||||||
static void do_dll( const char *arg );
|
|
||||||
static void do_help( const char *arg );
|
static void do_help( const char *arg );
|
||||||
static void do_language( const char *arg );
|
static void do_language( const char *arg );
|
||||||
static void do_managed( const char *arg );
|
static void do_managed( const char *arg );
|
||||||
@ -77,7 +76,7 @@ static const struct option_descr option_table[] =
|
|||||||
"--desktop geom Use a desktop window of the given geometry" },
|
"--desktop geom Use a desktop window of the given geometry" },
|
||||||
{ "display", 0, 1, 0, do_display,
|
{ "display", 0, 1, 0, do_display,
|
||||||
"--display name Use the specified display" },
|
"--display name Use the specified display" },
|
||||||
{ "dll", 0, 1, 1, do_dll,
|
{ "dll", 0, 1, 1, MODULE_AddLoadOrderOption,
|
||||||
"--dll name Enable or disable built-in DLLs" },
|
"--dll name Enable or disable built-in DLLs" },
|
||||||
{ "dosver", 0, 1, 1, VERSION_ParseDosVersion,
|
{ "dosver", 0, 1, 1, VERSION_ParseDosVersion,
|
||||||
"--dosver x.xx DOS version to imitate (e.g. 6.22)\n"
|
"--dosver x.xx DOS version to imitate (e.g. 6.22)\n"
|
||||||
@ -125,22 +124,6 @@ static void do_display( const char *arg )
|
|||||||
Options.display = xstrdup( arg );
|
Options.display = xstrdup( arg );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_dll( const char *arg )
|
|
||||||
{
|
|
||||||
if (Options.dllFlags)
|
|
||||||
{
|
|
||||||
Options.dllFlags = (char *) realloc ( Options.dllFlags,
|
|
||||||
strlen ( Options.dllFlags ) + strlen ( arg ) + 2 );
|
|
||||||
if ( !Options.dllFlags ) out_of_memory();
|
|
||||||
strcat ( Options.dllFlags, "+" );
|
|
||||||
strcat ( Options.dllFlags, arg );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Options.dllFlags = xstrdup( arg );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void do_language( const char *arg )
|
static void do_language( const char *arg )
|
||||||
{
|
{
|
||||||
SetEnvironmentVariableA( "LANGUAGE", arg );
|
SetEnvironmentVariableA( "LANGUAGE", arg );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user