[PATCH] shell32: Limit displayed volume label length to 32

Nikolay Sivov nsivov at codeweavers.com
Mon Nov 28 03:56:52 CST 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/shell32/shfldr_mycomp.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c
index 4022c8d..d47d2af 100644
--- a/dlls/shell32/shfldr_mycomp.c
+++ b/dlls/shell32/shfldr_mycomp.c
@@ -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);
-- 
2.10.2




More information about the wine-patches mailing list