From 3ab57cfe4dbe3aca10701a67a6363888703c9bd7 Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 17 Feb 2005 11:51:01 +0000 Subject: [PATCH] Fix for ICInfo() in msvideo when it is used to ask for a codec by index. --- dlls/msvideo/msvideo_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/msvideo/msvideo_main.c b/dlls/msvideo/msvideo_main.c index 032dff10f38..8c407149bb8 100644 --- a/dlls/msvideo/msvideo_main.c +++ b/dlls/msvideo/msvideo_main.c @@ -116,14 +116,15 @@ 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) { - RegQueryInfoKeyA( hKey, 0, 0, 0, &cnt, 0, 0, 0, 0, 0, 0, 0); - for (i = 0; i < cnt; i++) + DWORD numkeys; + RegQueryInfoKeyA( hKey, 0, 0, 0, &numkeys, 0, 0, 0, 0, 0, 0, 0); + for (i = 0; i < numkeys; i++) { bufLen = sizeof(buf) / sizeof(buf[0]); lRet = RegEnumKeyExA(hKey, i, buf, &bufLen, 0, 0, 0, &lastWrite); if (lRet != ERROR_SUCCESS) continue; if (strncasecmp(buf, fccTypeStr, 5) || buf[9] != '=') continue; - if ((result = handler(buf, i, param))) break; + if ((result = handler(buf, cnt++, param))) break; } RegCloseKey( hKey ); } @@ -132,10 +133,10 @@ static BOOL enum_drivers(DWORD fccType, enum_handler_t handler, void* param) /* if that didn't work, go through the values in system.ini */ if (GetPrivateProfileSectionA("drivers32", buf, sizeof(buf), "system.ini")) { - for (s = buf; *s; cnt++, s += strlen(s) + 1) + for (s = buf; *s; s += strlen(s) + 1) { if (strncasecmp(s, fccTypeStr, 5) || s[9] != '=') continue; - if ((result = handler(s, cnt, param))) break; + if ((result = handler(s, cnt++, param))) break; } } -- 2.11.4.GIT