diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7d4d00ac619..d501da3cc44 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -726,6 +726,7 @@ void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*); void init_nsio(nsIComponentManager*,nsIComponentRegistrar*); void release_nsio(void); BOOL install_wine_gecko(BOOL); +BOOL is_gecko_path(const char*); HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*); HRESULT create_doc_uri(HTMLWindow*,WCHAR*,nsWineURI**); diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index f0eb1015f20..4b7cada2f7d 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -74,6 +74,8 @@ static nsIMemory *nsmem = NULL; static const WCHAR wszNsContainer[] = {'N','s','C','o','n','t','a','i','n','e','r',0}; static ATOM nscontainer_class; +static WCHAR gecko_path[MAX_PATH]; +static unsigned gecko_path_len; static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -411,6 +413,7 @@ static BOOL init_xpcom(const PRUnichar *gre_path) nsIComponentRegistrar *registrar = NULL; nsAString path; nsIFile *gre_dir; + WCHAR *ptr; nsAString_InitDepend(&path, gre_path); nsres = NS_NewLocalFile(&path, FALSE, &gre_dir); @@ -428,6 +431,13 @@ static BOOL init_xpcom(const PRUnichar *gre_path) return FALSE; } + strcpyW(gecko_path, gre_path); + for(ptr = gecko_path; *ptr; ptr++) { + if(*ptr == '\\') + *ptr = '/'; + } + gecko_path_len = ptr-gecko_path; + nsres = nsIServiceManager_QueryInterface(pServMgr, &IID_nsIComponentManager, (void**)&pCompMgr); if(NS_FAILED(nsres)) ERR("Could not get nsIComponentManager: %08x\n", nsres); @@ -788,6 +798,26 @@ void close_gecko(void) /* if (hXPCOM) FreeLibrary(hXPCOM); */ } +BOOL is_gecko_path(const char *path) +{ + WCHAR *buf, *ptr; + BOOL ret; + + buf = heap_strdupAtoW(path); + if(strlenW(buf) < gecko_path_len) + return FALSE; + + buf[gecko_path_len] = 0; + for(ptr = buf; *ptr; ptr++) { + if(*ptr == '\\') + *ptr = '/'; + } + + ret = !strcmpiW(buf, gecko_path); + heap_free(buf); + return ret; +} + /********************************************************** * nsIWebBrowserChrome interface */ diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 46988f667a9..cdd1e24874e 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -2566,6 +2566,13 @@ static BOOL is_gecko_special_uri(const char *spec) return TRUE; } + if(!strncasecmp(spec, "file:", 5)) { + const char *ptr = spec+5; + while(*ptr == '/') + ptr++; + return is_gecko_path(ptr); + } + return FALSE; }