[NTOS:FSTUB] Whitespace fixes only.

This commit is contained in:
Hermès Bélusca-Maïto 2020-08-25 14:40:29 +02:00
parent 075871076c
commit e3c35c2227
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 36 additions and 29 deletions

View file

@ -1393,12 +1393,13 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject,
IO_STATUS_BLOCK IoStatusBlock;
PKEVENT Event;
NTSTATUS Status;
PAGED_CODE();
/* Allocate a non-paged event */
Event = ExAllocatePoolWithTag(NonPagedPool,
sizeof(KEVENT),
TAG_FILE_SYSTEM);
sizeof(KEVENT),
TAG_FILE_SYSTEM);
if (!Event) return STATUS_INSUFFICIENT_RESOURCES;
/* Initialize it */
@ -1406,14 +1407,14 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject,
/* Build the IRP */
Irp = IoBuildDeviceIoControlRequest(IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
DeviceObject,
NULL,
0UL,
Geometry,
sizeof(DISK_GEOMETRY_EX),
FALSE,
Event,
&IoStatusBlock);
DeviceObject,
NULL,
0UL,
Geometry,
sizeof(DISK_GEOMETRY_EX),
FALSE,
Event,
&IoStatusBlock);
if (!Irp)
{
/* Fail, free the event */
@ -1448,7 +1449,7 @@ HalpIsValidPartitionEntry(IN PPARTITION_DESCRIPTOR Entry,
if (Entry->PartitionType == PARTITION_ENTRY_UNUSED) return TRUE;
/* Get the last sector of the partition */
EndingSector = GET_STARTING_SECTOR(Entry) + GET_PARTITION_LENGTH(Entry);
EndingSector = GET_STARTING_SECTOR(Entry) + GET_PARTITION_LENGTH(Entry);
/* Check if it's more then the maximum sector */
if (EndingSector > MaxSector)
@ -1461,7 +1462,7 @@ HalpIsValidPartitionEntry(IN PPARTITION_DESCRIPTOR Entry,
DPRINT1("FSTUB: max %#I64x\n", MaxSector);
return FALSE;
}
else if(GET_STARTING_SECTOR(Entry) > MaxOffset)
else if (GET_STARTING_SECTOR(Entry) > MaxOffset)
{
/* Invalid partition */
DPRINT1("FSTUB: entry is invalid\n");
@ -1653,6 +1654,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
PPARTITION_DESCRIPTOR PartitionDescriptor;
NTSTATUS Status;
PIO_STACK_LOCATION IoStackLocation;
Offset.QuadPart = 0;
/* Assume failure */
@ -1789,9 +1791,11 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
PIO_STACK_LOCATION IoStackLocation;
UCHAR PartitionType;
LARGE_INTEGER HiddenSectors64;
VolumeOffset.QuadPart = Offset.QuadPart = 0;
PAGED_CODE();
VolumeOffset.QuadPart = Offset.QuadPart = 0;
/* Allocate the buffer */
*PartitionBuffer = ExAllocatePoolWithTag(NonPagedPool,
BufferSize,
@ -2212,9 +2216,11 @@ xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
BOOLEAN IsPrimary = TRUE, IsEzDrive = FALSE;
PVOID MbrBuffer;
PIO_STACK_LOCATION IoStackLocation;
VolumeOffset.QuadPart = Offset.QuadPart = 0;
PAGED_CODE();
VolumeOffset.QuadPart = Offset.QuadPart = 0;
/* Normalize the buffer size */
BufferSize = max(512, SectorSize);
@ -2287,8 +2293,7 @@ xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
for (Entry = 1; Entry <= 4; Entry++, PartitionDescriptor++)
{
/* Check if it's unused or a container partition */
if ((PartitionDescriptor->PartitionType ==
PARTITION_ENTRY_UNUSED) ||
if ((PartitionDescriptor->PartitionType == PARTITION_ENTRY_UNUSED) ||
(IsContainerPartition(PartitionDescriptor->PartitionType)))
{
/* Go to the next one */
@ -2409,9 +2414,11 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
PIO_STACK_LOCATION IoStackLocation;
PPARTITION_INFORMATION PartitionInfo = PartitionBuffer->PartitionEntry;
PPARTITION_INFORMATION TableEntry;
ExtendedOffset.QuadPart = NextOffset.QuadPart = Offset.QuadPart = 0;
PAGED_CODE();
ExtendedOffset.QuadPart = NextOffset.QuadPart = Offset.QuadPart = 0;
/* Normalize the buffer size */
BufferSize = max(512, SectorSize);
@ -2618,7 +2625,7 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
KeInitializeEvent(&Event, NotificationEvent, FALSE);
/* If we unbiased for EZ-Drive, rebias now */
if ((IsEzDrive) && !(Offset.QuadPart)) Offset.QuadPart = 512;
if (IsEzDrive && !Offset.QuadPart) Offset.QuadPart = 512;
/* Build the write IRP */
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_WRITE,

View file

@ -2110,7 +2110,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION BootDiskInformation,
else
{
((PBOOTDISK_INFORMATION_EX)BootDiskInformation)->SystemDeviceIsGpt = FALSE;
}
}
}
/* Dereference FileObject */
@ -2278,18 +2278,18 @@ IoReadPartitionTableEx(IN PDEVICE_OBJECT DeviceObject,
break;
case PARTITION_STYLE_GPT:
/* Read primary table */
Status = FstubReadPartitionTableEFI(Disk, FALSE, DriveLayout);
/* If it failed, try reading backup table */
if (!NT_SUCCESS(Status))
{
Status = FstubReadPartitionTableEFI(Disk, TRUE, DriveLayout);
}
break;
/* Read primary table */
Status = FstubReadPartitionTableEFI(Disk, FALSE, DriveLayout);
/* If it failed, try reading backup table */
if (!NT_SUCCESS(Status))
{
Status = FstubReadPartitionTableEFI(Disk, TRUE, DriveLayout);
}
break;
default:
DPRINT("Unknown partition type\n");
Status = STATUS_UNSUCCESSFUL;
DPRINT("Unknown partition type\n");
Status = STATUS_UNSUCCESSFUL;
}
/* It's over, internal structure not needed anymore */