From 5e5129935fdbb486fbe3a47ffb231a13fabfcf8a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 20 Jul 2012 12:36:50 +0200 Subject: [PATCH] mshtml: Added nsIFileURL::GetFile implementation. --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsio.c | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f0061762c69..04b5b1ef848 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -781,6 +781,7 @@ HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN; void get_editor_controller(NSContainer*) DECLSPEC_HIDDEN; nsresult get_nsinterface(nsISupports*,REFIID,void**) DECLSPEC_HIDDEN; nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN; +nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN; HRESULT create_pending_window(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN; void set_current_mon(HTMLOuterWindow*,IMoniker*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 5ae78d55c7b..9ab0a9b4c41 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -79,7 +79,7 @@ static ATOM nscontainer_class; static WCHAR gecko_path[MAX_PATH]; static unsigned gecko_path_len; -static nsresult create_nsfile(const PRUnichar *path, nsIFile **ret) +nsresult create_nsfile(const PRUnichar *path, nsIFile **ret) { nsAString str; nsresult nsres; diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index c0b04d1a093..4c077069fee 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -2705,8 +2705,19 @@ static nsresult NSAPI nsURL_GetRelativeSpec(nsIFileURL *iface, nsIURI *aURIToCom static nsresult NSAPI nsFileURL_GetFile(nsIFileURL *iface, nsIFile **aFile) { nsWineURI *This = impl_from_nsIFileURL(iface); - FIXME("(%p)->(%p)\n", This, aFile); - return NS_ERROR_NOT_IMPLEMENTED; + WCHAR path[MAX_PATH]; + DWORD size; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, aFile); + + hres = CoInternetParseIUri(This->uri, PARSE_PATH_FROM_URL, 0, path, sizeof(path)/sizeof(WCHAR), &size, 0); + if(FAILED(hres)) { + WARN("CoInternetParseIUri failed: %08x\n", hres); + return NS_ERROR_FAILURE; + } + + return create_nsfile(path, aFile); } static nsresult NSAPI nsFileURL_SetFile(nsIFileURL *iface, nsIFile *aFile) -- 2.11.4.GIT