[NTOS:IO] IopVerifyDiskSignature(): simplify code and SAL2-annotate

This commit is contained in:
Hermès Bélusca-Maïto 2024-06-11 21:26:12 +02:00
parent 85d338ed65
commit 5e3f3f59df
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 8 additions and 13 deletions

View file

@ -799,12 +799,10 @@ IoInitSystem(
);
BOOLEAN
NTAPI
IopVerifyDiskSignature(
IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
IN PARC_DISK_SIGNATURE ArcDiskSignature,
OUT PULONG Signature
);
_In_ PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
_In_ PARC_DISK_SIGNATURE ArcDiskSignature,
_Out_ PULONG Signature);
BOOLEAN
NTAPI

View file

@ -946,10 +946,10 @@ IopReassignSystemRoot(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
}
BOOLEAN
NTAPI
IopVerifyDiskSignature(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
IN PARC_DISK_SIGNATURE ArcDiskSignature,
OUT PULONG Signature)
IopVerifyDiskSignature(
_In_ PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
_In_ PARC_DISK_SIGNATURE ArcDiskSignature,
_Out_ PULONG Signature)
{
/* Fail if the partition table is invalid */
if (!ArcDiskSignature->ValidPartitionTable)
@ -972,10 +972,7 @@ IopVerifyDiskSignature(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
{
/* Verify whether the signature is GPT and compare the GUID */
if (ArcDiskSignature->IsGpt &&
(((PULONG)ArcDiskSignature->GptSignature)[0] == DriveLayout->Gpt.DiskId.Data1 &&
((PUSHORT)ArcDiskSignature->GptSignature)[2] == DriveLayout->Gpt.DiskId.Data2 &&
((PUSHORT)ArcDiskSignature->GptSignature)[3] == DriveLayout->Gpt.DiskId.Data3 &&
((PULONGLONG)ArcDiskSignature->GptSignature)[1] == ((PULONGLONG)DriveLayout->Gpt.DiskId.Data4)[0]))
IsEqualGUID((PGUID)&ArcDiskSignature->GptSignature, &DriveLayout->Gpt.DiskId))
{
/* There is no signature to return, just zero it */
if (Signature)