Jacek Caban : mshtml: Added IDOMEvent::get_type implementation.

Alexandre Julliard julliard at winehq.org
Fri Dec 1 14:08:19 CST 2017


Module: wine
Branch: master
Commit: dc5aefcebb6ec4a1dadfc11b928ae3d8246b3b96
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dc5aefcebb6ec4a1dadfc11b928ae3d8246b3b96

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Dec  1 17:02:06 2017 +0100

mshtml: Added IDOMEvent::get_type implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlevent.c    | 13 +++++++++++--
 dlls/mshtml/tests/events.c |  5 +++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 980b31a..4278d22 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -1033,8 +1033,17 @@ static HRESULT WINAPI DOMEvent_get_timeStamp(IDOMEvent *iface, ULONGLONG *p)
 static HRESULT WINAPI DOMEvent_get_type(IDOMEvent *iface, BSTR *p)
 {
     DOMEvent *This = impl_from_IDOMEvent(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(This->type) {
+        *p = SysAllocString(This->type);
+        if(!*p)
+            return E_OUTOFMEMORY;
+    }else {
+        *p = NULL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI DOMEvent_initEvent(IDOMEvent *iface, BSTR type, VARIANT_BOOL can_bubble, VARIANT_BOOL cancelable)
diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c
index bc8e045..7719dc1 100644
--- a/dlls/mshtml/tests/events.c
+++ b/dlls/mshtml/tests/events.c
@@ -2693,6 +2693,11 @@ static void test_create_event(IHTMLDocument2 *doc)
     hres = IDOMEvent_stopPropagation(event);
     ok(hres == S_OK, "stopPropagation failed: %08x\n", hres);
 
+    str = (void*)0xdeadbeef;
+    hres = IDOMEvent_get_type(event, &str);
+    ok(hres == S_OK, "get_type failed: %08x\n", hres);
+    ok(!str, "type = %s\n", wine_dbgstr_w(str));
+
     IDOMEvent_Release(event);
 
     IDocumentEvent_Release(doc_event);




More information about the wine-cvs mailing list