mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 13:10:28 +00:00
mshtml: Reimplement HTMLLocation::get_pathname.
This commit is contained in:
parent
6a456fa6d9
commit
a03d0bcaa9
@ -428,10 +428,7 @@ static HRESULT WINAPI HTMLLocation_put_pathname(IHTMLLocation *iface, BSTR v)
|
||||
static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
|
||||
{
|
||||
HTMLLocation *This = HTMLLOCATION_THIS(iface);
|
||||
WCHAR buf[INTERNET_MAX_PATH_LENGTH];
|
||||
URL_COMPONENTSW url = {sizeof(url)};
|
||||
const WCHAR *doc_url;
|
||||
DWORD size = 0;
|
||||
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)};
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
@ -439,29 +436,17 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
|
||||
if(!p)
|
||||
return E_POINTER;
|
||||
|
||||
hres = get_url(This, &doc_url);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = CoInternetParseUrl(doc_url, PARSE_PATH_FROM_URL, 0, buf, sizeof(buf), &size, 0);
|
||||
if(SUCCEEDED(hres)) {
|
||||
*p = SysAllocString(buf);
|
||||
if(!*p)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
url.dwUrlPathLength = 1;
|
||||
url.dwExtraInfoLength = 1;
|
||||
hres = get_url_components(This, &url);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(!url.dwUrlPathLength) {
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
if(url.dwUrlPathLength && url.lpszUrlPath[0] == '/')
|
||||
*p = SysAllocStringLen(url.lpszUrlPath + 1, url.dwUrlPathLength - 1);
|
||||
else
|
||||
*p = SysAllocStringLen(url.lpszUrlPath, url.dwUrlPathLength);
|
||||
|
||||
*p = SysAllocStringLen(url.lpszUrlPath, url.dwUrlPathLength);
|
||||
if(!*p)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
|
@ -61,7 +61,7 @@ static const struct location_test http_test = {
|
||||
"www.winehq.org:80", TRUE,
|
||||
"www.winehq.org", TRUE,
|
||||
"80", TRUE,
|
||||
"", FALSE,
|
||||
"", TRUE,
|
||||
"?search", FALSE,
|
||||
"#hash", FALSE
|
||||
};
|
||||
@ -75,7 +75,7 @@ static const struct location_test http_file_test = {
|
||||
"www.winehq.org:80", TRUE,
|
||||
"www.winehq.org", TRUE,
|
||||
"80", TRUE,
|
||||
"file", FALSE,
|
||||
"file", TRUE,
|
||||
"?search", FALSE,
|
||||
"#hash", FALSE
|
||||
};
|
||||
@ -89,7 +89,7 @@ static const struct location_test ftp_test = {
|
||||
"ftp.winehq.org:21", TRUE,
|
||||
"ftp.winehq.org", TRUE,
|
||||
"21", TRUE,
|
||||
"", FALSE,
|
||||
"", TRUE,
|
||||
NULL, FALSE,
|
||||
NULL, FALSE
|
||||
};
|
||||
@ -103,7 +103,7 @@ static const struct location_test ftp_file_test = {
|
||||
"ftp.winehq.org:21", TRUE,
|
||||
"ftp.winehq.org", TRUE,
|
||||
"21", TRUE,
|
||||
"file", FALSE,
|
||||
"file", TRUE,
|
||||
NULL, FALSE,
|
||||
NULL, FALSE
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user