Commit 37b926b8 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msdmo: Return the number of media types retrieved from DMOGetTypes().

parent 03a21914
......@@ -730,22 +730,16 @@ HRESULT WINAPI DMOGetTypes(REFCLSID clsid, ULONG input_count, ULONG *ret_input_c
}
*ret_input_count = 0;
if (input_count > 0)
{
size = input_count * sizeof(DMO_PARTIAL_MEDIATYPE);
ret = RegQueryValueExW(key, L"InputTypes", NULL, NULL, (BYTE *)input, &size);
if (!ret || ret == ERROR_MORE_DATA)
*ret_input_count = size / sizeof(DMO_PARTIAL_MEDIATYPE);
}
size = input_count * sizeof(DMO_PARTIAL_MEDIATYPE);
ret = RegQueryValueExW(key, L"InputTypes", NULL, NULL, (BYTE *)input, &size);
if (!ret || ret == ERROR_MORE_DATA)
*ret_input_count = min(input_count, size / sizeof(DMO_PARTIAL_MEDIATYPE));
*ret_output_count = 0;
if (output_count > 0)
{
size = output_count * sizeof(DMO_PARTIAL_MEDIATYPE);
ret = RegQueryValueExW(key, L"OutputTypes", NULL, NULL, (BYTE *)output, &size);
if (!ret || ret == ERROR_MORE_DATA)
*ret_output_count = size / sizeof(DMO_PARTIAL_MEDIATYPE);
}
size = output_count * sizeof(DMO_PARTIAL_MEDIATYPE);
ret = RegQueryValueExW(key, L"OutputTypes", NULL, NULL, (BYTE *)output, &size);
if (!ret || ret == ERROR_MORE_DATA)
*ret_output_count = min(output_count, size / sizeof(DMO_PARTIAL_MEDIATYPE));
return S_OK;
}
......@@ -144,7 +144,7 @@ static void test_DMOGetTypes(void)
memset(types, 0, sizeof(types));
hr = DMOGetTypes(&GUID_unknowndmo, 1, &input_count, types, 0, &output_count, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(input_count == 1, "Got input count %u.\n", input_count);
ok(input_count == 1, "Got input count %u.\n", input_count);
ok(!output_count, "Got output count %u.\n", output_count);
todo_wine ok(!memcmp(types, input_types, sizeof(DMO_PARTIAL_MEDIATYPE)), "Types didn't match.\n");
......
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