mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:23:05 +00:00
[ISAPNP] Return a compatibleIDs only if defined
This commit is contained in:
parent
b905c40d2e
commit
42724f47f8
3 changed files with 12 additions and 2 deletions
|
@ -335,6 +335,7 @@ IsaPnpCreateReadPortDO(PISAPNP_FDO_EXTENSION FdoExt)
|
||||||
{
|
{
|
||||||
UNICODE_STRING DeviceID = RTL_CONSTANT_STRING(L"ISAPNP\\ReadDataPort\0");
|
UNICODE_STRING DeviceID = RTL_CONSTANT_STRING(L"ISAPNP\\ReadDataPort\0");
|
||||||
UNICODE_STRING HardwareIDs = RTL_CONSTANT_STRING(L"ISAPNP\\ReadDataPort\0\0");
|
UNICODE_STRING HardwareIDs = RTL_CONSTANT_STRING(L"ISAPNP\\ReadDataPort\0\0");
|
||||||
|
UNICODE_STRING CompatibleIDs = RTL_CONSTANT_STRING(L"\0\0");
|
||||||
UNICODE_STRING InstanceID = RTL_CONSTANT_STRING(L"0\0");
|
UNICODE_STRING InstanceID = RTL_CONSTANT_STRING(L"0\0");
|
||||||
PISAPNP_PDO_EXTENSION PdoExt;
|
PISAPNP_PDO_EXTENSION PdoExt;
|
||||||
|
|
||||||
|
@ -367,6 +368,12 @@ IsaPnpCreateReadPortDO(PISAPNP_FDO_EXTENSION FdoExt)
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
|
Status = IsaPnpDuplicateUnicodeString(0,
|
||||||
|
&CompatibleIDs,
|
||||||
|
&PdoExt->CompatibleIDs);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return Status;
|
||||||
|
|
||||||
Status = IsaPnpDuplicateUnicodeString(0,
|
Status = IsaPnpDuplicateUnicodeString(0,
|
||||||
&InstanceID,
|
&InstanceID,
|
||||||
&PdoExt->InstanceID);
|
&PdoExt->InstanceID);
|
||||||
|
|
|
@ -51,6 +51,7 @@ typedef struct _ISAPNP_PDO_EXTENSION {
|
||||||
PISAPNP_FDO_EXTENSION FdoExt;
|
PISAPNP_FDO_EXTENSION FdoExt;
|
||||||
UNICODE_STRING DeviceID;
|
UNICODE_STRING DeviceID;
|
||||||
UNICODE_STRING HardwareIDs;
|
UNICODE_STRING HardwareIDs;
|
||||||
|
UNICODE_STRING CompatibleIDs;
|
||||||
UNICODE_STRING InstanceID;
|
UNICODE_STRING InstanceID;
|
||||||
} ISAPNP_PDO_EXTENSION, *PISAPNP_PDO_EXTENSION;
|
} ISAPNP_PDO_EXTENSION, *PISAPNP_PDO_EXTENSION;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@ IsaPdoQueryId(
|
||||||
IN PIRP Irp,
|
IN PIRP Irp,
|
||||||
IN PIO_STACK_LOCATION IrpSp)
|
IN PIO_STACK_LOCATION IrpSp)
|
||||||
{
|
{
|
||||||
UNICODE_STRING EmptyString = RTL_CONSTANT_STRING(L"");
|
|
||||||
PUNICODE_STRING Source;
|
PUNICODE_STRING Source;
|
||||||
PWCHAR Buffer;
|
PWCHAR Buffer;
|
||||||
|
|
||||||
|
@ -111,7 +110,7 @@ IsaPdoQueryId(
|
||||||
|
|
||||||
case BusQueryCompatibleIDs:
|
case BusQueryCompatibleIDs:
|
||||||
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
|
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
|
||||||
Source = &EmptyString;
|
Source = &PdoExt->CompatibleIDs;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BusQueryInstanceID:
|
case BusQueryInstanceID:
|
||||||
|
@ -125,6 +124,9 @@ IsaPdoQueryId(
|
||||||
return Irp->IoStatus.Status;
|
return Irp->IoStatus.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Source->Buffer)
|
||||||
|
return Irp->IoStatus.Status;
|
||||||
|
|
||||||
Buffer = ExAllocatePool(PagedPool, Source->MaximumLength);
|
Buffer = ExAllocatePool(PagedPool, Source->MaximumLength);
|
||||||
if (!Buffer)
|
if (!Buffer)
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue