mshtml: Use GetWineURL in before_async_open.

This commit is contained in:
Jacek Caban 2007-09-29 03:41:10 +02:00 committed by Alexandre Julliard
parent 2826a0f08b
commit 47c91d4d18
1 changed files with 8 additions and 24 deletions

View File

@ -93,13 +93,20 @@ static BOOL exec_shldocvw_67(HTMLDocument *doc, LPCWSTR url)
return TRUE; return TRUE;
} }
static BOOL handle_uri(NSContainer *container, nsChannel *channel, LPCWSTR uri) static BOOL before_async_open(nsChannel *channel, NSContainer *container)
{ {
IServiceProvider *service_provider; IServiceProvider *service_provider;
HTMLDocument *doc = container->doc; HTMLDocument *doc = container->doc;
DWORD hlnf = 0; DWORD hlnf = 0;
LPCWSTR uri;
HRESULT hres; HRESULT hres;
nsIWineURI_GetWineURL(channel->uri, &uri);
if(!uri) {
ERR("GetWineURL returned NULL\n");
return TRUE;
}
if(!doc) { if(!doc) {
NSContainer *container_iter = container; NSContainer *container_iter = container;
@ -131,29 +138,6 @@ static BOOL handle_uri(NSContainer *container, nsChannel *channel, LPCWSTR uri)
return TRUE; return TRUE;
} }
static BOOL before_async_open(nsChannel *channel, NSContainer *container)
{
nsACString uri_str;
const char *uria;
LPWSTR uri;
DWORD len;
BOOL ret;
nsACString_Init(&uri_str, NULL);
nsIWineURI_GetSpec(channel->uri, &uri_str);
nsACString_GetData(&uri_str, &uria, NULL);
len = MultiByteToWideChar(CP_ACP, 0, uria, -1, NULL, 0);
uri = mshtml_alloc(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, uria, -1, uri, len);
nsACString_Finish(&uri_str);
ret = handle_uri(container, channel, uri);
mshtml_free(uri);
return ret;
}
#define NSCHANNEL_THIS(iface) DEFINE_THIS(nsChannel, HttpChannel, iface) #define NSCHANNEL_THIS(iface) DEFINE_THIS(nsChannel, HttpChannel, iface)
static nsresult NSAPI nsChannel_QueryInterface(nsIHttpChannel *iface, nsIIDRef riid, nsQIResult result) static nsresult NSAPI nsChannel_QueryInterface(nsIHttpChannel *iface, nsIIDRef riid, nsQIResult result)