[DISKPART] Add success and failure messages for the DELETE PARTITION command

This commit is contained in:
Eric Kohl
2022-06-05 08:47:22 +02:00
parent d31642c712
commit 58eb4e5bde
12 changed files with 71 additions and 1 deletions

View 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;
}

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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