Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/msxml3/bsc.c | 17 ++++++++++++++--- dlls/msxml3/domdoc.c | 2 +- dlls/msxml3/msxml_private.h | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/dlls/msxml3/bsc.c b/dlls/msxml3/bsc.c index 0b9e679bda..5cebe09333 100644 --- a/dlls/msxml3/bsc.c +++ b/dlls/msxml3/bsc.c @@ -242,9 +242,10 @@ static const struct IBindStatusCallbackVtbl bsc_vtbl = 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]; + HRESULT hr;
TRACE("%s\n", debugstr_w(url));
@@ -271,7 +272,17 @@ HRESULT create_uri(const WCHAR *url, IUri **uri) 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) @@ -281,7 +292,7 @@ HRESULT create_moniker_from_url(LPCWSTR url, IMoniker **mon)
TRACE("%s\n", debugstr_w(url));
- if (FAILED(hr = create_uri(url, &uri))) + if (FAILED(hr = create_uri(NULL, url, &uri))) return hr;
hr = CreateURLMonikerEx2(NULL, uri, mon, 0); diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 6d611c590f..8d45c546fb 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -2304,7 +2304,7 @@ static HRESULT WINAPI domdoc_load( This->properties->uri = NULL; }
- hr = create_uri(filename, &uri); + hr = create_uri(This->base_uri, filename, &uri); if (SUCCEEDED(hr)) hr = CreateURLMonikerEx2(NULL, uri, &mon, 0); if ( SUCCEEDED(hr) ) diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 918c0d3d44..5fce060985 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -532,7 +532,7 @@ static inline const CLSID* SchemaCache_version(MSXML_VERSION v) typedef struct bsc_t bsc_t;
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 detach_bsc(bsc_t*) DECLSPEC_HIDDEN; IUri *get_base_uri(IUnknown *) DECLSPEC_HIDDEN;