Commit e2e3f70e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msdmo: Fix pointer checking in IEnumDMO_Next().

parent 216e1f25
......@@ -519,9 +519,12 @@ static HRESULT WINAPI IEnumDMO_fnNext(
TRACE("(%p)->(%d %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched);
if (!pCLSID || !Names || !pcItemsFetched)
if (!pCLSID || !Names)
return E_POINTER;
if (!pcItemsFetched && cItemsToFetch > 1)
return E_INVALIDARG;
while (count < cItemsToFetch)
{
This->index++;
......@@ -656,8 +659,8 @@ static HRESULT WINAPI IEnumDMO_fnNext(
count++;
}
*pcItemsFetched = count;
if (*pcItemsFetched < cItemsToFetch)
if (pcItemsFetched) *pcItemsFetched = count;
if (count < cItemsToFetch)
hres = S_FALSE;
TRACE("<-- %i found\n",count);
......
......@@ -92,14 +92,21 @@ static void test_DMOEnum(void)
HRESULT hr;
CLSID clsid;
WCHAR *name;
DWORD count;
hr = DMOEnum(&GUID_unknowncategory, 0, 0, NULL, 0, NULL, &enum_dmo);
ok(hr == S_OK, "DMOEnum() failed with %#x\n", hr);
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
todo_wine
ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr);
hr = IEnumDMO_Next(enum_dmo, 2, &clsid, &name, NULL);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
hr = IEnumDMO_Next(enum_dmo, 2, &clsid, &name, &count);
ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr);
ok(count == 0, "expected 0, got %d\n", count);
IEnumDMO_Release(enum_dmo);
}
......
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