34 return Irp->IoStatus.Status;
40 DeviceRelations->
Count = 1;
103 else if (
PdoExt->SpecialFiles > 0)
109 return Irp->IoStatus.Status;
123 size_t CharCount, Remaining;
131 CharCount =
sizeof(
"ISAPNP\\XXXFFFF");
135 CharCount +=
sizeof(
"_DEV1234") -
sizeof(
ANSI_NULL);
139 CharCount *
sizeof(
WCHAR),
174 CharCount =
sizeof(
"ISAPNP\\XXXFFFF") +
180 CharCount +=
sizeof(
"_DEV1234") -
sizeof(
ANSI_NULL);
184 CharCount *
sizeof(
WCHAR),
189 DPRINT(
"Hardware IDs:\n");
234 DPRINT(
" '%S'\n", IdStart);
250 CharCount +=
sizeof(
"*PNPxxxx");
255 return Irp->IoStatus.Status;
258 CharCount *
sizeof(
WCHAR),
263 DPRINT(
"Compatible IDs:\n");
284 DPRINT(
" '%S'\n", IdStart);
300 CharCount *
sizeof(
WCHAR),
320 return Irp->IoStatus.Status;
340 static const WCHAR ReadPortId[] =
L"ISAPNP\\ReadDataPort";
401 return Irp->IoStatus.Status;
426 if (!
PdoExt->IsaPnpDevice->FriendlyName)
427 return Irp->IoStatus.Status;
429 CharCount =
strlen(
PdoExt->IsaPnpDevice->FriendlyName) +
433 return Irp->IoStatus.Status;
436 CharCount *
sizeof(
WCHAR),
447 PdoExt->IsaPnpDevice->FriendlyName);
459 return Irp->IoStatus.Status;
491 if (!
PdoExt->ResourceList)
492 return Irp->IoStatus.Status;
494 ListSize =
PdoExt->ResourceListSize;
529 if (!
PdoExt->RequirementsList)
530 return Irp->IoStatus.Status;
532 ListSize =
PdoExt->RequirementsList->ListSize;
542#define IS_READ_PORT(_d) ((_d)->Type == CmResourceTypePort && (_d)->u.Port.Length > 1)
563 if (
ResourceList->List[0].PartialResourceList.Version != 1 ||
564 ResourceList->List[0].PartialResourceList.Revision != 1)
566 DPRINT1(
"Bad resource list version (%u.%u)\n",
574 if (
ResourceList->List[0].PartialResourceList.Count > 3)
576 ULONG SelectedPort = 0;
581 &
ResourceList->List[0].PartialResourceList.PartialDescriptors[
i];
593 SelectedPort = PartialDescriptor->
u.
Port.Start.u.LowPart;
601 SelectedPort = PartialDescriptor->
u.
Port.Start.u.LowPart;
607 ASSERT(SelectedPort != 0);
610 PdoExt->SelectedPort = SelectedPort;
617 else if (
ResourceList->List[0].PartialResourceList.Count == 3)
619 if (
ResourceList->List[0].PartialResourceList.Count > 3)
622 PdoExt->Flags &= ~ISAPNP_READ_PORT_NEED_REBALANCE;
627 &
ResourceList->List[0].PartialResourceList.PartialDescriptors[
i];
636 if (FdoExt->
Cards > 0)
640 IsaPnpAcquireDeviceDataLock(FdoExt);
643 Status = IsaHwFillDeviceList(FdoExt);
646 IsaPnpReleaseDeviceDataLock(FdoExt);
688 return Irp->IoStatus.Status;
738 return Irp->IoStatus.Status;
769 IsaPnpAcquireDeviceDataLock(FdoExt);
774 IsaPnpReleaseDeviceDataLock(FdoExt);
794 IsaPnpAcquireDeviceDataLock(FdoExt);
805 LogDevice->
Flags &= ~ISAPNP_PRESENT;
808 IsaPnpReleaseDeviceDataLock(FdoExt);
810 PdoExt->Flags &= ~ISAPNP_READ_PORT_ALLOW_FDO_SCAN;
833 DPRINT(
"Removing CSN %u, LDN %u\n", LogDev->
CSN, LogDev->
LDN);
835 if (
PdoExt->RequirementsList)
878 DPRINT(
"%s(%p, %p) CSN %u, LDN %u, Minor - %X\n",
882 PdoExt->IsaPnpDevice->CSN,
883 PdoExt->IsaPnpDevice->LDN,
888 DPRINT(
"%s(%p, %p) ReadPort, Minor - %X\n",
912 DPRINT1(
"Failed to configure CSN %u, LDN %u with status 0x%08lx\n",
940 PdoExt->Flags &= ~ISAPNP_READ_PORT_ALLOW_FDO_SCAN;
952 if (
PdoExt->SpecialFiles > 0)
964 if (
PdoExt->SpecialFiles > 0)
ACPI_SIZE strlen(const char *String)
VOID IsaPnpRemoveLogicalDeviceDO(_In_ PDEVICE_OBJECT Pdo)
static NTSTATUS IsaPdoQueryDeviceUsageNotification(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoQueryDeviceText(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoQueryCapabilities(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaReadPortQueryId(_Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaReadPortRemoveDevice(_In_ PISAPNP_PDO_EXTENSION PdoExt, _In_ BOOLEAN FinalRemove)
static NTSTATUS IsaPdoQueryDeviceRelations(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
NTSTATUS IsaPdoPnp(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoQueryResourceRequirements(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoQueryBusInformation(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp)
static NTSTATUS IsaPdoQueryResources(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoQueryId(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoStartReadPort(_In_ PISAPNP_PDO_EXTENSION PdoExt, _In_ PCM_RESOURCE_LIST ResourceList)
static NTSTATUS IsaPdoQueryPnpDeviceState(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp)
static NTSTATUS IsaPdoFilterResourceRequirements(_In_ PISAPNP_PDO_EXTENSION PdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
static NTSTATUS IsaPdoRemoveDevice(_In_ PISAPNP_PDO_EXTENSION PdoExt, _In_ BOOLEAN FinalRemove)
#define NT_SUCCESS(StatCode)
VOID IsaHwWakeDevice(_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
VOID IsaHwWaitForKey(VOID)
VOID IsaHwDeactivateDevice(_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
UCHAR IsaHwTryReadDataPort(_In_ PUCHAR ReadDataPort)
NTSTATUS IsaHwConfigureDevice(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice, _In_ PCM_RESOURCE_LIST Resources)
VOID IsaHwActivateDevice(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
_In_ PIO_STACK_LOCATION IrpSp
#define RemoveEntryList(Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
NTSTATUS IsaPnpFillDeviceRelations(_In_ PISAPNP_FDO_EXTENSION FdoExt, _Inout_ PIRP Irp, _In_ BOOLEAN IncludeDataPort)
VOID IsaPnpRemoveReadPortDO(_In_ PDEVICE_OBJECT Pdo)
PIO_RESOURCE_REQUIREMENTS_LIST IsaPnpCreateReadPortDORequirements(_In_opt_ ULONG SelectedReadPort)
PCM_RESOURCE_LIST IsaPnpCreateReadPortDOResources(VOID)
#define ISAPNP_READ_PORT_ALLOW_FDO_SCAN
Allows the active FDO to scan the bus.
#define ISAPNP_READ_PORT_NEED_REBALANCE
The I/O resource requirements have changed.
#define ISAPNP_SCANNED_BY_READ_PORT
The bus has been scanned by Read Port PDO.
#define ISAPNP_ENUMERATED
Whether the device has been reported to the PnP manager.
#define ISAPNP_HAS_MULTIPLE_LOGDEVS
#define ExFreePoolWithTag(_P, _T)
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
#define UNREFERENCED_PARAMETER(P)
#define IRP_MN_SURPRISE_REMOVAL
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
#define POWER_SYSTEM_MAXIMUM
#define STATUS_RESOURCE_REQUIREMENTS_CHANGED
#define STATUS_DEVICE_CONFIGURATION_ERROR
#define STATUS_REVISION_MISMATCH
NTSTRSAFEVAPI RtlStringCchPrintfExW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
VOID NTAPI IoInvalidateDeviceState(IN PDEVICE_OBJECT DeviceObject)
base of all file and directory entries
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
PDEVICE_OBJECT Objects[1]
struct _IO_STACK_LOCATION::@3974::@4007 UsageNotification
struct _IO_STACK_LOCATION::@3974::@4001 DeviceCapabilities
struct _IO_STACK_LOCATION::@3974::@4011 StartDevice
struct _IO_STACK_LOCATION::@3974::@4005 QueryId
struct _IO_STACK_LOCATION::@3974::@4006 QueryDeviceText
struct _IO_STACK_LOCATION::@3974::@3999 QueryDeviceRelations
union _IO_STACK_LOCATION::@1575 Parameters
LIST_ENTRY DeviceListHead
PDEVICE_OBJECT ReadPortPdo
LIST_ENTRY CompatibleIdList
PISAPNP_RESOURCE Resources
struct _LIST_ENTRY * Flink
COMMON_DEVICE_EXTENSION Common
#define RtlCopyMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_DEVICE_BUSY
#define STATUS_INSUFFICIENT_RESOURCES
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
_In_ WDFDEVICE _In_ PPNP_BUS_INFORMATION BusInformation
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
_In_ WDFIORESREQLIST RequirementsList
#define DeviceCapabilities
#define IoAdjustPagingPathCount(_Count, _Increment)
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define PNP_DEVICE_NOT_DISABLEABLE
#define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED
#define IRP_MN_START_DEVICE
#define PNP_DEVICE_FAILED
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_QUERY_RESOURCES
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_STOP_DEVICE
#define IRP_MN_QUERY_BUS_INFORMATION
@ DeviceUsageTypeHibernation
@ DeviceUsageTypeDumpFile
#define IRP_MN_QUERY_REMOVE_DEVICE
#define ObReferenceObject