mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[PARTMGR] Register a disk interface for disk PDO
CORE-14187
This commit is contained in:
parent
883ae6d93b
commit
2d6c6fa38d
2 changed files with 34 additions and 0 deletions
|
@ -846,6 +846,32 @@ 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
|
||||
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;
|
||||
}
|
||||
|
||||
FdoExtension->DiskInterfaceName = interfaceName;
|
||||
status = IoSetDeviceInterfaceState(&interfaceName, TRUE);
|
||||
|
||||
INFO("Disk interface %wZ\n", &interfaceName);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
RtlFreeUnicodeString(&interfaceName);
|
||||
RtlInitUnicodeString(&FdoExtension->DiskInterfaceName, NULL);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -1002,6 +1028,13 @@ FdoHandleRemoveDevice(
|
|||
ASSERT(partExt->DeviceRemoved);
|
||||
}
|
||||
|
||||
if (FdoExtension->DiskInterfaceName.Buffer)
|
||||
{
|
||||
IoSetDeviceInterfaceState(&FdoExtension->DiskInterfaceName, FALSE);
|
||||
RtlFreeUnicodeString(&FdoExtension->DiskInterfaceName);
|
||||
RtlInitUnicodeString(&FdoExtension->DiskInterfaceName, NULL);
|
||||
}
|
||||
|
||||
// Send the IRP down the stack
|
||||
IoSkipCurrentIrpStackLocation(Irp);
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
|
|
|
@ -44,6 +44,7 @@ typedef struct _FDO_EXTENSION
|
|||
|
||||
SINGLE_LIST_ENTRY PartitionList;
|
||||
UINT32 EnumeratedPartitionsTotal;
|
||||
UNICODE_STRING DiskInterfaceName;
|
||||
|
||||
struct {
|
||||
UINT64 DiskSize;
|
||||
|
|
Loading…
Reference in a new issue