WINMM: Minor fix

Filip Navara xnavara at volny.cz
Sun Mar 20 13:23:32 CST 2005


Changelog:
Specify correct buffer size in GetPrivateProfileStringW calls.
-------------- next part --------------
Index: dlls/winmm/driver.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/driver.c,v
retrieving revision 1.31
diff -u -r1.31 driver.c
--- dlls/winmm/driver.c	11 Mar 2005 12:50:27 -0000	1.31
+++ dlls/winmm/driver.c	20 Mar 2005 19:19:41 -0000
@@ -226,7 +226,7 @@
     if (lRet == ERROR_SUCCESS) return TRUE;
     /* default to system.ini if we can't find it in the registry,
      * to support native installations where system.ini is still used */
-    return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz, wszSystemIni);
+    return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz / sizeof(WCHAR), wszSystemIni);
 }
 
 /**************************************************************************
Index: dlls/winmm/mci.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mci.c,v
retrieving revision 1.60
diff -u -r1.60 mci.c
--- dlls/winmm/mci.c	15 Mar 2005 15:39:03 -0000	1.60
+++ dlls/winmm/mci.c	20 Mar 2005 19:19:41 -0000
@@ -1844,7 +1844,7 @@
 		    RegQueryInfoKeyW( hKey, 0, 0, 0, &cnt, 0, 0, 0, 0, 0, 0, 0);
 		    RegCloseKey( hKey );
 		}
-		if (GetPrivateProfileStringW(wszMci, 0, wszNull, buf, sizeof(buf), wszSystemIni))
+		if (GetPrivateProfileStringW(wszMci, 0, wszNull, buf, sizeof(buf) / sizeof(buf[0]), wszSystemIni))
 		    for (s = buf; *s; s += strlenW(s) + 1) cnt++;
 	    }
 	} else {
@@ -1896,7 +1896,7 @@
 	        RegCloseKey( hKey );
 	    }
 	    if (!s) {
-		if (GetPrivateProfileStringW(wszMci, 0, wszNull, buf, sizeof(buf), wszSystemIni)) {
+		if (GetPrivateProfileStringW(wszMci, 0, wszNull, buf, sizeof(buf) / sizeof(buf[0]), wszSystemIni)) {
 		    for (p = buf; *p; p += strlenW(p) + 1, cnt++) {
                         TRACE("%ld: %s\n", cnt, debugstr_w(p));
 			if (cnt == lpParms->dwNumber - 1) {


More information about the wine-patches mailing list