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

This commit is contained in:
Dmitry Timoshkov 2015-06-01 21:52:04 +03:00 committed by Alexandre Julliard
parent 6e94edd36f
commit 242beac637
2 changed files with 23 additions and 0 deletions

View File

@ -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;

View File

@ -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;