Commit 76b19800 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

ieframe: Use the original URL for error pages' address bar.

parent 8a67308f
......@@ -281,6 +281,7 @@ HRESULT get_window(DocHost*,IHTMLWindow2**);
HRESULT get_location_url(DocHost*,BSTR*);
HRESULT set_dochost_url(DocHost*,const WCHAR*);
void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*);
const WCHAR *error_url_frag(const WCHAR*);
HRESULT dochost_object_available(DocHost*,IUnknown*);
void set_doc_state(DocHost*,READYSTATE);
void activate_document(DocHost*);
......
......@@ -783,6 +783,10 @@ static void DocHostContainer_on_command_state_change(DocHost *iface, LONG comman
static void DocHostContainer_set_url(DocHost* iface, const WCHAR *url)
{
InternetExplorer *This = impl_from_DocHost(iface);
const WCHAR *orig_url = error_url_frag(url);
if(orig_url)
url = orig_url;
This->nohome = FALSE;
SendMessageW(This->frame_hwnd, WM_UPDATEADDRBAR, 0, (LPARAM)url);
......
......@@ -29,6 +29,24 @@
WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
const WCHAR *error_url_frag(const WCHAR *url)
{
if(!wcsncmp(url, L"res://", ARRAY_SIZE(L"res://")-1)) {
WCHAR buf[MAX_PATH];
UINT len = GetSystemDirectoryW(buf, ARRAY_SIZE(buf));
if(len && !wcsncmp(url + ARRAY_SIZE(L"res://")-1, buf, len)) {
len += ARRAY_SIZE(L"res://")-1;
if(!wcsncmp(url + len, L"\\shdoclc.dll/ERROR.HTM", ARRAY_SIZE(L"\\shdoclc.dll/ERROR.HTM")-1)) {
len += ARRAY_SIZE(L"\\shdoclc.dll/ERROR.HTM")-1;
url = wcschr(url + len, '#');
return url ? url + 1 : NULL;
}
}
}
return NULL;
}
static inline ShellBrowser *impl_from_IShellBrowser(IShellBrowser *iface)
{
return CONTAINING_RECORD(iface, ShellBrowser, IShellBrowser_iface);
......
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