brsfolder
Aric Stewart
aric at codeweavers.com
Thu Oct 13 10:33:59 CDT 2005
MSDN states that the pszDisplayName member of BROWSEINFO is assumed to
be MAX_PATH in lenght. So when doing the A->W conversion in
BrowseForFolderA do not set that member to be the size of the incomming
string, instead make it MAX_PATH.
Fixes a crash with adding Favorites in IE.
-------------- next part --------------
Index: dlls/shell32/brsfolder.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/brsfolder.c,v
retrieving revision 1.63
diff -u -r1.63 brsfolder.c
--- dlls/shell32/brsfolder.c 2 Sep 2005 11:32:18 -0000 1.63
+++ dlls/shell32/brsfolder.c 13 Oct 2005 15:33:06 -0000
@@ -627,9 +627,8 @@
bi.pidlRoot = lpbi->pidlRoot;
if (lpbi->pszDisplayName)
{
- len = MultiByteToWideChar( CP_ACP, 0, lpbi->pszDisplayName, -1, NULL, 0 );
- bi.pszDisplayName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
- MultiByteToWideChar( CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, len );
+ bi.pszDisplayName = HeapAlloc( GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR) );
+ MultiByteToWideChar( CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, MAX_PATH );
}
else
bi.pszDisplayName = NULL;
More information about the wine-patches
mailing list