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

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-07-13 09:38:03 -05:00 committed by Alexandre Julliard
parent 03a2191449
commit 37b926b8fe
2 changed files with 9 additions and 15 deletions

View File

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

View File

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