Commit 8beb142b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store URL in unicode in nsURI.

parent 961627d3
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "winuser.h" #include "winuser.h"
#include "ole2.h" #include "ole2.h"
#include "shlguid.h" #include "shlguid.h"
#include "wininet.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h" #include "wine/unicode.h"
...@@ -53,7 +54,7 @@ typedef struct { ...@@ -53,7 +54,7 @@ typedef struct {
nsIURI *uri; nsIURI *uri;
NSContainer *container; NSContainer *container;
IMoniker *mon; IMoniker *mon;
LPSTR spec; LPWSTR wine_url;
PRBool is_doc_uri; PRBool is_doc_uri;
} nsURI; } nsURI;
...@@ -1145,7 +1146,7 @@ static nsrefcnt NSAPI nsURI_Release(nsIWineURI *iface) ...@@ -1145,7 +1146,7 @@ static nsrefcnt NSAPI nsURI_Release(nsIWineURI *iface)
nsIURI_Release(This->uri); nsIURI_Release(This->uri);
if(This->mon) if(This->mon)
IMoniker_Release(This->mon); IMoniker_Release(This->mon);
mshtml_free(This->spec); mshtml_free(This->wine_url);
mshtml_free(This); mshtml_free(This);
} }
...@@ -1161,8 +1162,11 @@ static nsresult NSAPI nsURI_GetSpec(nsIWineURI *iface, nsACString *aSpec) ...@@ -1161,8 +1162,11 @@ static nsresult NSAPI nsURI_GetSpec(nsIWineURI *iface, nsACString *aSpec)
if(This->uri) if(This->uri)
return nsIURI_GetSpec(This->uri, aSpec); return nsIURI_GetSpec(This->uri, aSpec);
if(This->spec) { if(This->wine_url) {
nsACString_SetData(aSpec, This->spec); char speca[INTERNET_MAX_URL_LENGTH];
WideCharToMultiByte(CP_ACP, 0, This->wine_url, -1, speca, sizeof(speca), NULL, NULL);
nsACString_SetData(aSpec, speca);
return NS_OK; return NS_OK;
} }
...@@ -1563,8 +1567,8 @@ static nsresult NSAPI nsURI_SetMoniker(nsIWineURI *iface, IMoniker *aMoniker) ...@@ -1563,8 +1567,8 @@ static nsresult NSAPI nsURI_SetMoniker(nsIWineURI *iface, IMoniker *aMoniker)
WARN("Moniker already set: %p\n", This->container); WARN("Moniker already set: %p\n", This->container);
IMoniker_Release(This->mon); IMoniker_Release(This->mon);
mshtml_free(This->spec); mshtml_free(This->wine_url);
This->spec = NULL; This->wine_url = NULL;
} }
if(aMoniker) { if(aMoniker) {
...@@ -1575,12 +1579,12 @@ static nsresult NSAPI nsURI_SetMoniker(nsIWineURI *iface, IMoniker *aMoniker) ...@@ -1575,12 +1579,12 @@ static nsresult NSAPI nsURI_SetMoniker(nsIWineURI *iface, IMoniker *aMoniker)
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
DWORD len; DWORD len;
len = WideCharToMultiByte(CP_ACP, 0, url, -1, NULL, 0, NULL, NULL); len = strlenW(url)+1;
This->spec = mshtml_alloc(len*sizeof(WCHAR)); This->wine_url = mshtml_alloc(len*sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, url, -1, This->spec, -1, NULL, NULL); memcpy(This->wine_url, url, len*sizeof(WCHAR));
CoTaskMemFree(url); CoTaskMemFree(url);
TRACE("spec %s\n", debugstr_a(This->spec)); TRACE("wine_url %s\n", debugstr_w(This->wine_url));
}else { }else {
ERR("GetDisplayName failed: %08x\n", hres); ERR("GetDisplayName failed: %08x\n", hres);
} }
...@@ -1661,7 +1665,7 @@ static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIURI **_retval ...@@ -1661,7 +1665,7 @@ static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIURI **_retval
ret->uri = uri; ret->uri = uri;
ret->container = container; ret->container = container;
ret->mon = NULL; ret->mon = NULL;
ret->spec = NULL; ret->wine_url = NULL;
ret->is_doc_uri = FALSE; ret->is_doc_uri = FALSE;
if(container) if(container)
......
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