Always add gecko directory to the path before loading xpcom.
This commit is contained in:
parent
80af49401b
commit
ec48726f0c
|
@ -178,8 +178,11 @@ static BOOL load_gecko()
|
|||
nsString path;
|
||||
nsIFile *gre_dir;
|
||||
PRUnichar gre_path[MAX_PATH];
|
||||
WCHAR path_env[MAX_PATH];
|
||||
int len;
|
||||
|
||||
static BOOL tried_load = FALSE;
|
||||
static const WCHAR wszPATH[] = {'P','A','T','H',0};
|
||||
static const WCHAR strXPCOM[] = {'x','p','c','o','m','.','d','l','l',0};
|
||||
|
||||
TRACE("()\n");
|
||||
|
@ -195,13 +198,7 @@ static BOOL load_gecko()
|
|||
|
||||
TRACE("found path %s\n", debugstr_w(gre_path));
|
||||
|
||||
hXPCOM = LoadLibraryW(strXPCOM);
|
||||
if(!hXPCOM) {
|
||||
/* We have to modify PATH as XPCOM loads other DLLs from this directory. */
|
||||
WCHAR path_env[MAX_PATH];
|
||||
static WCHAR wszPATH[] = {'P','A','T','H',0};
|
||||
int len;
|
||||
|
||||
GetEnvironmentVariableW(wszPATH, path_env, sizeof(path_env)/sizeof(WCHAR));
|
||||
len = strlenW(path_env);
|
||||
path_env[len++] = ';';
|
||||
|
@ -213,7 +210,6 @@ static BOOL load_gecko()
|
|||
ERR("Could not load XPCOM: %ld\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#define NS_DLSYM(func) \
|
||||
func = (typeof(func))GetProcAddress(hXPCOM, #func); \
|
||||
|
|
Loading…
Reference in New Issue