shellpath fix

Aric Stewart aric at codeweavers.com
Fri May 28 04:38:23 CDT 2004


make sure that the size of the buffer passed to RegSetValueExW is in 
bytes not WCHARs

-aric
-------------- next part --------------
Index: dlls/shell32/shellpath.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shellpath.c,v
retrieving revision 1.84
diff -u -w -r1.84 shellpath.c
--- dlls/shell32/shellpath.c	7 Apr 2004 19:45:48 -0000	1.84
+++ dlls/shell32/shellpath.c	28 May 2004 09:37:31 -0000
@@ -1115,7 +1115,8 @@
 	        strcpyW(pszPath + 3, szDefaultPath);
 	      }
               dwType=REG_SZ;
-	      RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,strlenW(pszPath)+1);
+	      RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,
+                         (strlenW(pszPath)+1)*sizeof(WCHAR));
 	    }
 	  }
 	  RegCloseKey(hKey);
@@ -1151,7 +1152,8 @@
 	      strcpyW(pszPath + 3, szDefaultPath);
 	    }
             dwType=REG_SZ;
-	    RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,strlenW(pszPath)+1);
+	    RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,
+                       (strlenW(pszPath)+1)*sizeof(WCHAR));
 	  }
 	  RegCloseKey(hKey);
 	}


More information about the wine-patches mailing list