Author: pschweitzer
Date: Sat Oct 17 23:01:19 2015
New Revision: 69579

URL: http://svn.reactos.org/svn/reactos?rev=69579&view=rev
Log:
[SHELL32]
Enable formatting a Ext volume from GUI.

Patch by Peter Hater

Modified:
    trunk/reactos/boot/bootdata/hivesft.inf
    trunk/reactos/dll/win32/shell32/dialogs/drive.cpp

Modified: trunk/reactos/boot/bootdata/hivesft.inf
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?rev=69579&r1=69578&r2=69579&view=diff
==============================================================================
--- trunk/reactos/boot/bootdata/hivesft.inf     [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesft.inf     [iso-8859-1] Sat Oct 17 
23:01:19 2015
@@ -1094,6 +1094,7 @@
 HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FAT",0x00000000,"ufat.dll"
 
HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FAT32",0x00000000,"ufat.dll"
 
HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FATX",0x00000000,"ufatx.dll"
+HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","EXT2",0x00000000,"uext2.dll"
 
 ; Winlogon settings
 HKLM,"SOFTWARE\Microsoft\Windows 
NT\CurrentVersion\Winlogon","ConsoleShell",0x00020000,"%SystemRoot%\system32\cmd.exe"

Modified: trunk/reactos/dll/win32/shell32/dialogs/drive.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/drive.cpp?rev=69579&r1=69578&r2=69579&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs/drive.cpp   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dialogs/drive.cpp   [iso-8859-1] Sat Oct 17 
23:01:19 2015
@@ -91,6 +91,11 @@
         else
             ClusterSize = 2048;
     }
+    else if (!wcsicmp(szFs, L"EXT2"))
+    {
+        // auto block size calculation
+        ClusterSize = 0;
+    }
     else
         return FALSE;
 
@@ -200,7 +205,7 @@
     if (SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)wszBuf) == 
CB_ERR)
         return;
 
-    szDrive[0] = pContext->Drive + 'A';
+    szDrive[0] = pContext->Drive + L'A';
 
     if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, 
&TotalNumberOfBytes, NULL))
         return;
@@ -273,6 +278,25 @@
                     SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, 
(LPARAM)ClusterSize);
             }
             ClusterSize *= 2;
+        }
+    }
+    else if (!wcsicmp(wszBuf, L"EXT2"))
+    {
+        if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
+        {
+            TRACE("EXT2 is not supported on hdd larger than 32T current 
%lu\n", TotalNumberOfBytes.QuadPart);
+            SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
+            return;
+        }
+
+        if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, 
_countof(wszBuf)))
+        {
+            hDlgCtrl = GetDlgItem(hwndDlg, 28680);
+            SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
+            lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
+            if (lIndex != CB_ERR)
+                SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, 
(LPARAM)ClusterSize);
+            SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
         }
     }
     else
@@ -415,7 +439,7 @@
     DWORD ClusterSize;
 
     /* set volume path */
-    szDrive[0] = pContext->Drive;
+    szDrive[0] = pContext->Drive + L'A';
 
     /* get filesystem */
     hDlgCtrl = GetDlgItem(hwndDlg, 28677);


Reply via email to