msdmo: Also handle ERROR_SUCCESS with nonzero size from RegQueryValueExW().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49659 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6db24a2349
commit
2d4e21d45e
|
@ -526,11 +526,16 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
|
|
||||||
if (This->pInTypes)
|
if (This->pInTypes)
|
||||||
{
|
{
|
||||||
DWORD size = types_size, i;
|
DWORD size, i;
|
||||||
|
|
||||||
while ((ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL,
|
for (;;)
|
||||||
(BYTE *)types, &size)) == ERROR_MORE_DATA)
|
|
||||||
{
|
{
|
||||||
|
size = types_size;
|
||||||
|
ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, (BYTE *)types, &size);
|
||||||
|
if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA)
|
||||||
|
break;
|
||||||
|
if (size <= types_size)
|
||||||
|
break;
|
||||||
if (!array_reserve((void **)&types, &types_size, size, 1))
|
if (!array_reserve((void **)&types, &types_size, size, 1))
|
||||||
{
|
{
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
@ -559,9 +564,14 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
{
|
{
|
||||||
DWORD size = types_size, i;
|
DWORD size = types_size, i;
|
||||||
|
|
||||||
while ((ret = RegQueryValueExW(hkey, L"OutputTypes", NULL, NULL,
|
for (;;)
|
||||||
(BYTE *)types, &size)) == ERROR_MORE_DATA)
|
|
||||||
{
|
{
|
||||||
|
size = types_size;
|
||||||
|
ret = RegQueryValueExW(hkey, L"OutputTypes", NULL, NULL, (BYTE *)types, &size);
|
||||||
|
if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA)
|
||||||
|
break;
|
||||||
|
if (size <= types_size)
|
||||||
|
break;
|
||||||
if (!array_reserve((void **)&types, &types_size, size, 1))
|
if (!array_reserve((void **)&types, &types_size, size, 1))
|
||||||
{
|
{
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
|
|
@ -88,6 +88,9 @@ static void test_DMOGetName(void)
|
||||||
|
|
||||||
static void test_DMOEnum(void)
|
static void test_DMOEnum(void)
|
||||||
{
|
{
|
||||||
|
static const DMO_PARTIAL_MEDIATYPE input_type = {{0x1111}, {0x2222}};
|
||||||
|
static const DMO_PARTIAL_MEDIATYPE wrong_type = {{0x3333}, {0x4444}};
|
||||||
|
|
||||||
IEnumDMO *enum_dmo;
|
IEnumDMO *enum_dmo;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
CLSID clsid;
|
CLSID clsid;
|
||||||
|
@ -115,6 +118,47 @@ static void test_DMOEnum(void)
|
||||||
ok(count == 0, "expected 0, got %d\n", count);
|
ok(count == 0, "expected 0, got %d\n", count);
|
||||||
|
|
||||||
IEnumDMO_Release(enum_dmo);
|
IEnumDMO_Release(enum_dmo);
|
||||||
|
|
||||||
|
hr = DMORegister(L"testdmo", &GUID_unknowndmo, &GUID_unknowncategory, 0, 1, &input_type, 0, NULL);
|
||||||
|
if (hr != S_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
hr = DMOEnum(&GUID_unknowncategory, 0, 0, NULL, 0, NULL, &enum_dmo);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
ok(IsEqualGUID(&clsid, &GUID_unknowndmo), "Got clsid %s.\n", debugstr_guid(&clsid));
|
||||||
|
ok(!wcscmp(name, L"testdmo"), "Got name %s.\n", debugstr_w(name));
|
||||||
|
|
||||||
|
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
|
||||||
|
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
IEnumDMO_Release(enum_dmo);
|
||||||
|
|
||||||
|
hr = DMOEnum(&GUID_unknowncategory, 0, 1, &input_type, 0, NULL, &enum_dmo);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
ok(IsEqualGUID(&clsid, &GUID_unknowndmo), "Got clsid %s.\n", debugstr_guid(&clsid));
|
||||||
|
ok(!wcscmp(name, L"testdmo"), "Got name %s.\n", debugstr_w(name));
|
||||||
|
|
||||||
|
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
|
||||||
|
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
IEnumDMO_Release(enum_dmo);
|
||||||
|
|
||||||
|
hr = DMOEnum(&GUID_unknowncategory, 0, 1, &wrong_type, 0, NULL, &enum_dmo);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
|
||||||
|
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
IEnumDMO_Release(enum_dmo);
|
||||||
|
|
||||||
|
hr = DMOUnregister(&GUID_unknowndmo, &GUID_unknowncategory);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_DMOGetTypes(void)
|
static void test_DMOGetTypes(void)
|
||||||
|
|
Loading…
Reference in New Issue