summaryrefslogtreecommitdiffstats
path: root/private/utils/windisk/src/format.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'private/utils/windisk/src/format.cxx')
-rw-r--r--private/utils/windisk/src/format.cxx65
1 files changed, 65 insertions, 0 deletions
diff --git a/private/utils/windisk/src/format.cxx b/private/utils/windisk/src/format.cxx
new file mode 100644
index 000000000..3e6c12589
--- /dev/null
+++ b/private/utils/windisk/src/format.cxx
@@ -0,0 +1,65 @@
+//+---------------------------------------------------------------------------
+//
+// Microsoft Windows
+// Copyright (C) Microsoft Corporation, 1992 - 1994.
+//
+// File: format.cxx
+//
+// Contents: Disk Administrator format dialog
+//
+// History: 10-Jun-93 BruceFo Created
+//
+//----------------------------------------------------------------------------
+
+#include "headers.hxx"
+#pragma hdrstop
+
+#include "windisk.hxx"
+#include "ops.hxx"
+#include "shlobj.h"
+#include "shsemip.h"
+
+//+---------------------------------------------------------------------------
+//
+// Function: DoFormat
+//
+// Synopsis: Display and handle the Disk Administrator portion of
+// formatting, i.e., the dialog box that allows users to choose
+// a file system and quick/non-quick.
+//
+// Arguments: [FormatReport] -- TRUE if we want a format report
+//
+// Returns: nothing
+//
+// History: 16-Aug-93 BruceFo Created
+//
+//----------------------------------------------------------------------------
+
+VOID
+DoFormat(
+ IN HWND hwndParent,
+ IN BOOL FormatReport
+ )
+{
+ PREGION_DESCRIPTOR regionDescriptor = &SELECTED_REGION(0);
+ FDASSERT(regionDescriptor);
+ PPERSISTENT_REGION_DATA regionData = PERSISTENT_DATA(regionDescriptor);
+ FDASSERT(regionData);
+
+ if (DeletionIsAllowed(regionDescriptor) != NO_ERROR)
+ {
+ ErrorDialog(MSG_CANT_FORMAT_WINNT);
+ return;
+ }
+
+ if ('\0' == regionData->DriveLetter)
+ {
+ ErrorDialog(MSG_CANT_FORMAT_NO_LETTER);
+ return;
+ }
+
+ SHFormatDrive(hwndParent, regionData->DriveLetter - 'A',
+ SHFMT_ID_DEFAULT, 0);
+
+ DoRefresh();
+}