mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +00:00
[ISAPNP] Implement querying bus information
This commit is contained in:
parent
8f36dee6ff
commit
e19595572a
3 changed files with 35 additions and 1 deletions
|
@ -683,6 +683,7 @@ IsaAddDevice(
|
||||||
PDEVICE_OBJECT Fdo;
|
PDEVICE_OBJECT Fdo;
|
||||||
PISAPNP_FDO_EXTENSION FdoExt;
|
PISAPNP_FDO_EXTENSION FdoExt;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
static ULONG BusNumber = 0;
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
@ -708,6 +709,7 @@ IsaAddDevice(
|
||||||
FdoExt->Common.IsFdo = TRUE;
|
FdoExt->Common.IsFdo = TRUE;
|
||||||
FdoExt->Common.State = dsStopped;
|
FdoExt->Common.State = dsStopped;
|
||||||
FdoExt->DriverObject = DriverObject;
|
FdoExt->DriverObject = DriverObject;
|
||||||
|
FdoExt->BusNumber = BusNumber++;
|
||||||
FdoExt->Pdo = PhysicalDeviceObject;
|
FdoExt->Pdo = PhysicalDeviceObject;
|
||||||
FdoExt->Ldo = IoAttachDeviceToDeviceStack(Fdo,
|
FdoExt->Ldo = IoAttachDeviceToDeviceStack(Fdo,
|
||||||
PhysicalDeviceObject);
|
PhysicalDeviceObject);
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
#include <section_attribs.h>
|
#include <section_attribs.h>
|
||||||
#include "isapnphw.h"
|
#include "isapnphw.h"
|
||||||
|
|
||||||
|
#include <initguid.h>
|
||||||
|
#include <wdmguid.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,6 +76,7 @@ typedef struct _ISAPNP_FDO_EXTENSION
|
||||||
PDEVICE_OBJECT Ldo;
|
PDEVICE_OBJECT Ldo;
|
||||||
PDEVICE_OBJECT Pdo;
|
PDEVICE_OBJECT Pdo;
|
||||||
PDEVICE_OBJECT ReadPortPdo;
|
PDEVICE_OBJECT ReadPortPdo;
|
||||||
|
ULONG BusNumber;
|
||||||
KEVENT DeviceSyncEvent;
|
KEVENT DeviceSyncEvent;
|
||||||
LIST_ENTRY DeviceListHead;
|
LIST_ENTRY DeviceListHead;
|
||||||
ULONG DeviceCount;
|
ULONG DeviceCount;
|
||||||
|
|
|
@ -483,6 +483,31 @@ IsaPdoRepeatRequest(
|
||||||
return STATUS_PENDING;
|
return STATUS_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
CODE_SEG("PAGE")
|
||||||
|
NTSTATUS
|
||||||
|
IsaPdoQueryBusInformation(
|
||||||
|
_In_ PISAPNP_PDO_EXTENSION PdoExt,
|
||||||
|
_Inout_ PIRP Irp)
|
||||||
|
{
|
||||||
|
PPNP_BUS_INFORMATION BusInformation;
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
BusInformation = ExAllocatePoolWithTag(PagedPool,
|
||||||
|
sizeof(PNP_BUS_INFORMATION),
|
||||||
|
TAG_ISAPNP);
|
||||||
|
if (!BusInformation)
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
BusInformation->BusTypeGuid = GUID_BUS_TYPE_ISAPNP;
|
||||||
|
BusInformation->LegacyBusType = Isa;
|
||||||
|
BusInformation->BusNumber = PdoExt->FdoExt->BusNumber;
|
||||||
|
|
||||||
|
Irp->IoStatus.Information = (ULONG_PTR)BusInformation;
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
CODE_SEG("PAGE")
|
CODE_SEG("PAGE")
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
IsaPdoPnp(
|
IsaPdoPnp(
|
||||||
|
@ -544,6 +569,10 @@ IsaPdoPnp(
|
||||||
Status = IsaReadPortQueryId(Irp, IrpSp);
|
Status = IsaReadPortQueryId(Irp, IrpSp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IRP_MN_QUERY_BUS_INFORMATION:
|
||||||
|
Status = IsaPdoQueryBusInformation(PdoExt, Irp);
|
||||||
|
break;
|
||||||
|
|
||||||
case IRP_MN_QUERY_REMOVE_DEVICE:
|
case IRP_MN_QUERY_REMOVE_DEVICE:
|
||||||
case IRP_MN_REMOVE_DEVICE:
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||||
|
@ -559,7 +588,6 @@ IsaPdoPnp(
|
||||||
case IRP_MN_WRITE_CONFIG:
|
case IRP_MN_WRITE_CONFIG:
|
||||||
case IRP_MN_EJECT:
|
case IRP_MN_EJECT:
|
||||||
case IRP_MN_SET_LOCK:
|
case IRP_MN_SET_LOCK:
|
||||||
case IRP_MN_QUERY_BUS_INFORMATION:
|
|
||||||
case IRP_MN_DEVICE_USAGE_NOTIFICATION:
|
case IRP_MN_DEVICE_USAGE_NOTIFICATION:
|
||||||
return IsaPdoRepeatRequest(PdoExt, Irp, TRUE);
|
return IsaPdoRepeatRequest(PdoExt, Irp, TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue