Commit 5a8d7674 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

MSDN states that the pszDisplayName member of BROWSEINFO is assumed to

be MAX_PATH in length. So when doing the A->W conversion in BrowseForFolderA do not set that member to be the size of the incoming string, instead make it MAX_PATH.
parent 9577e5e2
......@@ -627,9 +627,8 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi)
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment