shell32: default volume label

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Tue Jan 4 11:44:38 CST 2005


This is a useful enhancement. Use the unix path as the default volume label.

ChangeLog:
        Ulrich Czekalla <ulrich at codeweavers.com>
        Display the unix path if the volume has no label
-------------- next part --------------
Index: dlls/shell32/shfldr_mycomp.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shfldr_mycomp.c,v
retrieving revision 1.28
diff -u -p -r1.28 shfldr_mycomp.c
--- dlls/shell32/shfldr_mycomp.c	16 Dec 2004 14:42:31 -0000	1.28
+++ dlls/shell32/shfldr_mycomp.c	4 Jan 2005 17:38:12 -0000
@@ -494,7 +494,7 @@ static HRESULT WINAPI ISF_MyComputer_fnG
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
     char szPath[MAX_PATH],
-      szDrive[18];
+      szDrive[MAX_PATH];
     int len = 0;
     BOOL bSimplePidl;
     HRESULT hr = S_OK;
@@ -578,6 +578,20 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 
 	    GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6, &dwVolumeSerialNumber,
 				   &dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0);
+
+            /* Display unix path if volume has no label */
+            if (!strlen(szDrive)) {
+                char *unix_path;
+                WCHAR szPathW[MAX_PATH];
+
+                MultiByteToWideChar(CP_ACP, 0, szPath, -1, szPathW, MAX_PATH);
+                unix_path = wine_get_unix_file_name(szPathW);
+                if (unix_path) {
+                    realpath(unix_path, szDrive);
+                    HeapFree( GetProcessHeap(), 0, unix_path );
+                }
+            }
+
 	    strcat (szDrive, " (");
 	    strncat (szDrive, szPath, 2);
 	    strcat (szDrive, ")");


More information about the wine-patches mailing list