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

View file

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