shell32: Limit displayed volume label length to 32.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-11-28 12:56:52 +03:00 committed by Alexandre Julliard
parent 1c86f97985
commit 960b5996fc
1 changed files with 3 additions and 6 deletions

View File

@ -695,15 +695,12 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
/* long view "lw_name (C:)" */
if (!(dwFlags & SHGDN_FORPARSING))
{
DWORD dwVolumeSerialNumber, dwMaximumComponetLength, dwFileSystemFlags;
WCHAR wszDrive[18] = {0};
static const WCHAR wszOpenBracket[] = {' ','(',0};
static const WCHAR wszCloseBracket[] = {')',0};
WCHAR wszDrive[32 /* label */ + 6 /* ' (C:)'\0 */] = {0};
GetVolumeInformationW (pszPath, wszDrive,
sizeof(wszDrive)/sizeof(wszDrive[0]) - 6,
&dwVolumeSerialNumber,
&dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0);
GetVolumeInformationW (pszPath, wszDrive, sizeof(wszDrive)/sizeof(wszDrive[0]) - 5,
NULL, NULL, NULL, NULL, 0);
strcatW (wszDrive, wszOpenBracket);
lstrcpynW (wszDrive + strlenW(wszDrive), pszPath, 3);
strcatW (wszDrive, wszCloseBracket);