Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msacm32/internal.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/msacm32/internal.c b/dlls/msacm32/internal.c index 9c4d1a75f3b..d6797bec40a 100644 --- a/dlls/msacm32/internal.c +++ b/dlls/msacm32/internal.c @@ -359,7 +359,7 @@ void MSACM_RegisterAllDrivers(void) 'W','i','n','d','o','w','s',' ','N','T','\', 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', 'D','r','i','v','e','r','s','3','2','\0'}; - DWORD i, cnt, bufLen, lRet, type; + DWORD i, cnt, bufLen, lRet; WCHAR buf[2048], valname[64], *name, *s; FILETIME lastWrite; HKEY hKey; @@ -380,15 +380,16 @@ void MSACM_RegisterAllDrivers(void) *name = 0; MSACM_RegisterDriver(buf, name + 1, 0); } - i = 0; - cnt = ARRAY_SIZE(valname); - bufLen = sizeof(buf); - while(RegEnumValueW(hKey, i, valname, &cnt, 0, - &type, (BYTE*)buf, &bufLen) == ERROR_SUCCESS){ - if (!wcsnicmp(valname, msacmW, ARRAY_SIZE(msacmW))) - MSACM_RegisterDriver(valname, buf, 0); - ++i; - } + + for (i = 0; ; i++) + { + cnt = ARRAY_SIZE(valname); + bufLen = sizeof(buf); + if (RegEnumValueW(hKey, i, valname, &cnt, 0, NULL, (BYTE *)buf, &bufLen)) + break; + if (!wcsnicmp(valname, msacmW, ARRAY_SIZE(msacmW))) + MSACM_RegisterDriver(valname, buf, 0); + } RegCloseKey( hKey ); }