SHGetSpecialFolderPathA & valgrind

Francois Gouget fgouget at codeweavers.com
Wed Nov 19 17:40:39 CST 2003


In SHGetSpecialFolderPathA we either grab szPath from the registry 
(using RegCreateKeyExA) or use a default value. Then we get back to the 
common code and check dwType to see if we should expand szPath. But if 
RegCreateKeyExA failed, i.e. if we used the default values, then dwType 
is not set.

Changelog:

  * dlls/shell32/shellpath.c

    Francois Gouget <fgouget at codeweavers.com>
    If using the default values, also set dwType to REG_SZ as our 
default strings don't need to be expanded (found by Valgrind).

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: dlls/shell32/shellpath.c
===================================================================
RCS file: /home/cvs/wine/dlls/shell32/shellpath.c,v
retrieving revision 1.74
diff -u -r1.74 shellpath.c
--- dlls/shell32/shellpath.c	16 Oct 2003 19:12:49 -0000	1.74
+++ dlls/shell32/shellpath.c	19 Nov 2003 21:31:49 -0000
@@ -1089,6 +1089,7 @@
 	        strcpy(szPath, "C:\\");	/* FIXME ??? */
 	        strcat(szPath, szDefaultPath);
 	      }
+              dwType=REG_SZ;
 	      RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
 	    }
 	  }
@@ -1125,6 +1126,7 @@
 	      strcpy(szPath, "C:\\");	/* FIXME ??? */
 	      strcat(szPath, szDefaultPath);
 	    }
+            dwType=REG_SZ;
 	    RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
 	  }
 	  RegCloseKey(hKey);


More information about the wine-patches mailing list