Author: hbelusca
Date: Tue May 16 20:16:43 2017
New Revision: 74565
URL:
http://svn.reactos.org/svn/reactos?rev=74565&view=rev
Log:
[SHELL32]: Fix a FIXME: Recognize the media type for formatting, by calling
GetDriveTypeW(). Based on what
format.com does too.
Modified:
trunk/reactos/dll/win32/shell32/dialogs/drive.cpp
Modified: trunk/reactos/dll/win32/shell32/dialogs/drive.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs/drive.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dialogs/drive.cpp [iso-8859-1] Tue May 16 20:16:43
2017
@@ -473,6 +473,8 @@
HWND hDlgCtrl;
BOOL QuickFormat;
DWORD ClusterSize;
+ DWORD DriveType;
+ FMIFS_MEDIA_FLAG MediaFlag = FMIFS_HARDDISK;
/* set volume path */
szDrive[0] = pContext->Drive + L'A';
@@ -539,8 +541,32 @@
*/
FormatDrvDialog = hwndDlg;
+ /* See if the drive is removable or not */
+ DriveType = GetDriveTypeW(szDrive);
+ switch (DriveType)
+ {
+ case DRIVE_UNKNOWN:
+ case DRIVE_REMOTE:
+ case DRIVE_CDROM:
+ case DRIVE_NO_ROOT_DIR:
+ {
+ FIXME("\n");
+ return;
+ }
+
+ case DRIVE_REMOVABLE:
+ MediaFlag = FMIFS_FLOPPY;
+ break;
+
+ case DRIVE_FIXED:
+ case DRIVE_RAMDISK:
+ MediaFlag = FMIFS_HARDDISK;
+ break;
+ }
+
+ /* Format the drive */
FormatEx(szDrive,
- FMIFS_HARDDISK, /* FIXME */
+ MediaFlag,
szFileSys,
szLabel,
QuickFormat,
@@ -559,7 +585,7 @@
}
else
{
- pContext->Result = FALSE;
+ pContext->Result = FALSE;
}
}