Commit 3ec1da91 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fixed HTMLElementCollectionEnum_Next implementation for NULL pCeltFetched.

parent d48314c8
...@@ -160,6 +160,7 @@ static HRESULT WINAPI HTMLElementCollectionEnum_Next(IEnumVARIANT *iface, ULONG ...@@ -160,6 +160,7 @@ static HRESULT WINAPI HTMLElementCollectionEnum_Next(IEnumVARIANT *iface, ULONG
} }
This->iter += fetched; This->iter += fetched;
if(pCeltFetched)
*pCeltFetched = fetched; *pCeltFetched = fetched;
return fetched == celt ? S_OK : S_FALSE; return fetched == celt ? S_OK : S_FALSE;
} }
......
...@@ -2163,8 +2163,9 @@ static void _test_elem_collection(unsigned line, IUnknown *unk, ...@@ -2163,8 +2163,9 @@ static void _test_elem_collection(unsigned line, IUnknown *unk,
fetched = 0; fetched = 0;
V_VT(&v) = VT_ERROR; V_VT(&v) = VT_ERROR;
hres = IEnumVARIANT_Next(enum_var, 1, &v, &fetched); hres = IEnumVARIANT_Next(enum_var, 1, &v, i ? &fetched : NULL);
ok_(__FILE__,line)(hres == S_OK, "Next failed: %08x\n", hres); ok_(__FILE__,line)(hres == S_OK, "Next failed: %08x\n", hres);
if(i)
ok_(__FILE__,line)(fetched == 1, "fetched = %d\n", fetched); ok_(__FILE__,line)(fetched == 1, "fetched = %d\n", fetched);
ok_(__FILE__,line)(V_VT(&v) == VT_DISPATCH && V_DISPATCH(&v), "V_VT(v) = %d\n", V_VT(&v)); ok_(__FILE__,line)(V_VT(&v) == VT_DISPATCH && V_DISPATCH(&v), "V_VT(v) = %d\n", V_VT(&v));
ok_(__FILE__,line)(iface_cmp((IUnknown*)disp, (IUnknown*)V_DISPATCH(&v)), "disp != V_DISPATCH(v)\n"); ok_(__FILE__,line)(iface_cmp((IUnknown*)disp, (IUnknown*)V_DISPATCH(&v)), "disp != V_DISPATCH(v)\n");
...@@ -2183,6 +2184,13 @@ static void _test_elem_collection(unsigned line, IUnknown *unk, ...@@ -2183,6 +2184,13 @@ static void _test_elem_collection(unsigned line, IUnknown *unk,
hres = IEnumVARIANT_Reset(enum_var); hres = IEnumVARIANT_Reset(enum_var);
ok_(__FILE__,line)(hres == S_OK, "Reset failed: %08x\n", hres); ok_(__FILE__,line)(hres == S_OK, "Reset failed: %08x\n", hres);
fetched = 0xdeadbeef;
V_VT(&v) = VT_BOOL;
hres = IEnumVARIANT_Next(enum_var, 0, &v, &fetched);
ok_(__FILE__,line)(hres == S_OK, "Next returned %08x, expected S_FALSE\n", hres);
ok_(__FILE__,line)(fetched == 0, "fetched = %d\n", fetched);
ok_(__FILE__,line)(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
hres = IEnumVARIANT_Skip(enum_var, len > 2 ? len-2 : 0); hres = IEnumVARIANT_Skip(enum_var, len > 2 ? len-2 : 0);
ok_(__FILE__,line)(hres == S_OK, "Skip failed: %08x\n", hres); ok_(__FILE__,line)(hres == S_OK, "Skip failed: %08x\n", hres);
......
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