[DISKPART] Add success and failure messages for the DELETE PARTITION command
authorEric Kohl <eric.kohl@reactos.org>
Sun, 5 Jun 2022 06:47:22 +0000 (08:47 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 5 Jun 2022 06:47:46 +0000 (08:47 +0200)
12 files changed:
base/system/diskpart/delete.c
base/system/diskpart/lang/de-DE.rc
base/system/diskpart/lang/en-US.rc
base/system/diskpart/lang/pl-PL.rc
base/system/diskpart/lang/pt-PT.rc
base/system/diskpart/lang/ro-RO.rc
base/system/diskpart/lang/ru-RU.rc
base/system/diskpart/lang/sq-AL.rc
base/system/diskpart/lang/tr-TR.rc
base/system/diskpart/lang/zh-CN.rc
base/system/diskpart/lang/zh-TW.rc
base/system/diskpart/resource.h

index c17498b..6841b3d 100644 (file)
@@ -29,6 +29,7 @@ DeletePartition(
     PPARTENTRY NextPartEntry;
     PPARTENTRY LogicalPartEntry;
     PLIST_ENTRY Entry;
+    NTSTATUS Status;
 
     DPRINT("DeletePartition()\n");
 
@@ -139,7 +140,14 @@ DeletePartition(
     CurrentPartition = NULL;
 
     UpdateDiskLayout(CurrentDisk);
-    WritePartitions(CurrentDisk);
+    Status = WritePartitions(CurrentDisk);
+    if (!NT_SUCCESS(Status))
+    {
+        ConResPuts(StdOut, IDS_DELETE_PARTITION_FAIL);
+        return TRUE;
+    }
+
+    ConResPuts(StdOut, IDS_DELETE_PARTITION_SUCCESS);
 
     return TRUE;
 }
index 4b7b5a2..545a355 100644 (file)
@@ -21,6 +21,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDie angegebene Partition wurde erfolgreich erstellt.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDie gewählte Partition konnte nicht gelöscht werden.\nVergewissern Sie sich, dass die Partition wirklich gelöscht werden kann.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDer gewählte Partition wurde erfolgreich gelöscht.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 07f4c0a..6657371 100644 (file)
@@ -21,6 +21,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 662761d..296bbf2 100644 (file)
@@ -21,6 +21,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 176a551..fbeb8f1 100644 (file)
@@ -23,6 +23,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index b867bd0..aef9208 100644 (file)
@@ -23,6 +23,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 9867d47..a567169 100644 (file)
@@ -23,6 +23,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 9e6948e..1be4026 100644 (file)
@@ -25,6 +25,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 45a8e74..1e65d05 100644 (file)
@@ -23,6 +23,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 810919c..67df9b9 100644 (file)
@@ -30,6 +30,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index bfc4599..7e51bc5 100644 (file)
@@ -24,6 +24,12 @@ BEGIN
     IDS_CREATE_PARTITION_SUCCESS "\nDiskPart succeeded in creating the specified partition.\n"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_DELETE_PARTITION_FAIL "\nDiskPart failed to delete the selected partition.\nPlease make sure the selected partition is valid to delete.\n"
+    IDS_DELETE_PARTITION_SUCCESS "\nDiskPart successfully deleted the selected partition.\n"
+END
+
 /* Disk Information Labels */
 STRINGTABLE
 BEGIN
index 3081fc4..44329fe 100644 (file)
@@ -21,6 +21,8 @@
 #define IDS_CREATE_PARTITION_FAIL      1050
 #define IDS_CREATE_PARTITION_SUCCESS   1051
 
+#define IDS_DELETE_PARTITION_FAIL      1070
+#define IDS_DELETE_PARTITION_SUCCESS   1071
 
 #define IDS_DETAIL_INFO_DISK_ID        1107
 #define IDS_DETAIL_INFO_TYPE           1108