Julien Muchembled : msvfw32:
Fix enumeration of VFW video codecs that are registered in the
registry.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Jun 1 06:44:37 CDT 2007
Module: wine
Branch: master
Commit: 79e19b91a8de5bdba8bb4e28eeb1e2de407b7029
URL: http://source.winehq.org/git/wine.git/?a=commit;h=79e19b91a8de5bdba8bb4e28eeb1e2de407b7029
Author: Julien Muchembled <jm at jm10.no-ip.com>
Date: Fri Jun 1 00:25:15 2007 +0200
msvfw32: Fix enumeration of VFW video codecs that are registered in the registry.
---
dlls/msvfw32/msvideo_main.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c
index 1361d30..85a08fa 100644
--- a/dlls/msvfw32/msvideo_main.c
+++ b/dlls/msvfw32/msvideo_main.c
@@ -107,9 +107,8 @@ typedef BOOL (*enum_handler_t)(const char*, int, void*);
static BOOL enum_drivers(DWORD fccType, enum_handler_t handler, void* param)
{
CHAR buf[2048], fccTypeStr[5], *s;
- DWORD i, cnt = 0, bufLen, lRet;
+ DWORD i, cnt = 0, lRet;
BOOL result = FALSE;
- FILETIME lastWrite;
HKEY hKey;
fourcc_to_string(fccTypeStr, fccType);
@@ -119,14 +118,17 @@ static BOOL enum_drivers(DWORD fccType, enum_handler_t handler, void* param)
lRet = RegOpenKeyExA(HKEY_LOCAL_MACHINE, HKLM_DRIVERS32, 0, KEY_QUERY_VALUE, &hKey);
if (lRet == ERROR_SUCCESS)
{
- DWORD numkeys;
- RegQueryInfoKeyA( hKey, 0, 0, 0, &numkeys, 0, 0, 0, 0, 0, 0, 0);
- for (i = 0; i < numkeys; i++)
+ DWORD name, data, type;
+ i = 0;
+ for (;;)
{
- bufLen = sizeof(buf) / sizeof(buf[0]);
- lRet = RegEnumKeyExA(hKey, i, buf, &bufLen, 0, 0, 0, &lastWrite);
+ name = 10;
+ data = sizeof buf - name;
+ lRet = RegEnumValueA(hKey, i++, buf, &name, 0, &type, (LPBYTE)(buf+name), &data);
+ if (lRet == ERROR_NO_MORE_ITEMS) break;
if (lRet != ERROR_SUCCESS) continue;
- if (strncasecmp(buf, fccTypeStr, 5) || buf[9] != '=') continue;
+ if (name != 9 || strncasecmp(buf, fccTypeStr, 5)) continue;
+ buf[name] = '=';
if ((result = handler(buf, cnt++, param))) break;
}
RegCloseKey( hKey );
More information about the wine-cvs
mailing list