https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e1b835bdbf8efd009e0d7…
commit e1b835bdbf8efd009e0d775ad974b7f84050d540
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Fri Dec 27 17:17:53 2024 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Jan 5 20:07:53 2025 +0100
[PARTMGR] Minor code formatting.
---
drivers/storage/partmgr/partition.c | 13 ++++---------
drivers/storage/partmgr/partmgr.c | 20 +++++++-------------
2 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/drivers/storage/partmgr/partition.c b/drivers/storage/partmgr/partition.c
index c7763027951..f54ccf55596 100644
--- a/drivers/storage/partmgr/partition.c
+++ b/drivers/storage/partmgr/partition.c
@@ -27,7 +27,7 @@ PartitionCreateDevice(
UNICODE_STRING deviceName;
UINT32 volumeNum;
- // create the device object
+ // Create the partition/volume device object
volumeNum = HarddiskVolumeNextId++;
swprintf(nameBuf, L"\\Device\\HarddiskVolume%lu", volumeNum);
@@ -41,7 +41,6 @@ PartitionCreateDevice(
FILE_DEVICE_SECURE_OPEN,
FALSE,
&partitionDevice);
-
if (!NT_SUCCESS(status))
{
ERR("Unable to create device object %wZ\n", &deviceName);
@@ -81,10 +80,10 @@ PartitionCreateDevice(
partExt->DeviceObject = partitionDevice;
partExt->LowerDevice = FDObject;
+ // The device is initialized
partitionDevice->Flags &= ~DO_DEVICE_INITIALIZING;
*PDO = partitionDevice;
-
return status;
}
@@ -136,11 +135,9 @@ PartitionHandleStartDevice(
return status;
}
+ INFO("Partition interface %wZ\n", &interfaceName);
PartExt->PartitionInterfaceName = interfaceName;
status = IoSetDeviceInterfaceState(&interfaceName, TRUE);
-
- INFO("Partition interface %wZ\n", &interfaceName);
-
if (!NT_SUCCESS(status))
{
RtlFreeUnicodeString(&interfaceName);
@@ -157,11 +154,9 @@ PartitionHandleStartDevice(
return status;
}
+ INFO("Volume interface %wZ\n", &interfaceName);
PartExt->VolumeInterfaceName = interfaceName;
status = IoSetDeviceInterfaceState(&interfaceName, TRUE);
-
- INFO("Volume interface %wZ\n", &interfaceName);
-
if (!NT_SUCCESS(status))
{
RtlFreeUnicodeString(&interfaceName);
diff --git a/drivers/storage/partmgr/partmgr.c b/drivers/storage/partmgr/partmgr.c
index 8d3a175d91a..fd3fd89c247 100644
--- a/drivers/storage/partmgr/partmgr.c
+++ b/drivers/storage/partmgr/partmgr.c
@@ -340,7 +340,6 @@ PartMgrUpdatePartitionDevices(
pdoNumber,
NewLayout->PartitionStyle,
&partitionDevice);
-
if (!NT_SUCCESS(status))
{
partEntry->PartitionNumber = 0;
@@ -948,8 +947,8 @@ FdoHandleStartDevice(
_In_ PFDO_EXTENSION FdoExtension,
_In_ PIRP Irp)
{
- // obtain the disk device number
- // this is not expected to change thus not in PartMgrRefreshDiskData
+ // Obtain the disk device number.
+ // It is not expected to change, thus not in PartMgrRefreshDiskData().
STORAGE_DEVICE_NUMBER deviceNumber;
NTSTATUS status = IssueSyncIoControlRequest(IOCTL_STORAGE_GET_DEVICE_NUMBER,
FdoExtension->LowerDevice,
@@ -965,25 +964,22 @@ FdoHandleStartDevice(
FdoExtension->DiskData.DeviceNumber = deviceNumber.DeviceNumber;
- // register the disk interface
- // partmgr.sys from Windows 8.1 also registers a mysterious
GUID_DEVINTERFACE_HIDDEN_DISK here
+ // Register the disk interface.
+ // partmgr.sys from Windows 8.1 also registers a mysterious
GUID_DEVINTERFACE_HIDDEN_DISK here.
UNICODE_STRING interfaceName;
status = IoRegisterDeviceInterface(FdoExtension->PhysicalDiskDO,
&GUID_DEVINTERFACE_DISK,
NULL,
&interfaceName);
-
if(!NT_SUCCESS(status))
{
ERR("Failed to register GUID_DEVINTERFACE_DISK, status %x\n",
status);
return status;
}
+ INFO("Disk interface %wZ\n", &interfaceName);
FdoExtension->DiskInterfaceName = interfaceName;
status = IoSetDeviceInterfaceState(&interfaceName, TRUE);
-
- INFO("Disk interface %wZ\n", &interfaceName);
-
if (!NT_SUCCESS(status))
{
RtlFreeUnicodeString(&interfaceName);
@@ -1188,12 +1184,11 @@ PartMgrAddDevice(
NTSTATUS status = IoCreateDevice(DriverObject,
sizeof(FDO_EXTENSION),
- 0,
+ NULL,
FILE_DEVICE_BUS_EXTENDER,
FILE_AUTOGENERATED_DEVICE_NAME |
FILE_DEVICE_SECURE_OPEN,
FALSE,
&deviceObject);
-
if (!NT_SUCCESS(status))
{
ERR("Failed to create FDO 0x%x\n", status);
@@ -1218,9 +1213,8 @@ PartMgrAddDevice(
}
deviceObject->Flags |= DO_DIRECT_IO | DO_POWER_PAGABLE;
- // device is initialized
+ // The device is initialized
deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
-
return STATUS_SUCCESS;
}