msvfw32.dll - retrieve available drivers from the registry

Jan Jezabek jezabek at poczta.onet.pl
Fri Jun 10 12:44:48 CDT 2005


This patch allows for reading the available drivers from the registry 
(as in WinNT/2000/XP) in addition to the system.ini file (as in 
Win9x/Me). This functionality was almost completely implemented, but was 
broken (it read subkeys instead of values).
-------------- next part --------------
Index: wine/dlls/msvideo/msvideo_main.c
===================================================================
RCS file: /home/wine/wine/dlls/msvideo/msvideo_main.c,v
retrieving revision 1.64
diff -u -p -r1.64 msvideo_main.c
--- wine/dlls/msvideo/msvideo_main.c	11 May 2005 12:57:02 -0000	1.64
+++ wine/dlls/msvideo/msvideo_main.c	10 Jun 2005 16:22:12 -0000
@@ -103,8 +103,8 @@ typedef BOOL (*enum_handler_t)(const cha
 
 static BOOL enum_drivers(DWORD fccType, enum_handler_t handler, void* param)
 {
-    CHAR buf[2048], fccTypeStr[5], *s;
-    DWORD i, cnt = 0, bufLen, lRet;
+    CHAR buf[2048], dataBuf[2038], fccTypeStr[5], *s;
+    DWORD i, cnt = 0, bufLen, dataBufLen, lRet;
     BOOL result = FALSE;
     FILETIME lastWrite;
     HKEY hKey;
@@ -117,13 +117,16 @@ static BOOL enum_drivers(DWORD fccType, 
     if (lRet == ERROR_SUCCESS) 
     {
 	DWORD numkeys;
-	RegQueryInfoKeyA( hKey, 0, 0, 0, &numkeys, 0, 0, 0, 0, 0, 0, 0);
+	RegQueryInfoKeyA( hKey, 0, 0, 0, 0, 0, 0, &numkeys, 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);
+            dataBufLen = sizeof(dataBuf) / sizeof(dataBuf[0]);
+	    lRet = RegEnumValueA(hKey, i, buf, &bufLen, 0, 0, dataBuf, &dataBufLen);
 	    if (lRet != ERROR_SUCCESS) continue;
-	    if (strncasecmp(buf, fccTypeStr, 5) || buf[9] != '=') continue;
+	    if (bufLen != 9 || strncasecmp(buf, fccTypeStr, 5)) continue;
+            buf[9] = '=';
+            strcpy(&buf[10], dataBuf);
 	    if ((result = handler(buf, cnt++, param))) break;
 	}
     	RegCloseKey( hKey );


More information about the wine-patches mailing list