[ISAPNP] Report removal relations on ReadDataPort

This commit is contained in:
Hervé Poussineau 2020-03-16 19:43:37 +01:00
parent c4813f73f5
commit 2fe644dc86
3 changed files with 9 additions and 0 deletions

View file

@ -194,6 +194,7 @@ IsaPnpFillDeviceRelations(
PdoExt->Common.Self = IsaDevice->Pdo;
PdoExt->Common.State = dsStopped;
PdoExt->IsaPnpDevice = IsaDevice;
PdoExt->FdoExt = FdoExt;
Status = IsaFdoCreateDeviceIDs(PdoExt);
if (!NT_SUCCESS(Status))
@ -352,6 +353,7 @@ IsaPnpCreateReadPortDO(PISAPNP_FDO_EXTENSION FdoExt)
PdoExt->Common.IsFdo = FALSE;
PdoExt->Common.Self = FdoExt->DataPortPdo;
PdoExt->Common.State = dsStopped;
PdoExt->FdoExt = FdoExt;
Status = IsaPnpDuplicateUnicodeString(0,
&DeviceID,

View file

@ -48,6 +48,7 @@ typedef struct _ISAPNP_FDO_EXTENSION {
typedef struct _ISAPNP_PDO_EXTENSION {
ISAPNP_COMMON_EXTENSION Common;
PISAPNP_LOGICAL_DEVICE IsaPnpDevice;
PISAPNP_FDO_EXTENSION FdoExt;
UNICODE_STRING DeviceID;
UNICODE_STRING HardwareIDs;
UNICODE_STRING InstanceID;

View file

@ -19,6 +19,12 @@ IsaPdoQueryDeviceRelations(
{
PDEVICE_RELATIONS DeviceRelations;
if (IrpSp->Parameters.QueryDeviceRelations.Type == RemovalRelations &&
PdoExt->Common.Self == PdoExt->FdoExt->DataPortPdo)
{
return IsaPnpFillDeviceRelations(PdoExt->FdoExt, Irp, FALSE);
}
if (IrpSp->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation)
return Irp->IoStatus.Status;