mshtml.dll:Add implementation HTMLDocument_get_referrer

Ivan Sinitsin ivan at etersoft.ru
Tue Sep 30 06:58:23 CDT 2008


Add implementation of HTMLDocument_get_referrer function, in unit `htmldoc.c` 
(mshtml.dll).

Changelog:
	Add implementation of HTMLDocument_get_referrer function.

-- 
Ivan Sinitsin
-------------- next part --------------
From 56d1f9ec7cad5706c134e830794ee74d028b1585 Mon Sep 17 00:00:00 2001
From: Ivan Sinitsin <ivan at etersoft.ru>
Date: Tue, 30 Sep 2008 15:54:16 +0400
Subject: [PATCH] add implementation of HTMLDocument_get_referrer

---
 dlls/mshtml/htmldoc.c |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index c00b583..9a89ed7 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -614,8 +614,38 @@ static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT
 static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
 {
     HTMLDocument *This = HTMLDOC_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsIDOMHTMLDocument *nshtmldoc;
+    nsIDOMDocument *nsdoc;
+    const PRUnichar *ret;
+    nsAString nsstr;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(!This->nscontainer)
+        return E_FAIL;
+
+    nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
+    if(NS_FAILED(nsres) || (!nsdoc)) {
+        ERR("GetDocument failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
+    nsIDOMDocument_Release(nsdoc);
+
+    nsAString_Init(&nsstr, NULL);
+
+    nsres = nsIDOMHTMLDocument_GetReferrer(nshtmldoc, &nsstr);
+    nsIDOMHTMLDocument_Release(nshtmldoc);
+    if (NS_FAILED(nsres))
+        ERR("GetReferer failed: %08x\n", nsres);
+
+    nsAString_GetData(&nsstr, &ret);
+    *p = SysAllocString(ret);
+    nsAString_Finish(&nsstr);
+
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
-- 
1.5.6.5.GIT



More information about the wine-patches mailing list