mshtml: Add helper function get_url_components.

This commit is contained in:
Andrew Eikum 2009-10-14 16:33:21 -05:00 committed by Alexandre Julliard
parent ab857c8493
commit a26b82fc32
1 changed files with 20 additions and 4 deletions

View File

@ -46,6 +46,23 @@ static HRESULT get_url(HTMLLocation *This, const WCHAR **ret)
return S_OK; return S_OK;
} }
static HRESULT get_url_components(HTMLLocation *This, URL_COMPONENTSW *url)
{
const WCHAR *doc_url;
HRESULT hres;
hres = get_url(This, &doc_url);
if(FAILED(hres))
return hres;
if(!InternetCrackUrlW(doc_url, 0, 0, url)) {
FIXME("InternetCrackUrlW failed: 0x%08x\n", GetLastError());
SetLastError(0);
return E_FAIL;
}
return S_OK;
}
#define HTMLLOCATION_THIS(iface) DEFINE_THIS(HTMLLocation, HTMLLocation, iface) #define HTMLLOCATION_THIS(iface) DEFINE_THIS(HTMLLocation, HTMLLocation, iface)
@ -270,10 +287,9 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
} }
url.dwUrlPathLength = 1; url.dwUrlPathLength = 1;
if(!InternetCrackUrlW(doc_url, 0, 0, &url)) { hres = get_url_components(This, &url);
FIXME("InternetCrackUrl failed\n"); if(FAILED(hres))
return E_FAIL; return hres;
}
if(!url.dwUrlPathLength) { if(!url.dwUrlPathLength) {
*p = NULL; *p = NULL;