https://git.reactos.org/?p=reactos.git;a=commitdiff;h=58eb4e5bde8df108ab4b91ba319c343257e21204

commit 58eb4e5bde8df108ab4b91ba319c343257e21204
Author:     Eric Kohl <[email protected]>
AuthorDate: Sun Jun 5 08:47:22 2022 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Sun Jun 5 08:47:46 2022 +0200

    [DISKPART] Add success and failure messages for the DELETE PARTITION command
---
 base/system/diskpart/delete.c      | 10 +++++++++-
 base/system/diskpart/lang/de-DE.rc |  6 ++++++
 base/system/diskpart/lang/en-US.rc |  6 ++++++
 base/system/diskpart/lang/pl-PL.rc |  6 ++++++
 base/system/diskpart/lang/pt-PT.rc |  6 ++++++
 base/system/diskpart/lang/ro-RO.rc |  6 ++++++
 base/system/diskpart/lang/ru-RU.rc |  6 ++++++
 base/system/diskpart/lang/sq-AL.rc |  6 ++++++
 base/system/diskpart/lang/tr-TR.rc |  6 ++++++
 base/system/diskpart/lang/zh-CN.rc |  6 ++++++
 base/system/diskpart/lang/zh-TW.rc |  6 ++++++
 base/system/diskpart/resource.h    |  2 ++
 12 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/base/system/diskpart/delete.c b/base/system/diskpart/delete.c
index c17498bd863..6841b3d9a27 100644
--- a/base/system/diskpart/delete.c
+++ b/base/system/diskpart/delete.c
@@ -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;
 }
diff --git a/base/system/diskpart/lang/de-DE.rc 
b/base/system/diskpart/lang/de-DE.rc
index 4b7b5a2836d..545a3550203 100644
--- a/base/system/diskpart/lang/de-DE.rc
+++ b/base/system/diskpart/lang/de-DE.rc
@@ -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
diff --git a/base/system/diskpart/lang/en-US.rc 
b/base/system/diskpart/lang/en-US.rc
index 07f4c0a5fe7..6657371ba78 100644
--- a/base/system/diskpart/lang/en-US.rc
+++ b/base/system/diskpart/lang/en-US.rc
@@ -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
diff --git a/base/system/diskpart/lang/pl-PL.rc 
b/base/system/diskpart/lang/pl-PL.rc
index 662761d248c..296bbf2162b 100644
--- a/base/system/diskpart/lang/pl-PL.rc
+++ b/base/system/diskpart/lang/pl-PL.rc
@@ -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
diff --git a/base/system/diskpart/lang/pt-PT.rc 
b/base/system/diskpart/lang/pt-PT.rc
index 176a551d0e6..fbeb8f17e51 100644
--- a/base/system/diskpart/lang/pt-PT.rc
+++ b/base/system/diskpart/lang/pt-PT.rc
@@ -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
diff --git a/base/system/diskpart/lang/ro-RO.rc 
b/base/system/diskpart/lang/ro-RO.rc
index b867bd0befe..aef9208a70e 100644
--- a/base/system/diskpart/lang/ro-RO.rc
+++ b/base/system/diskpart/lang/ro-RO.rc
@@ -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
diff --git a/base/system/diskpart/lang/ru-RU.rc 
b/base/system/diskpart/lang/ru-RU.rc
index 9867d475e57..a567169c125 100644
--- a/base/system/diskpart/lang/ru-RU.rc
+++ b/base/system/diskpart/lang/ru-RU.rc
@@ -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
diff --git a/base/system/diskpart/lang/sq-AL.rc 
b/base/system/diskpart/lang/sq-AL.rc
index 9e6948e20a8..1be40265462 100644
--- a/base/system/diskpart/lang/sq-AL.rc
+++ b/base/system/diskpart/lang/sq-AL.rc
@@ -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
diff --git a/base/system/diskpart/lang/tr-TR.rc 
b/base/system/diskpart/lang/tr-TR.rc
index 45a8e740645..1e65d05eff2 100644
--- a/base/system/diskpart/lang/tr-TR.rc
+++ b/base/system/diskpart/lang/tr-TR.rc
@@ -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
diff --git a/base/system/diskpart/lang/zh-CN.rc 
b/base/system/diskpart/lang/zh-CN.rc
index 810919c5b40..67df9b92f1c 100644
--- a/base/system/diskpart/lang/zh-CN.rc
+++ b/base/system/diskpart/lang/zh-CN.rc
@@ -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
diff --git a/base/system/diskpart/lang/zh-TW.rc 
b/base/system/diskpart/lang/zh-TW.rc
index bfc4599ee8d..7e51bc5d8c8 100644
--- a/base/system/diskpart/lang/zh-TW.rc
+++ b/base/system/diskpart/lang/zh-TW.rc
@@ -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
diff --git a/base/system/diskpart/resource.h b/base/system/diskpart/resource.h
index 3081fc4ef87..44329febfdf 100644
--- a/base/system/diskpart/resource.h
+++ b/base/system/diskpart/resource.h
@@ -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

Reply via email to