Assume MAX_PATH length for pszDisplayName.
This commit is contained in:
parent
f7e9e5b788
commit
63a4b203d7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue