Dmitry Timoshkov : mshtml: Handle VT_INT/VT_UI4 same way as VT_I4/ VT_UINT in IHTMLElementCollection::item.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jun 2 07:50:06 CDT 2015


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Jun  1 21:52:04 2015 +0300

mshtml: Handle VT_INT/VT_UI4 same way as VT_I4/VT_UINT in IHTMLElementCollection::item.

---

 dlls/mshtml/htmlelemcol.c |  2 ++
 dlls/mshtml/tests/dom.c   | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c
index ca5e1d5..a57f39e 100644
--- a/dlls/mshtml/htmlelemcol.c
+++ b/dlls/mshtml/htmlelemcol.c
@@ -419,11 +419,13 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
 
     switch(V_VT(&name)) {
     case VT_I4:
+    case VT_INT:
         if(V_I4(&name) < 0)
             return E_INVALIDARG;
         hres = get_item_idx(This, V_I4(&name), pdisp);
         break;
 
+    case VT_UI4:
     case VT_UINT:
         hres = get_item_idx(This, V_UINT(&name), pdisp);
         break;
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 3e83e64..077f6e2 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2437,6 +2437,27 @@ static void _test_elem_collection(unsigned line, IUnknown *unk,
     ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
     ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
 
+    V_VT(&name) = VT_UI4;
+    V_I4(&name) = len;
+    disp = (void*)0xdeadbeef;
+    hres = IHTMLElementCollection_item(col, name, index, &disp);
+    ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
+    ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+
+    V_VT(&name) = VT_INT;
+    V_I4(&name) = len;
+    disp = (void*)0xdeadbeef;
+    hres = IHTMLElementCollection_item(col, name, index, &disp);
+    ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
+    ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+
+    V_VT(&name) = VT_UINT;
+    V_I4(&name) = len;
+    disp = (void*)0xdeadbeef;
+    hres = IHTMLElementCollection_item(col, name, index, &disp);
+    ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
+    ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+
     V_VT(&name) = VT_I4;
     V_I4(&name) = -1;
     disp = (void*)0xdeadbeef;




More information about the wine-cvs mailing list