Commit 64271d52 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use URI with stripped "wine:" part in NewURI call.

parent 699ef11d
......@@ -727,8 +727,10 @@ HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*);
void *nsalloc(size_t) __WINE_ALLOC_SIZE(1);
void nsfree(void*);
void nsACString_InitDepend(nsACString*,const char*);
void nsACString_SetData(nsACString*,const char*);
PRUint32 nsACString_GetData(const nsACString*,const char**);
void nsACString_Finish(nsACString*);
BOOL nsAString_Init(nsAString*,const PRUnichar*);
void nsAString_InitDepend(nsAString*,const PRUnichar*);
......
......@@ -48,19 +48,14 @@ WINE_DECLARE_DEBUG_CHANNEL(gecko);
#define PR_UINT32_MAX 0xffffffff
struct nsCStringContainer {
void *v;
void *d1;
PRUint32 d2;
PRUint32 d3;
};
#define NS_STRING_CONTAINER_INIT_DEPEND 0x0002
#define NS_CSTRING_CONTAINER_INIT_DEPEND 0x0002
static nsresult (*NS_InitXPCOM2)(nsIServiceManager**,void*,void*);
static nsresult (*NS_ShutdownXPCOM)(nsIServiceManager*);
static nsresult (*NS_GetComponentRegistrar)(nsIComponentRegistrar**);
static nsresult (*NS_StringContainerInit2)(nsStringContainer*,const PRUnichar*,PRUint32,PRUint32);
static nsresult (*NS_CStringContainerInit2)(nsCStringContainer*,const char*,PRUint32,PRUint32);
static nsresult (*NS_CStringContainerInit)(nsCStringContainer*);
static nsresult (*NS_StringContainerFinish)(nsStringContainer*);
static nsresult (*NS_CStringContainerFinish)(nsCStringContainer*);
......@@ -187,6 +182,7 @@ static BOOL load_xpcom(const PRUnichar *gre_path)
NS_DLSYM(NS_InitXPCOM2);
NS_DLSYM(NS_ShutdownXPCOM);
NS_DLSYM(NS_GetComponentRegistrar);
NS_DLSYM(NS_CStringContainerInit2);
NS_DLSYM(NS_StringContainerInit2);
NS_DLSYM(NS_CStringContainerInit);
NS_DLSYM(NS_StringContainerFinish);
......@@ -533,6 +529,15 @@ static void nsACString_Init(nsACString *str, const char *data)
nsACString_SetData(str, data);
}
/*
* Initializes nsACString with data owned by caller.
* Caller must ensure that data is valid during lifetime of string object.
*/
void nsACString_InitDepend(nsACString *str, const char *data)
{
NS_CStringContainerInit2(str, data, PR_UINT32_MAX, NS_CSTRING_CONTAINER_INIT_DEPEND);
}
void nsACString_SetData(nsACString *str, const char *data)
{
NS_CStringSetData(str, data, PR_UINT32_MAX);
......@@ -543,7 +548,7 @@ PRUint32 nsACString_GetData(const nsACString *str, const char **data)
return NS_CStringGetData(str, data, NULL);
}
static void nsACString_Finish(nsACString *str)
void nsACString_Finish(nsACString *str)
{
NS_CStringContainerFinish(str);
}
......
......@@ -2453,6 +2453,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
HTMLWindow *window = NULL;
nsIURI *uri = NULL;
LPCWSTR base_wine_url = NULL;
nsACString spec_str;
nsresult nsres;
nsACString_GetData(aSpec, &spec);
......@@ -2485,7 +2486,9 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
}
}
nsACString_InitDepend(&spec_str, spec);
nsres = nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, &uri);
nsACString_Finish(&spec_str);
if(NS_FAILED(nsres))
TRACE("NewURI failed: %08x\n", nsres);
......
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