https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd053237cb9a6a1640d7a…
commit fd053237cb9a6a1640d7a7a66fe38b8ec4a39c05
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Dec 7 22:51:00 2020 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Dec 7 22:51:15 2020 +0100
[NTOS:FSTUB] Minor formatting; put the PAGED_CODE() macros in evidence (instead of
being lost in the declarations).
---
ntoskrnl/fstub/fstubex.c | 58 ++++++++++++++++++++++++++++++++++++------------
1 file changed, 44 insertions(+), 14 deletions(-)
diff --git a/ntoskrnl/fstub/fstubex.c b/ntoskrnl/fstub/fstubex.c
index f0285301162..16787bbd4df 100644
--- a/ntoskrnl/fstub/fstubex.c
+++ b/ntoskrnl/fstub/fstubex.c
@@ -167,6 +167,7 @@ FstubAdjustPartitionCount(IN ULONG SectorSize,
IN OUT PULONG PartitionCount)
{
ULONG Count;
+
PAGED_CODE();
ASSERT(SectorSize);
@@ -205,6 +206,7 @@ FstubAllocateDiskInformation(IN PDEVICE_OBJECT DeviceObject,
{
NTSTATUS Status;
PDISK_INFORMATION DiskInformation;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -265,6 +267,7 @@ FstubConvertExtendedToLayout(IN PDRIVE_LAYOUT_INFORMATION_EX
LayoutEx)
{
ULONG i;
PDRIVE_LAYOUT_INFORMATION DriveLayout;
+
PAGED_CODE();
ASSERT(LayoutEx);
@@ -335,6 +338,7 @@ FstubCreateDiskMBR(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS Status;
PDISK_INFORMATION Disk = NULL;
PMASTER_BOOT_RECORD MasterBootRecord;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -382,6 +386,7 @@ FstubCreateDiskEFI(IN PDEVICE_OBJECT DeviceObject,
PDISK_INFORMATION Disk = NULL;
ULONGLONG FirstUsableLBA, LastUsableLBA;
ULONG MaxPartitionCount, SectorsForPartitions;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -449,6 +454,7 @@ FstubCreateDiskRaw(IN PDEVICE_OBJECT DeviceObject)
PDISK_INFORMATION Disk = NULL;
PARTITION_STYLE PartitionStyle;
PMASTER_BOOT_RECORD MasterBootRecord;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -546,6 +552,7 @@ FstubDbgPrintDriveLayoutEx(IN PDRIVE_LAYOUT_INFORMATION_EX
DriveLayout)
{
ULONG i;
CHAR Guid[EFI_GUID_STRING_SIZE];
+
PAGED_CODE();
DPRINT("FSTUB: DRIVE_LAYOUT_INFORMATION_EX: %p\n", DriveLayout);
@@ -587,6 +594,7 @@ FstubDbgPrintPartitionEx(IN PPARTITION_INFORMATION_EX PartitionEntry,
IN ULONG PartitionNumber)
{
CHAR Guid[EFI_GUID_STRING_SIZE];
+
PAGED_CODE();
DPRINT("Printing partition %lu\n", PartitionNumber);
@@ -626,6 +634,7 @@ FstubDbgPrintSetPartitionEx(IN PSET_PARTITION_INFORMATION_EX
PartitionEntry,
IN ULONG PartitionNumber)
{
CHAR Guid[EFI_GUID_STRING_SIZE];
+
PAGED_CODE();
DPRINT("FSTUB: SET_PARTITION_INFORMATION_EX: %p\n", PartitionEntry);
@@ -657,6 +666,7 @@ FstubDetectPartitionStyle(IN PDISK_INFORMATION Disk,
{
NTSTATUS Status;
PPARTITION_DESCRIPTOR PartitionDescriptor;
+
PAGED_CODE();
ASSERT(IS_VALID_DISK_INFO(Disk));
@@ -715,11 +725,12 @@ NTAPI
FstubGetDiskGeometry(IN PDEVICE_OBJECT DeviceObject,
OUT PDISK_GEOMETRY_EX Geometry)
{
- PIRP Irp;
NTSTATUS Status;
+ PIRP Irp;
PKEVENT Event = NULL;
PDISK_GEOMETRY_EX DiskGeometry = NULL;
PIO_STATUS_BLOCK IoStatusBlock = NULL;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -814,6 +825,7 @@ FstubReadHeaderEFI(IN PDISK_INFORMATION Disk,
ULONGLONG StartingSector;
PEFI_PARTITION_HEADER EFIHeader;
ULONG i, HeaderCRC32, PreviousCRC32, SectoredPartitionEntriesSize, LonelyPartitions;
+
PAGED_CODE();
ASSERT(Disk);
@@ -954,7 +966,7 @@ NTSTATUS
NTAPI
FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
IN BOOLEAN ReadBackupTable,
- OUT struct _DRIVE_LAYOUT_INFORMATION_EX** DriveLayout)
+ OUT PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
{
NTSTATUS Status;
ULONG NumberOfEntries;
@@ -968,6 +980,7 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
#endif
PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx = NULL;
ULONG i, PartitionCount, PartitionIndex, PartitionsPerSector;
+
PAGED_CODE();
ASSERT(Disk);
@@ -1105,12 +1118,13 @@ NTSTATUS
NTAPI
FstubReadPartitionTableMBR(IN PDISK_INFORMATION Disk,
IN BOOLEAN ReturnRecognizedPartitions,
- OUT struct _DRIVE_LAYOUT_INFORMATION_EX**
ReturnedDriveLayout)
+ OUT PDRIVE_LAYOUT_INFORMATION_EX* ReturnedDriveLayout)
{
- ULONG i;
NTSTATUS Status;
+ ULONG i;
PDRIVE_LAYOUT_INFORMATION DriveLayout = NULL;
PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx = NULL;
+
PAGED_CODE();
ASSERT(IS_VALID_DISK_INFO(Disk));
@@ -1174,12 +1188,13 @@ FstubReadSector(IN PDEVICE_OBJECT DeviceObject,
IN ULONGLONG StartingSector OPTIONAL,
OUT PVOID Buffer)
{
+ NTSTATUS Status;
PIRP Irp;
KEVENT Event;
- NTSTATUS Status;
LARGE_INTEGER StartingOffset;
IO_STATUS_BLOCK IoStatusBlock;
PIO_STACK_LOCATION IoStackLocation;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -1228,6 +1243,7 @@ FstubSetPartitionInformationEFI(IN PDISK_INFORMATION Disk,
{
NTSTATUS Status;
PDRIVE_LAYOUT_INFORMATION_EX Layout = NULL;
+
PAGED_CODE();
ASSERT(Disk);
@@ -1277,6 +1293,7 @@ FstubVerifyPartitionTableEFI(IN PDISK_INFORMATION Disk,
PEFI_PARTITION_HEADER EFIHeader, ReadEFIHeader;
BOOLEAN PrimaryValid = FALSE, BackupValid = FALSE, WriteBackup;
ULONGLONG ReadPosition, WritePosition, SectorsForPartitions, PartitionIndex;
+
PAGED_CODE();
EFIHeader = ExAllocatePoolWithTag(NonPagedPool, sizeof(EFI_PARTITION_HEADER),
TAG_FSTUB);
@@ -1404,6 +1421,7 @@ FstubWriteBootSectorEFI(IN PDISK_INFORMATION Disk)
NTSTATUS Status;
ULONG Signature = 0;
PMASTER_BOOT_RECORD MasterBootRecord;
+
PAGED_CODE();
ASSERT(Disk);
@@ -1458,9 +1476,10 @@ FstubWriteEntryEFI(IN PDISK_INFORMATION Disk,
IN BOOLEAN ForceWrite,
OUT PULONG PartitionEntryCRC32 OPTIONAL)
{
+ NTSTATUS Status = STATUS_SUCCESS;
ULONG Offset;
ULONGLONG FirstEntryLBA;
- NTSTATUS Status = STATUS_SUCCESS;
+
PAGED_CODE();
ASSERT(Disk);
@@ -1527,6 +1546,7 @@ FstubWriteHeaderEFI(IN PDISK_INFORMATION Disk,
IN BOOLEAN WriteBackupTable)
{
PEFI_PARTITION_HEADER EFIHeader;
+
PAGED_CODE();
ASSERT(Disk);
@@ -1617,6 +1637,7 @@ FstubWritePartitionTableEFI(IN PDISK_INFORMATION Disk,
NTSTATUS Status;
EFI_PARTITION_ENTRY Entry;
ULONG i, WrittenPartitions, SectoredPartitionEntriesSize, PartitionEntryCRC32;
+
PAGED_CODE();
ASSERT(Disk);
@@ -1691,6 +1712,7 @@ FstubWritePartitionTableMBR(IN PDISK_INFORMATION Disk,
{
NTSTATUS Status;
PDRIVE_LAYOUT_INFORMATION DriveLayout;
+
PAGED_CODE();
ASSERT(IS_VALID_DISK_INFO(Disk));
@@ -1722,12 +1744,13 @@ FstubWriteSector(IN PDEVICE_OBJECT DeviceObject,
IN ULONGLONG StartingSector OPTIONAL,
IN PVOID Buffer)
{
+ NTSTATUS Status;
PIRP Irp;
KEVENT Event;
- NTSTATUS Status;
LARGE_INTEGER StartingOffset;
IO_STATUS_BLOCK IoStatusBlock;
PIO_STACK_LOCATION IoStackLocation;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -1776,9 +1799,10 @@ FstubWriteSector(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS
NTAPI
IoCreateDisk(IN PDEVICE_OBJECT DeviceObject,
- IN struct _CREATE_DISK* Disk)
+ IN PCREATE_DISK Disk)
{
PARTITION_STYLE PartitionStyle;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -1807,6 +1831,7 @@ NTAPI
IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION BootDiskInformation,
IN ULONG Size)
{
+ NTSTATUS Status = STATUS_SUCCESS;
PIRP Irp;
KEVENT Event;
PLIST_ENTRY NextEntry;
@@ -1816,7 +1841,6 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
UNICODE_STRING DeviceStringW;
IO_STATUS_BLOCK IoStatusBlock;
CHAR Buffer[128], ArcBuffer[128];
- NTSTATUS Status = STATUS_SUCCESS;
BOOLEAN SingleDisk, IsBootDiskInfoEx;
PARC_DISK_SIGNATURE ArcDiskSignature;
PARC_DISK_INFORMATION ArcDiskInformation;
@@ -1825,6 +1849,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
ULONG DiskCount, DiskNumber, Signature, PartitionNumber;
ANSI_STRING ArcBootString, ArcSystemString, DeviceStringA, ArcNameStringA;
extern PLOADER_PARAMETER_BLOCK IopLoaderBlock;
+
PAGED_CODE();
/* Get loader block. If it's null, we come to late */
@@ -2139,11 +2164,12 @@ IoReadDiskSignature(IN PDEVICE_OBJECT DeviceObject,
IN ULONG BytesPerSector,
OUT PDISK_SIGNATURE Signature)
{
- PUCHAR Buffer;
NTSTATUS Status;
+ PUCHAR Buffer;
ULONG HeaderCRC32, i, CheckSum;
PEFI_PARTITION_HEADER EFIHeader;
PPARTITION_DESCRIPTOR PartitionDescriptor;
+
PAGED_CODE();
/* Ensure we'll read at least 512 bytes */
@@ -2242,11 +2268,12 @@ Cleanup:
NTSTATUS
NTAPI
IoReadPartitionTableEx(IN PDEVICE_OBJECT DeviceObject,
- IN struct _DRIVE_LAYOUT_INFORMATION_EX** DriveLayout)
+ IN PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
{
NTSTATUS Status;
PDISK_INFORMATION Disk;
PARTITION_STYLE PartitionStyle;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -2310,11 +2337,12 @@ NTSTATUS
NTAPI
IoSetPartitionInformationEx(IN PDEVICE_OBJECT DeviceObject,
IN ULONG PartitionNumber,
- IN struct _SET_PARTITION_INFORMATION_EX* PartitionInfo)
+ IN PSET_PARTITION_INFORMATION_EX PartitionInfo)
{
NTSTATUS Status;
PDISK_INFORMATION Disk;
PARTITION_STYLE PartitionStyle;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -2379,6 +2407,7 @@ IoVerifyPartitionTable(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS Status;
PDISK_INFORMATION Disk;
PARTITION_STYLE PartitionStyle;
+
PAGED_CODE();
ASSERT(DeviceObject);
@@ -2426,14 +2455,15 @@ IoVerifyPartitionTable(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS
NTAPI
IoWritePartitionTableEx(IN PDEVICE_OBJECT DeviceObject,
- IN struct _DRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
+ IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
{
- GUID DiskGuid;
NTSTATUS Status;
+ GUID DiskGuid;
ULONG NumberOfEntries;
PDISK_INFORMATION Disk;
PEFI_PARTITION_HEADER EfiHeader;
ULONGLONG SectorsForPartitions, FirstUsableLBA, LastUsableLBA;
+
PAGED_CODE();
ASSERT(DeviceObject);