Assume MAX_PATH length for pszDisplayName.

This commit is contained in:
Uwe Bonnes 2004-05-27 20:01:56 +00:00 committed by Alexandre Julliard
parent f7e9e5b788
commit 63a4b203d7
1 changed files with 3 additions and 3 deletions

View File

@ -461,9 +461,9 @@ 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);
/*lpbi->pszDisplayName is assumed to be MAX_PATH (MSDN) */
bi.pszDisplayName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, MAX_PATH);
}
else
bi.pszDisplayName = NULL;