Commit 3ab57cfe authored by David Smith's avatar David Smith Committed by Alexandre Julliard

Fix for ICInfo() in msvideo when it is used to ask for a codec by

index.
parent e026ef74
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment