[PATCH v2 8/9] msvfw32: Enumerate installed functions in ICInfo().
Zebediah Figura
z.figura12 at gmail.com
Wed Mar 6 21:10:23 CST 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
This will make tests for quartz VFW wrappers easier.
dlls/msvfw32/msvideo_main.c | 9 +++++++++
dlls/msvfw32/tests/msvfw.c | 6 ------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c
index 6631060d5d..d42b10956d 100644
--- a/dlls/msvfw32/msvideo_main.c
+++ b/dlls/msvfw32/msvideo_main.c
@@ -271,6 +271,7 @@ BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
{
char name_buf[10], buf[2048];
DWORD ret_type, ret_handler;
+ reg_driver *driver;
DWORD i, count = 0;
LONG res;
HKEY key;
@@ -326,6 +327,14 @@ BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
}
}
+ LIST_FOR_EACH_ENTRY(driver, ®_driver_list, reg_driver, entry)
+ {
+ if (type && compare_fourcc(type, driver->fccType)) continue;
+ if (compare_fourcc(handler, driver->fccHandler) && handler != count++) continue;
+ if (driver->proc(0, NULL, ICM_GETINFO, (DWORD_PTR)info, sizeof(*info)) == sizeof(*info))
+ return TRUE;
+ }
+
info->fccType = type;
info->fccHandler = handler;
WARN("No driver found for codec %s.%s.\n", wine_dbgstr_fcc(type), wine_dbgstr_fcc(handler));
diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c
index bb54d43921..33fca56dc5 100644
--- a/dlls/msvfw32/tests/msvfw.c
+++ b/dlls/msvfw32/tests/msvfw.c
@@ -429,13 +429,10 @@ todo_wine
memset(&enum_info, 0x55, sizeof(enum_info));
enum_info.dwSize = sizeof(enum_info);
-todo_wine {
ok(ICInfo(test_type, test_handler, &enum_info), "Expected success.\n");
ok(!enum_info.fccType, "Got unexpected type %#x.\n", enum_info.fccType);
ok(!enum_info.fccHandler, "Got unexpected handler %#x.\n", enum_info.fccHandler);
-}
ok(!enum_info.dwFlags, "Got unexpected flags %#x.\n", enum_info.dwFlags);
-todo_wine
ok(enum_info.dwVersion == 0xdeadbeef, "Got unexpected version %#x.\n", enum_info.dwVersion);
ok(enum_info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#x.\n", enum_info.dwVersionICM);
ok(!enum_info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(enum_info.szName));
@@ -445,13 +442,10 @@ todo_wine
/* Functions installed after msvfw32 is loaded are enumerated. */
memset(&enum_info, 0x55, sizeof(enum_info));
enum_info.dwSize = sizeof(enum_info);
-todo_wine {
ok(ICInfo(test_type, 0, &enum_info), "Expected success.\n");
ok(!enum_info.fccType, "Got unexpected type %#x.\n", enum_info.fccType);
-}
ok(!enum_info.fccHandler, "Got unexpected handler %#x.\n", enum_info.fccHandler);
ok(!enum_info.dwFlags, "Got unexpected flags %#x.\n", enum_info.dwFlags);
-todo_wine
ok(enum_info.dwVersion == 0xdeadbeef, "Got unexpected version %#x.\n", enum_info.dwVersion);
ok(enum_info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#x.\n", enum_info.dwVersionICM);
ok(!enum_info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(enum_info.szName));
--
2.20.1
More information about the wine-devel
mailing list