Commit f62b05da authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

msxml3: Use site's base URI when loading an XML file.

parent 25abcac6
...@@ -242,9 +242,10 @@ static const struct IBindStatusCallbackVtbl bsc_vtbl = ...@@ -242,9 +242,10 @@ static const struct IBindStatusCallbackVtbl bsc_vtbl =
bsc_OnObjectAvailable bsc_OnObjectAvailable
}; };
HRESULT create_uri(const WCHAR *url, IUri **uri) HRESULT create_uri(IUri *base, const WCHAR *url, IUri **uri)
{ {
WCHAR fileUrl[INTERNET_MAX_URL_LENGTH]; WCHAR fileUrl[INTERNET_MAX_URL_LENGTH];
HRESULT hr;
TRACE("%s\n", debugstr_w(url)); TRACE("%s\n", debugstr_w(url));
...@@ -271,7 +272,17 @@ HRESULT create_uri(const WCHAR *url, IUri **uri) ...@@ -271,7 +272,17 @@ HRESULT create_uri(const WCHAR *url, IUri **uri)
url = fileUrl; url = fileUrl;
} }
return CreateUri(url, Uri_CREATE_ALLOW_RELATIVE | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, uri); hr = CreateUri(url, Uri_CREATE_ALLOW_RELATIVE | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, uri);
if (hr == S_OK && base)
{
IUri *rebased_uri;
hr = CoInternetCombineIUri(base, *uri, 0, &rebased_uri, 0);
IUri_Release(*uri);
*uri = rebased_uri;
}
return hr;
} }
HRESULT create_moniker_from_url(LPCWSTR url, IMoniker **mon) HRESULT create_moniker_from_url(LPCWSTR url, IMoniker **mon)
...@@ -281,7 +292,7 @@ HRESULT create_moniker_from_url(LPCWSTR url, IMoniker **mon) ...@@ -281,7 +292,7 @@ HRESULT create_moniker_from_url(LPCWSTR url, IMoniker **mon)
TRACE("%s\n", debugstr_w(url)); TRACE("%s\n", debugstr_w(url));
if (FAILED(hr = create_uri(url, &uri))) if (FAILED(hr = create_uri(NULL, url, &uri)))
return hr; return hr;
hr = CreateURLMonikerEx2(NULL, uri, mon, 0); hr = CreateURLMonikerEx2(NULL, uri, mon, 0);
......
...@@ -2304,7 +2304,7 @@ static HRESULT WINAPI domdoc_load( ...@@ -2304,7 +2304,7 @@ static HRESULT WINAPI domdoc_load(
This->properties->uri = NULL; This->properties->uri = NULL;
} }
hr = create_uri(filename, &uri); hr = create_uri(This->base_uri, filename, &uri);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = CreateURLMonikerEx2(NULL, uri, &mon, 0); hr = CreateURLMonikerEx2(NULL, uri, &mon, 0);
if ( SUCCEEDED(hr) ) if ( SUCCEEDED(hr) )
......
...@@ -532,7 +532,7 @@ static inline const CLSID* SchemaCache_version(MSXML_VERSION v) ...@@ -532,7 +532,7 @@ static inline const CLSID* SchemaCache_version(MSXML_VERSION v)
typedef struct bsc_t bsc_t; typedef struct bsc_t bsc_t;
HRESULT create_moniker_from_url(LPCWSTR, IMoniker**) DECLSPEC_HIDDEN; HRESULT create_moniker_from_url(LPCWSTR, IMoniker**) DECLSPEC_HIDDEN;
HRESULT create_uri(const WCHAR *, IUri **) DECLSPEC_HIDDEN; HRESULT create_uri(IUri *base, const WCHAR *, IUri **) DECLSPEC_HIDDEN;
HRESULT bind_url(IMoniker*, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN; HRESULT bind_url(IMoniker*, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN;
HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN; HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN;
IUri *get_base_uri(IUnknown *) DECLSPEC_HIDDEN; IUri *get_base_uri(IUnknown *) DECLSPEC_HIDDEN;
......
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