Commit 242beac6 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent 6e94edd3
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment