https://git.reactos.org/?p=reactos.git;a=commitdiff;h=93381263a1f3bfffe70f7…
commit 93381263a1f3bfffe70f72bd63944bdff62f93e8
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Mon Jun 13 19:28:12 2022 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Mon Jun 13 19:28:12 2022 +0200
[NTOS:SE] Remove redundant ReturnLength NULL check
In NtQueryInformationToken function, remove the useless and redundant NULL check for two primary reasons. First, DefaultQueryInfoBufferCheck already does the necessary probing validation checks and second, ReturnLength must NEVER be NULL!
If the caller does not respect the calling rules of NtQueryInformationToken, the caller is expected to be miserably punished.
---
ntoskrnl/se/tokencls.c | 78 ++++++++++++++------------------------------------
1 file changed, 21 insertions(+), 57 deletions(-)
diff --git a/ntoskrnl/se/tokencls.c b/ntoskrnl/se/tokencls.c
index 50e81a9a453..2a6806ba3d8 100644
--- a/ntoskrnl/se/tokencls.c
+++ b/ntoskrnl/se/tokencls.c
@@ -450,8 +450,11 @@ SeQueryInformationToken(
* Length of the token information buffer, in bytes.
*
* @param[out] ReturnLength
- * If specified in the call, the function returns the total length size of the token
- * information buffer..
+ * A pointer to a variable provided by the caller that receives the actual length
+ * of the buffer pointed by TokenInformation, in bytes. If TokenInformation is NULL
+ * and TokenInformationLength is 0, this parameter receives the required length
+ * needed to store the buffer information in memory. This parameter must not
+ * be NULL!
*
* @return
* Returns STATUS_SUCCESS if information querying has completed successfully.
@@ -459,8 +462,9 @@ SeQueryInformationToken(
* the token information buffer is not greater than the required length.
* STATUS_INVALID_HANDLE is returned if the token handle is not a valid one.
* STATUS_INVALID_INFO_CLASS is returned if the information class is not a valid
- * one (that is, the class doesn't belong to TOKEN_INFORMATION_CLASS). A failure
- * NTSTATUS code is returned otherwise.
+ * one (that is, the class doesn't belong to TOKEN_INFORMATION_CLASS).
+ * STATUS_ACCESS_VIOLATION is returned if ReturnLength is NULL. A failure NTSTATUS
+ * code is returned otherwise.
*/
_Must_inspect_result_
__kernel_entry
@@ -542,10 +546,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -587,10 +588,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -623,10 +621,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -660,10 +655,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -697,10 +689,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -742,10 +731,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -774,10 +760,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -806,10 +789,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -846,10 +826,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -887,10 +864,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -919,10 +893,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -969,10 +940,7 @@ NtQueryInformationToken(
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (ReturnLength != NULL)
- {
- *ReturnLength = RequiredLength;
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -1018,11 +986,7 @@ NtQueryInformationToken(
{
/* Buffer size was already verified, no need to check here again */
*(PULONG)TokenInformation = SessionId;
-
- if (ReturnLength != NULL)
- {
- *ReturnLength = sizeof(ULONG);
- }
+ *ReturnLength = RequiredLength;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=124fe7504e98e5c285b0a…
commit 124fe7504e98e5c285b0a1d4412ca91260bc3d18
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jun 12 23:26:53 2022 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jun 12 23:26:53 2022 +0200
[DISKPART] Add help text for the LIST PARTITION command
---
base/system/diskpart/diskpart_msg.mc | 142 ++++++++++++++++++++++++++++++++---
1 file changed, 132 insertions(+), 10 deletions(-)
diff --git a/base/system/diskpart/diskpart_msg.mc b/base/system/diskpart/diskpart_msg.mc
index 2daa41eaab4..99942f66998 100644
--- a/base/system/diskpart/diskpart_msg.mc
+++ b/base/system/diskpart/diskpart_msg.mc
@@ -2472,34 +2472,156 @@ SymbolicName=MSG_COMMAND_LIST_PARTITION
Severity=Informational
Facility=System
Language=English
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=German
-<Add LIST PARTITION command help text here>
+ Zeigt eine Liste der Partitionen in der Partitionstabelle für den
+ ausgewählten Datenträger an.
+
+Syntax: LIST PARTITION
+
+ Auf dynamischen Datenträgern entsprechen die Partitionen nicht unbedingt
+ den dynamischen Volumes auf dem Datenträger. Partitionen werden auf
+ dynamischen Datenträgern möglicherweise nicht erstellt oder gelöscht.
+
+ Damit dieser Vorgang erfolgreich ausgeführt werden kann, muss ein
+ Datenträger ausgewählt werden.
+
+Beispiel:
+
+ LIST PARTITION
.
Language=Polish
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Portugese
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Romanian
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Russian
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Albanian
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Turkish
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Chinese
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
Language=Taiwanese
-<Add LIST PARTITION command help text here>
+ Displays a list of partitions in the partition table for the selected disk.
+
+Syntax: LIST PARTITION
+
+ On dynamic disks, the partitions do not neccessarily correspond to the
+ dynamic volumes on the disk. Partitions may not be created or deleted
+ on dynamic disks.
+
+ A disk must be selected for this operation to succeed.
+
+Example:
+
+ LIST PARTITION
.
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c90ea83eff1bb65f50d3…
commit 7c90ea83eff1bb65f50d36b74c54c38dd4e2da41
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jun 12 16:15:18 2022 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jun 12 16:15:18 2022 +0200
[DISKPART] Add help text for the LIST DISK command
---
base/system/diskpart/diskpart_msg.mc | 243 +++++++++++++++++++++++++++++++++--
1 file changed, 233 insertions(+), 10 deletions(-)
diff --git a/base/system/diskpart/diskpart_msg.mc b/base/system/diskpart/diskpart_msg.mc
index df8fdc0d525..2daa41eaab4 100644
--- a/base/system/diskpart/diskpart_msg.mc
+++ b/base/system/diskpart/diskpart_msg.mc
@@ -2214,34 +2214,257 @@ SymbolicName=MSG_COMMAND_LIST_DISK
Severity=Informational
Facility=System
Language=English
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=German
-<Add LIST DISK command help text here>
+ Zeigt eine Liste der Datenträger an.
+
+Syntax: LIST DISK
+
+ Zeigt eine Liste mit Datenträgern und entsprechenden Informa-
+ tionen an - beispielsweise Größe, verfügbarer Speicherplatz sowie
+ Angaben dazu, ob es sich bei dem Datenträger um einen
+ Basisdatenträger oder um einen dynamischer Datenträger handelt
+ und ob der MBR- oder der GUID-Partitionsstil (Master Boot Record
+ oder GUID-Partitionstabelle) verwendet wird.
+ Den Fokus besitzt der mit einem Sternchen (*) markierte Datenträger.
+
+ In der Spalte "FREE" wird nicht der gesamte freie Speicherplatz
+ auf dem Datenträger, sondern der verbleibende, verwendbare freie
+ Speicherplatz angezeigt. Bei einem Datenträger mit 10 GB mit
+ 4 primären Partitionen zu 5 GB verbleibt beispielsweise kein freier
+ verwendbarer Speicherplatz (es können keine weiteren Partitionen
+ erstellt werden). Ein weiteres Beispiel ist ein 10 GB Datenträger mit
+ 3 primären Partitionen und einer erweiterten Partition mit 8 GB. Die
+ erweiterte Partition besitzt eine Größe von 3 GB mit einem logischen
+ Laufwerk (2 GB). Für den Datenträger wird nur 1 GB als frei
+ angezeigt - 1 GB freier Speicherplatz in der erweiterten Partition.
+
+Beispiel:
+
+ LIST DISK
.
Language=Polish
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Portugese
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Romanian
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Russian
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Albanian
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Turkish
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Chinese
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
Language=Taiwanese
-<Add LIST DISK command help text here>
+ Displays a list of disks.
+
+Syntax: LIST DISK
+
+ Displays a list of disks and information about them, such as their
+ size, amount of available free space, whether the disk is a basic
+ or dynamic disk, and whether the disk uses the master boot record
+ (MBR) or GUID partition table (GPT) partition style. The disk marked
+ with an asterisk (*) has focus.
+
+ Note that the FREE column does not display the total amount of free
+ space on the disk, but rather the amount of usable free space left
+ on the disk. For example, if you have a 10GB disk with 4 primary
+ partitions covering 5GB, there is no usable free space left (no
+ more partitions may be created). Another example would be you have
+ a 10GB disk with 3 primary partitions and an extended partition
+ covering 8GB. The exended partition is of size 3GB with one logical
+ drive of size 2GB. The disk will show only 1GB as free - the
+ 1GB of free space in the extended partition.
+
+Example:
+
+ LIST DISK
.
MessageId=10033
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d0d86ab5885af2cc9fa40…
commit d0d86ab5885af2cc9fa40104f47040c63db407be
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sat Jun 11 13:19:51 2022 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sun Jun 12 11:05:05 2022 +0200
[NTOSKRNL] Force a probe against ReturnLength on query & Misc ICIF stuff
NtQueryInformationToken is by far the only system call in NT where ReturnLength simply cannot be optional. On Windows this parameter is always probed and an argument to NULL directly leads to an access violation exception.
This is due to the fact of how tokens work, as its information contents (token user, owner, primary group, et al) are dynamic and can vary throughout over time in memory.
What happens on current ReactOS master however is that ReturnLength is only probed if the parameter is not NULL. On a NULL case scenario the probing checks succeed and NtQueryInformationToken fails later. For this, just get rid of CompleteProbing
parameter and opt in for a bit mask flag based approach, with ICIF_FORCE_RETURN_LENGTH_PROBE being set on DefaultQueryInfoBufferCheck which NtQueryInformationToken calls it to do sanity checks.
In addition to that...
- Document the ICIF probe helpers
- Annotate the ICIF prope helpers with SAL
- With the riddance of CompleteProbing and adoption of flags based approach, add ICIF_PROBE_READ_WRITE and ICIF_PROBE_READ flags alongside with ICIF_FORCE_RETURN_LENGTH_PROBE
---
ntoskrnl/ex/event.c | 4 +-
ntoskrnl/ex/mutant.c | 4 +-
ntoskrnl/ex/sem.c | 4 +-
ntoskrnl/ex/timer.c | 4 +-
ntoskrnl/include/internal/icif.h | 7 +-
ntoskrnl/include/internal/probe.h | 196 ++++++++++++++++++++++++++++++++++----
ntoskrnl/io/iomgr/iocomp.c | 4 +-
ntoskrnl/ps/query.c | 8 +-
ntoskrnl/se/tokencls.c | 4 +-
9 files changed, 200 insertions(+), 35 deletions(-)
diff --git a/ntoskrnl/ex/event.c b/ntoskrnl/ex/event.c
index e30420f65bb..27222cb3c4a 100644
--- a/ntoskrnl/ex/event.c
+++ b/ntoskrnl/ex/event.c
@@ -329,12 +329,12 @@ NtQueryEvent(IN HANDLE EventHandle,
ExEventInfoClass,
sizeof(ExEventInfoClass) /
sizeof(ExEventInfoClass[0]),
+ ICIF_PROBE_READ_WRITE,
EventInformation,
EventInformationLength,
ReturnLength,
NULL,
- PreviousMode,
- TRUE);
+ PreviousMode);
if(!NT_SUCCESS(Status))
{
/* Invalid buffers */
diff --git a/ntoskrnl/ex/mutant.c b/ntoskrnl/ex/mutant.c
index bab471c6173..c5b0204c3c1 100644
--- a/ntoskrnl/ex/mutant.c
+++ b/ntoskrnl/ex/mutant.c
@@ -239,12 +239,12 @@ NtQueryMutant(IN HANDLE MutantHandle,
ExMutantInfoClass,
sizeof(ExMutantInfoClass) /
sizeof(ExMutantInfoClass[0]),
+ ICIF_PROBE_READ_WRITE,
MutantInformation,
MutantInformationLength,
ResultLength,
NULL,
- PreviousMode,
- TRUE);
+ PreviousMode);
if(!NT_SUCCESS(Status))
{
DPRINT("NtQueryMutant() failed, Status: 0x%x\n", Status);
diff --git a/ntoskrnl/ex/sem.c b/ntoskrnl/ex/sem.c
index 29c622814ff..29b8b75bf5a 100644
--- a/ntoskrnl/ex/sem.c
+++ b/ntoskrnl/ex/sem.c
@@ -235,12 +235,12 @@ NtQuerySemaphore(IN HANDLE SemaphoreHandle,
ExSemaphoreInfoClass,
sizeof(ExSemaphoreInfoClass) /
sizeof(ExSemaphoreInfoClass[0]),
+ ICIF_PROBE_READ_WRITE,
SemaphoreInformation,
SemaphoreInformationLength,
ReturnLength,
NULL,
- PreviousMode,
- TRUE);
+ PreviousMode);
if (!NT_SUCCESS(Status))
{
/* Invalid buffers */
diff --git a/ntoskrnl/ex/timer.c b/ntoskrnl/ex/timer.c
index 0c33675333c..6566648c5d6 100644
--- a/ntoskrnl/ex/timer.c
+++ b/ntoskrnl/ex/timer.c
@@ -532,12 +532,12 @@ NtQueryTimer(IN HANDLE TimerHandle,
ExTimerInfoClass,
sizeof(ExTimerInfoClass) /
sizeof(ExTimerInfoClass[0]),
+ ICIF_PROBE_READ_WRITE,
TimerInformation,
TimerInformationLength,
ReturnLength,
NULL,
- PreviousMode,
- TRUE);
+ PreviousMode);
if (!NT_SUCCESS(Status)) return Status;
/* Get the Timer Object */
diff --git a/ntoskrnl/include/internal/icif.h b/ntoskrnl/include/internal/icif.h
index e73ad9e1b2c..39066d935e9 100644
--- a/ntoskrnl/include/internal/icif.h
+++ b/ntoskrnl/include/internal/icif.h
@@ -2,8 +2,7 @@
* PROJECT: ReactOS Kernel
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Internal header for information classes info interface
- * COPYRIGHT: Copyright ???
- * Copyright 2020-2021 George Bișoc <george.bisoc(a)reactos.org>
+ * COPYRIGHT: Copyright 2020-2022 George Bișoc <george.bisoc(a)reactos.org>
*/
#pragma once
@@ -22,6 +21,10 @@
#define ICIF_SET_SIZE_VARIABLE 0x8
#define ICIF_SIZE_VARIABLE (ICIF_QUERY_SIZE_VARIABLE | ICIF_SET_SIZE_VARIABLE)
+#define ICIF_PROBE_READ_WRITE 0x0
+#define ICIF_PROBE_READ 0x1
+#define ICIF_FORCE_RETURN_LENGTH_PROBE 0x2
+
typedef struct _INFORMATION_CLASS_INFO
{
USHORT RequiredSizeQUERY;
diff --git a/ntoskrnl/include/internal/probe.h b/ntoskrnl/include/internal/probe.h
index b819718f5ae..ff1d3c5275b 100644
--- a/ntoskrnl/include/internal/probe.h
+++ b/ntoskrnl/include/internal/probe.h
@@ -1,16 +1,79 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Internal header containing information class probing helpers
+ * COPYRIGHT: Copyright 2022 George Bișoc <george.bisoc(a)reactos.org>
+ */
+
#pragma once
#include <reactos/probe.h>
+/**
+ * @brief
+ * Probe helper that validates the provided parameters whenever
+ * a NtSet*** system call is invoked from user or kernel mode.
+ *
+ * @param[in] Class
+ * The specific class information that the caller explicitly
+ * requested information to be set into an object.
+ *
+ * @param[in] ClassList
+ * An internal INFORMATION_CLASS_INFO consisting of a list array
+ * of information classes checked against the requested information
+ * classes given in Class parameter.
+ *
+ * @param[in] ClassListEntries
+ * Specifies the number of class entries in an array, provided by
+ * the ClassList parameter.
+ *
+ * @param[in] Buffer
+ * A pointer to an arbitrary data content in memory to be validated.
+ * Such pointer points to the actual arbitrary information class buffer
+ * to be set into the object. This buffer is validated only if the
+ * calling processor mode is UM (aka user mode).
+ *
+ * @param[in] BufferLength
+ * The length of the buffer pointed by the Buffer parameter, whose size
+ * is in bytes.
+ *
+ * @param[in] PreviousMode
+ * The processor calling level mode. This level mode determines the procedure
+ * of probing validation in action. If the level calling mode is KM (aka kernel mode)
+ * this function will only validate the properties of the information class itself
+ * such as the required information length size. If the calling mode is UM, the
+ * pointer buffer provided by Buffer parameter is also validated.
+ *
+ * @return
+ * The outcome of the probe validation is based upon the returned NTSTATUS code.
+ * STATUS_SUCCESS is returned if the validation succeeded. Otherwise, one of the
+ * following failure status codes is returned:
+ *
+ * STATUS_INVALID_INFO_CLASS -- Indicates the given information class is not a valid
+ * valid SET class (ICIF_SET flag is not set to the corresponding information class)
+ * or the actual class is not present in the class list array.
+ *
+ * STATUS_INFO_LENGTH_MISMATCH -- Indicates the information length doesn't match with
+ * the one that the information class itself expects. This is the case with classes
+ * ICIF_SET_SIZE_VARIABLE is not set, which means that the class requires a fixed
+ * length size.
+ *
+ * STATUS_ACCESS_VIOLATION -- Indicates the buffer is not within the user mode probe
+ * address range. The function will raise an exception.
+ *
+ * STATUS_DATATYPE_MISALIGNMENT -- Indicates the address of the buffer in memory is
+ * not aligned to the required alignment set.
+ */
static
__inline
NTSTATUS
-DefaultSetInfoBufferCheck(ULONG Class,
- const INFORMATION_CLASS_INFO *ClassList,
- ULONG ClassListEntries,
- PVOID Buffer,
- ULONG BufferLength,
- KPROCESSOR_MODE PreviousMode)
+DefaultSetInfoBufferCheck(
+ _In_ ULONG Class,
+ _In_ const INFORMATION_CLASS_INFO *ClassList,
+ _In_ ULONG ClassListEntries,
+ _In_ PVOID Buffer,
+ _In_ ULONG BufferLength,
+ _In_ KPROCESSOR_MODE PreviousMode)
{
NTSTATUS Status = STATUS_SUCCESS;
@@ -53,18 +116,116 @@ DefaultSetInfoBufferCheck(ULONG Class,
return Status;
}
+/**
+ * @brief
+ * Probe helper that validates the provided parameters whenever
+ * a NtQuery*** system call is invoked from user or kernel mode.
+ *
+ * @param[in] Class
+ * The specific class information that the caller explicitly
+ * requested information to be queried from an object.
+ *
+ * @param[in] ClassList
+ * An internal INFORMATION_CLASS_INFO consisting of a list array
+ * of information classes checked against the requested information
+ * classes given in Class parameter.
+ *
+ * @param[in] ClassListEntries
+ * Specifies the number of class entries in an array, provided by
+ * the ClassList parameter.
+ *
+ * @param[in] Flags
+ * Specifies a bit mask flag that influences how the query probe
+ * validation must be performed against Buffer and ReturnLength
+ * parameters. For further information in regard of this parameter,
+ * see remarks.
+ *
+ * @param[in] Buffer
+ * A pointer to an arbitrary data content in memory to be validated.
+ * Such parameter must be an initialized variable where the queried
+ * information is going to be received into this pointer. If the calling
+ * processor mode is UM (aka user mode) this parameter is validated.
+ * This parameter can be NULL (see remarks for more details).
+ *
+ * @param[in] BufferLength
+ * The length of the buffer pointed by the Buffer parameter, whose size
+ * is in bytes. If the Buffer parameter is NULL, this parameter can be 0.
+ *
+ * @param[in] ReturnLength
+ * The returned length of the buffer whose size is in bytes. If Buffer is
+ * NULL as well as BufferLength is 0, this parameter receives the actual
+ * return length needed to store the buffer in memory space. If the
+ * processor level calling mode is UM, this parameter is validated.
+ * If ICIF_FORCE_RETURN_LENGTH_PROBE is specified in Flags parameter,
+ * ReturnLength mustn't be NULL (see remarks). Otherwise it can be NULL.
+ *
+ * @param[in] ReturnLengthPtr
+ * This parameter is of the same nature as the ReturnLength one, with the
+ * difference being that the type parameter can be a ULONG on x86 systems
+ * or a ULONGLONG on AMD64 systems. If the processor level calling mode is
+ * UM, this parameter is validated. This parameter is currently unused.
+ *
+ * @param[in] PreviousMode
+ * The processor calling level mode. This level mode determines the procedure
+ * of probing validation in action. If the level calling mode is KM (aka kernel mode)
+ * this function will only validate the properties of the information class itself
+ * such as the required information length size. If the calling mode is UM, the
+ * pointer buffer provided by Buffer parameter is also validated as well as
+ * the return length parameter.
+ *
+ * @return
+ * The outcome of the probe validation is based upon the returned NTSTATUS code.
+ * STATUS_SUCCESS is returned if the validation succeeded. Otherwise, one of the
+ * following failure status codes is returned:
+ *
+ * STATUS_INVALID_INFO_CLASS -- Indicates the given information class is not a valid
+ * QUERY class (ICIF_QUERY flag is not set to the corresponding information class)
+ * or the actual class is not present in the class list array.
+ *
+ * STATUS_INFO_LENGTH_MISMATCH -- Indicates the information length doesn't match with the
+ * one that the information class itself expects. This is the case with classes where
+ * ICIF_QUERY_SIZE_VARIABLE is not set, which means that the class requires a fixed length size.
+ *
+ * STATUS_ACCESS_VIOLATION -- Indicates the buffer is not within the user mode probe address range
+ * or the buffer variable is not writable (see remarks). The function will raise an exception.
+ *
+ * STATUS_DATATYPE_MISALIGNMENT -- Indicates the address of the buffer in memory is not
+ * aligned to the required alignment set.
+ *
+ * @remarks
+ * The probing of Buffer and ReturnLength are influenced based on the probe flags
+ * pointed by Flags parameter. The following flags are:
+ *
+ * ICIF_PROBE_READ_WRITE -- This flag explicitly tells the function to do a read and
+ * write probe against Buffer parameter. ProbeForWrite is invoked in this case.
+ * This is the default mechanism.
+ *
+ * ICIF_PROBE_READ -- This flag explicitly tells the function to do a read probe against
+ * Buffer parameter only, that is, the function does not probe if the parameter is actually
+ * writable. ProbeForRead is invoked in this case.
+ *
+ * ICIF_FORCE_RETURN_LENGTH_PROBE -- If this flag is set, the function will force probe
+ * the ReturnLength parameter. In this scenario if ReturnLength is NULL a STATUS_ACCESS_VIOLATION
+ * exception is raised. NtQueryInformationToken is the only NT system call where ReturnLength
+ * has to be properly initialized and not NULL.
+ *
+ * Buffer parameter can be NULL if the caller does not want to actually query a certain information
+ * from an object. This is typically with query NT syscalls where a caller has to query the actual
+ * buffer length needed to store the queried information before doing a "real" query in the first place.
+ */
static
__inline
NTSTATUS
-DefaultQueryInfoBufferCheck(ULONG Class,
- const INFORMATION_CLASS_INFO *ClassList,
- ULONG ClassListEntries,
- PVOID Buffer,
- ULONG BufferLength,
- PULONG ReturnLength,
- PULONG_PTR ReturnLengthPtr,
- KPROCESSOR_MODE PreviousMode,
- BOOLEAN CompleteProbing)
+DefaultQueryInfoBufferCheck(
+ _In_ ULONG Class,
+ _In_ const INFORMATION_CLASS_INFO *ClassList,
+ _In_ ULONG ClassListEntries,
+ _In_ ULONG Flags,
+ _In_opt_ PVOID Buffer,
+ _In_ ULONG BufferLength,
+ _In_opt_ PULONG ReturnLength,
+ _In_opt_ PULONG_PTR ReturnLengthPtr,
+ _In_ KPROCESSOR_MODE PreviousMode)
{
NTSTATUS Status = STATUS_SUCCESS;
@@ -91,7 +252,7 @@ DefaultQueryInfoBufferCheck(ULONG Class,
{
if (Buffer != NULL)
{
- if (!CompleteProbing)
+ if (Flags & ICIF_PROBE_READ)
{
ProbeForRead(Buffer,
BufferLength,
@@ -105,10 +266,11 @@ DefaultQueryInfoBufferCheck(ULONG Class,
}
}
- if (ReturnLength != NULL)
+ if ((Flags & ICIF_FORCE_RETURN_LENGTH_PROBE) || (ReturnLength != NULL))
{
ProbeForWriteUlong(ReturnLength);
}
+
if (ReturnLengthPtr != NULL)
{
ProbeForWrite(ReturnLengthPtr, sizeof(ULONG_PTR), sizeof(ULONG_PTR));
diff --git a/ntoskrnl/io/iomgr/iocomp.c b/ntoskrnl/io/iomgr/iocomp.c
index 41457a66574..fbc655aedfc 100644
--- a/ntoskrnl/io/iomgr/iocomp.c
+++ b/ntoskrnl/io/iomgr/iocomp.c
@@ -395,12 +395,12 @@ NtQueryIoCompletion(IN HANDLE IoCompletionHandle,
IoCompletionInfoClass,
sizeof(IoCompletionInfoClass) /
sizeof(IoCompletionInfoClass[0]),
+ ICIF_PROBE_READ_WRITE,
IoCompletionInformation,
IoCompletionInformationLength,
ResultLength,
NULL,
- PreviousMode,
- TRUE);
+ PreviousMode);
if (!NT_SUCCESS(Status)) return Status;
/* Get the Object */
diff --git a/ntoskrnl/ps/query.c b/ntoskrnl/ps/query.c
index 7b6f8aecf0e..cc7bae50ba4 100644
--- a/ntoskrnl/ps/query.c
+++ b/ntoskrnl/ps/query.c
@@ -90,12 +90,12 @@ NtQueryInformationProcess(
Status = DefaultQueryInfoBufferCheck(ProcessInformationClass,
PsProcessInfoClass,
RTL_NUMBER_OF(PsProcessInfoClass),
+ ICIF_PROBE_READ,
ProcessInformation,
ProcessInformationLength,
ReturnLength,
NULL,
- PreviousMode,
- FALSE);
+ PreviousMode);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtQueryInformationProcess(): Information verification class failed! (Status -> 0x%lx, ProcessInformationClass -> %lx)\n", Status, ProcessInformationClass);
@@ -2643,12 +2643,12 @@ NtQueryInformationThread(IN HANDLE ThreadHandle,
Status = DefaultQueryInfoBufferCheck(ThreadInformationClass,
PsThreadInfoClass,
RTL_NUMBER_OF(PsThreadInfoClass),
+ ICIF_PROBE_READ,
ThreadInformation,
ThreadInformationLength,
ReturnLength,
NULL,
- PreviousMode,
- FALSE);
+ PreviousMode);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtQueryInformationThread(): Information verification class failed! (Status -> 0x%lx , ThreadInformationClass -> %lx)\n", Status, ThreadInformationClass);
diff --git a/ntoskrnl/se/tokencls.c b/ntoskrnl/se/tokencls.c
index 70b1ecafa79..b9d1615d23e 100644
--- a/ntoskrnl/se/tokencls.c
+++ b/ntoskrnl/se/tokencls.c
@@ -492,12 +492,12 @@ NtQueryInformationToken(
Status = DefaultQueryInfoBufferCheck(TokenInformationClass,
SeTokenInformationClass,
RTL_NUMBER_OF(SeTokenInformationClass),
+ ICIF_PROBE_READ_WRITE | ICIF_FORCE_RETURN_LENGTH_PROBE,
TokenInformation,
TokenInformationLength,
ReturnLength,
NULL,
- PreviousMode,
- TRUE);
+ PreviousMode);
if (!NT_SUCCESS(Status))
{
DPRINT("NtQueryInformationToken() failed, Status: 0x%x\n", Status);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad9b9303545aec4a9edac…
commit ad9b9303545aec4a9edac1a26290d7e1f2fac31b
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jun 12 09:32:40 2022 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jun 12 09:32:40 2022 +0200
[DISKPART] Add help text for the SELECT VOLUME command
---
base/system/diskpart/diskpart_msg.mc | 212 +++++++++++++++++++++++++++++++++--
1 file changed, 202 insertions(+), 10 deletions(-)
diff --git a/base/system/diskpart/diskpart_msg.mc b/base/system/diskpart/diskpart_msg.mc
index 472ff199dcd..df8fdc0d525 100644
--- a/base/system/diskpart/diskpart_msg.mc
+++ b/base/system/diskpart/diskpart_msg.mc
@@ -3417,34 +3417,226 @@ SymbolicName=MSG_COMMAND_SELECT_VOLUME
Severity=Informational
Facility=System
Language=English
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=German
-<Add SELECT VOLUME command help text here>
+ Wählt das angegebene Volume aus und setzt den Fokus auf dieses Volume.
+
+Syntax: SELECT VOLUME={<N> | <L>}
+
+ VOLUME=<N> Die Nummer des Volumes, das den Fokus erhalten soll.
+
+ VOLUME=<L> Der Laufwerkbuchstabe oder Pfad des eingebundenen Ordners des
+ Volumes, das den Fokus erhalten soll.
+
+ Wenn kein Volume angegeben ist, listet der Befehl SELECT das aktuelle
+ Volume auf, das den Fokus besitzt. Sie können das Volume mit einer Nummer,
+ einem Laufwerkbuchstaben oder dem Pfad des eingebundenen
+ Ordners angeben.
+ Auf einem Basisdatenträger erhält bei Auswahl eines Volumes auch die
+ entsprechende Partition den Fokus. Mit dem Befehl LIST VOLUME können Sie
+ die Nummern aller auf dem Computer vorhandenen Volumes anzeigen.
+
+Beispiel:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Polish
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Portugese
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Romanian
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Russian
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Albanian
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Turkish
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Chinese
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
Language=Taiwanese
-<Add SELECT VOLUME command help text here>
+ Selects the specified volume and shifts the focus to it.
+
+Syntax: SELECT VOLUME={<N> | <D>}
+
+ VOLUME=<N> The number of the volume to receive the focus.
+
+ VOLUME=<D> The drive letter or mounted folder path of the volume
+ to receive the focus.
+
+ If no volume is specified, the select command lists the current volume with
+ focus. You can specify the volume by number, drive letter, or mounted folder
+ path. On a basic disk, selecting a volume also gives the corresponding
+ partition focus. You can view the numbers of all volumes on the computer by
+ using the list volume command.
+
+Example:
+
+ SELECT VOLUME=1
+ SELECT VOLUME=C
+ SELECT VOLUME=C:\\MountH
.
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7bea98592fd64a8c98d5a…
commit 7bea98592fd64a8c98d5a1cbd314ef5cc9f2faa4
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sat Jun 11 22:34:07 2022 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sat Jun 11 22:34:07 2022 +0200
[DISKPART] Add help text for the SELECT PARTITION command
---
base/system/diskpart/diskpart_msg.mc | 202 +++++++++++++++++++++++++++++++++--
1 file changed, 192 insertions(+), 10 deletions(-)
diff --git a/base/system/diskpart/diskpart_msg.mc b/base/system/diskpart/diskpart_msg.mc
index ed0cebc248e..472ff199dcd 100644
--- a/base/system/diskpart/diskpart_msg.mc
+++ b/base/system/diskpart/diskpart_msg.mc
@@ -3199,34 +3199,216 @@ SymbolicName=MSG_COMMAND_SELECT_PARTITION
Severity=Informational
Facility=System
Language=English
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=German
-<Add SELECT PARTITION command help text here>
+ Wählt die angegebene Partition aus und setzt den Fokus auf diese
+ Partition.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ Die Nummer der Partition, die den Fokus erhalten soll.
+
+ Wenn keine Partition angegeben ist, listet der Befehl SELECT die
+ aktuelle Partition auf, die den Fokus hat. Sie können die Partition
+ mit ihrer Nummer angeben. Mit dem Befehl LIST PARTITION können die
+ Nummern aller auf dem aktuellen Datenträger enthaltenen Partitionen
+ angezeigt werden.
+
+ Bevor Sie eine Partition auswählen können, müssen Sie zunächst mit dem
+ DiskPart-Befehl SELECT DISK einen Datenträger auswählen.
+
+Beispiel:
+
+ SELECT PARTITION=1
.
Language=Polish
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Portugese
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Romanian
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Russian
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Albanian
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Turkish
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Chinese
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.
Language=Taiwanese
-<Add SELECT PARTITION command help text here>
+ Selects the specified partition and shifts the focus to it.
+
+Syntax: SELECT PARTITION=<N>
+
+ PARTITION=<N>
+
+ The number of the partition to receive the focus.
+
+ If no partition is specified, the select command lists the current
+ partition with focus. You can specify the partition by its number. You can
+ view the numbers of all partitions on the current disk by using the list
+ partition command.
+
+ You must first select a disk using the DiskPart select disk command before
+ you can select a partition.
+
+Example:
+
+ SELECT PARTITION=1
.