Andrew Eikum : mshtml: Add helper function get_url_components.
Alexandre Julliard
julliard at winehq.org
Thu Oct 15 08:54:28 CDT 2009
Module: wine
Branch: master
Commit: a26b82fc32f3ba7a90ce2cd24d9a5d5f96bae32f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a26b82fc32f3ba7a90ce2cd24d9a5d5f96bae32f
Author: Andrew Eikum <aeikum at codeweavers.com>
Date: Wed Oct 14 16:33:21 2009 -0500
mshtml: Add helper function get_url_components.
---
dlls/mshtml/htmllocation.c | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c
index 891e7b8..4769f03 100644
--- a/dlls/mshtml/htmllocation.c
+++ b/dlls/mshtml/htmllocation.c
@@ -46,6 +46,23 @@ static HRESULT get_url(HTMLLocation *This, const WCHAR **ret)
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)
@@ -270,10 +287,9 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
}
url.dwUrlPathLength = 1;
- if(!InternetCrackUrlW(doc_url, 0, 0, &url)) {
- FIXME("InternetCrackUrl failed\n");
- return E_FAIL;
- }
+ hres = get_url_components(This, &url);
+ if(FAILED(hres))
+ return hres;
if(!url.dwUrlPathLength) {
*p = NULL;
More information about the wine-cvs
mailing list