mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[DISKPART] Prevent drive letter changes on boot or system volumes
This commit is contained in:
@@ -74,6 +74,12 @@ assign_main(
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentVolume->IsBoot || CurrentVolume->IsSystem)
|
||||
{
|
||||
ConResPuts(StdOut, IDS_ASSIGN_SYSTEM_VOLUME);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (nExclusive > 1)
|
||||
{
|
||||
ConResPuts(StdErr, IDS_ERROR_INVALID_ARGS);
|
||||
|
||||
@@ -32,6 +32,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nDer angegebene Buchstabe wurde diesem Laufwerk bereits zugewiesen.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nDer angegebene Laufwerksbuchstabe ist kein gültiger Volumebuchstabe.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nEs ist kein freier Laufwerksbuchstabe vorhanden, der diesem Volume zugewiesen werden kann.\nGeben Sie einen Laufwerksbuchstaben frei, und wiederholen Sie den Vorgang.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDer Laufwerkbuchstabe einens System-, Start- oder Auslagerungsvolumes kann nicht neu zugeordnet werden.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -32,6 +32,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -39,6 +39,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -32,6 +32,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -34,6 +34,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -40,6 +40,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -34,6 +34,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -36,6 +36,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -42,6 +42,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -41,6 +41,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -41,6 +41,7 @@ BEGIN
|
||||
IDS_ASSIGN_ALREADY_ASSIGNED "\nThe specified letter has already been assigned to this drive.\n"
|
||||
IDS_ASSIGN_INVALID_LETTER "\nThe letter you specified is not a valid volume letter.\n"
|
||||
IDS_ASSIGN_NO_MORE_LETTER "\nThere are no free drive letters to assign to this volume.\nPlease free up a drive letter and try again.\n"
|
||||
IDS_ASSIGN_SYSTEM_VOLUME "\nDiskPart cannot reassign the drive letter on a system, boot or pagefile volume.\n"
|
||||
END
|
||||
|
||||
/* AUTOMOUNT command strings */
|
||||
|
||||
@@ -88,6 +88,12 @@ remove_main(
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentVolume->IsBoot || CurrentVolume->IsSystem)
|
||||
{
|
||||
ConResPuts(StdOut, IDS_ASSIGN_SYSTEM_VOLUME);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (nExclusive > 1)
|
||||
{
|
||||
ConResPuts(StdErr, IDS_ERROR_INVALID_ARGS);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#define IDS_ASSIGN_ALREADY_ASSIGNED 1022
|
||||
#define IDS_ASSIGN_INVALID_LETTER 1023
|
||||
#define IDS_ASSIGN_NO_MORE_LETTER 1024
|
||||
#define IDS_ASSIGN_SYSTEM_VOLUME 1025
|
||||
|
||||
#define IDS_CLEAN_FAIL 1030
|
||||
#define IDS_CLEAN_SUCCESS 1031
|
||||
|
||||
Reference in New Issue
Block a user