fix shgetfileinfoW

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



- fixed crash in winamp reported by andreas mohr



--- wine-20021219/dlls/shell32/shell32_main.c	Sat Dec 14 00:45:36 2002
+++ wine/dlls/shell32/shell32_main.c	Wed Jan  8 19:28:02 2003
@@ -476,9 +476,14 @@
 	DWORD ret;
 	SHFILEINFOA temppsfi;
 
-	len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL);
-	temppath = HeapAlloc(GetProcessHeap(), 0, len);
-	WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
+	if (flags & SHGFI_PIDL) {
+	  /* path contains a pidl */
+	  temppath = (LPSTR) path;
+	} else {
+	  len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL);
+	  temppath = HeapAlloc(GetProcessHeap(), 0, len);
+	  WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
+	}
 
        if(flags & SHGFI_ATTR_SPECIFIED)
                temppsfi.dwAttributes=psfi->dwAttributes;
@@ -496,9 +501,9 @@
        if(flags & SHGFI_TYPENAME)
                MultiByteToWideChar(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName));
 
-	HeapFree(GetProcessHeap(), 0, temppath);
+       if(!(flags & SHGFI_PIDL)) HeapFree(GetProcessHeap(), 0, temppath);
 
 }
 
 /*************************************************************************

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux