Fix SHBrowseForFolder() for Desktop

Johannes Schindelin Johannes.Schindelin at gmx.de
Wed Jan 5 19:27:15 CST 2005


Hi,

this patch fixes the useless window when browsing Desktop with
SHBrowseForFolder (set pidlRoot=0 to see what I mean). It also fixes a
crash when double clicking on a folder which doesn't have subdirectories.

Ciao,
Dscho
-------------- next part --------------
Index: brsfolder.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/brsfolder.c,v
retrieving revision 1.54
diff -u -r1.54 brsfolder.c
--- brsfolder.c	23 Dec 2004 17:12:07 -0000	1.54
+++ brsfolder.c	5 Jan 2005 23:57:05 -0000
@@ -220,6 +226,8 @@
 	HWND		hwnd=GetParent(hwndTreeView);
 
 	TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
+	if(!lpe)
+		return;
 	SetCapture(GetParent(hwndTreeView));
 	SetCursor(LoadCursorA(0, (LPSTR)IDC_WAIT));



Index: shlfolder.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlfolder.c,v
retrieving revision 1.94
diff -u -r1.94 shlfolder.c
--- shlfolder.c	16 Dec 2004 14:42:31 -0000	1.94
+++ shlfolder.c	5 Jan 2005 23:57:20 -0000
@@ -224,11 +225,8 @@
 	    }
 
 	    if (pidlChild) {
-		LPSTR pszChild = _ILGetTextPointer(pidlChild);
-
-		if (pszChild)
-		    lstrcatA (szDestPath, pszChild);
-		else
+		int i = lstrlenA(szDestPath);
+		if (!_ILSimpleGetText (pidlChild, szDestPath+i, MAX_PATH-i))
 		    hr = E_INVALIDARG;
 	    }
 



More information about the wine-patches mailing list