mshtml: Use IUri in IHTMLLocation::put_port implementation.
This commit is contained in:
parent
71109b509e
commit
2e2a80ce8a
|
@ -402,7 +402,7 @@ static HRESULT WINAPI HTMLLocation_put_port(IHTMLLocation *iface, BSTR v)
|
||||||
static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
|
static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
|
||||||
{
|
{
|
||||||
HTMLLocation *This = impl_from_IHTMLLocation(iface);
|
HTMLLocation *This = impl_from_IHTMLLocation(iface);
|
||||||
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
|
DWORD port;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
@ -410,18 +410,23 @@ static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
|
||||||
if(!p)
|
if(!p)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
hres = get_url_components(This, &url);
|
if(!This->window || !This->window->uri) {
|
||||||
|
FIXME("No current URI\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = IUri_GetPort(This->window->uri, &port);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
if(url.nPort) {
|
if(hres == S_OK) {
|
||||||
const WCHAR format[] = {'%','u',0};
|
static const WCHAR formatW[] = {'%','u',0};
|
||||||
WCHAR buf[6];
|
WCHAR buf[12];
|
||||||
snprintfW(buf, 6, format, url.nPort);
|
|
||||||
|
sprintfW(buf, formatW, port);
|
||||||
*p = SysAllocString(buf);
|
*p = SysAllocString(buf);
|
||||||
}else {
|
}else {
|
||||||
const WCHAR empty[] = {0};
|
*p = SysAllocStringLen(NULL, 0);
|
||||||
*p = SysAllocString(empty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!*p)
|
if(!*p)
|
||||||
|
|
Loading…
Reference in New Issue