https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2fe644dc860767ec38035…
commit 2fe644dc860767ec38035f730b11fadf902a8646
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Mon Mar 16 19:43:37 2020 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Fri Mar 20 22:40:11 2020 +0100
[ISAPNP] Report removal relations on ReadDataPort
---
drivers/bus/isapnp/isapnp.c | 2 ++
drivers/bus/isapnp/isapnp.h | 1 +
drivers/bus/isapnp/pdo.c | 6 ++++++
3 files changed, 9 insertions(+)
diff --git a/drivers/bus/isapnp/isapnp.c b/drivers/bus/isapnp/isapnp.c
index 41488efc5a7..7f2731b7ce4 100644
--- a/drivers/bus/isapnp/isapnp.c
+++ b/drivers/bus/isapnp/isapnp.c
@@ -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,
diff --git a/drivers/bus/isapnp/isapnp.h b/drivers/bus/isapnp/isapnp.h
index 724ccfea79d..e62381b6760 100644
--- a/drivers/bus/isapnp/isapnp.h
+++ b/drivers/bus/isapnp/isapnp.h
@@ -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;
diff --git a/drivers/bus/isapnp/pdo.c b/drivers/bus/isapnp/pdo.c
index 1f3f7e18f7b..639f07d5aa1 100644
--- a/drivers/bus/isapnp/pdo.c
+++ b/drivers/bus/isapnp/pdo.c
@@ -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;