Commit dd61c795 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use IUri for IHTMLLocation::get_hostname implementation.

parent 3fe5e6ee
...@@ -359,7 +359,7 @@ static HRESULT WINAPI HTMLLocation_put_hostname(IHTMLLocation *iface, BSTR v) ...@@ -359,7 +359,7 @@ static HRESULT WINAPI HTMLLocation_put_hostname(IHTMLLocation *iface, BSTR v)
static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p) static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p)
{ {
HTMLLocation *This = impl_from_IHTMLLocation(iface); HTMLLocation *This = impl_from_IHTMLLocation(iface);
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)}; BSTR hostname;
HRESULT hres; HRESULT hres;
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
...@@ -367,19 +367,21 @@ static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p) ...@@ -367,19 +367,21 @@ static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p)
if(!p) if(!p)
return E_POINTER; return E_POINTER;
url.dwHostNameLength = 1; if(!This->window || !This->window->uri) {
hres = get_url_components(This, &url); FIXME("No current URI\n");
if(FAILED(hres)) return E_NOTIMPL;
return hres; }
if(!url.dwHostNameLength){ hres = IUri_GetHost(This->window->uri, &hostname);
if(hres == S_OK) {
*p = hostname;
}else if(hres == S_FALSE) {
SysFreeString(hostname);
*p = NULL; *p = NULL;
return S_OK; }else {
return hres;
} }
*p = SysAllocStringLen(url.lpszHostName, url.dwHostNameLength);
if(!*p)
return E_OUTOFMEMORY;
return S_OK; return S_OK;
} }
......
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