Michael Stefaniuc : mshtml: Avoid casts from COM objects to interfaces.

Alexandre Julliard julliard at winehq.org
Mon Sep 19 10:32:13 CDT 2016


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Sep 16 14:16:46 2016 +0200

mshtml: Avoid casts from COM objects to interfaces.

Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlelemcol.c | 2 +-
 dlls/mshtml/htmlevent.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c
index 125819d..8407e02 100644
--- a/dlls/mshtml/htmlelemcol.c
+++ b/dlls/mshtml/htmlelemcol.c
@@ -400,7 +400,7 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
 static HRESULT get_item_idx(HTMLElementCollection *This, UINT idx, IDispatch **ret)
 {
     if(idx < This->len) {
-        *ret = (IDispatch*)This->elems[idx];
+        *ret = (IDispatch*)&This->elems[idx]->node.event_target.dispex.IDispatchEx_iface;
         IDispatch_AddRef(*ret);
     }
 
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index c2eeb7d..fc5277b 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -1024,7 +1024,7 @@ void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj, EventTa
         int i;
 
         V_VT(&arg) = VT_DISPATCH;
-        V_DISPATCH(&arg) = (IDispatch*)event_obj;
+        V_DISPATCH(&arg) = (IDispatch*)&event_obj->dispex.IDispatchEx_iface;
 
         i = data->event_table[eid]->handler_cnt;
         while(i--) {




More information about the wine-cvs mailing list