2014-02-06 11:18:34 +00:00
|
|
|
#ifndef _ISAPNP_PCH_
|
|
|
|
#define _ISAPNP_PCH_
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
#include <wdm.h>
|
2020-02-10 20:31:28 +00:00
|
|
|
#include <ntstrsafe.h>
|
2020-03-21 22:08:00 +00:00
|
|
|
#include <isapnphw.h>
|
2007-07-06 20:25:30 +00:00
|
|
|
|
2001-05-01 23:00:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define TAG_ISAPNP 'PNPI'
|
2007-07-06 20:25:30 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
typedef enum {
|
2020-03-20 18:19:30 +00:00
|
|
|
dsStopped,
|
|
|
|
dsStarted
|
2010-04-07 20:19:29 +00:00
|
|
|
} ISAPNP_DEVICE_STATE;
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2020-03-21 22:08:00 +00:00
|
|
|
typedef struct _ISAPNP_IO {
|
|
|
|
USHORT CurrentBase;
|
|
|
|
ISAPNP_IO_DESCRIPTION Description;
|
|
|
|
} ISAPNP_IO, PISAPNP_IO;
|
|
|
|
|
|
|
|
typedef struct _ISAPNP_IRQ {
|
|
|
|
UCHAR CurrentNo;
|
|
|
|
UCHAR CurrentType;
|
|
|
|
ISAPNP_IRQ_DESCRIPTION Description;
|
|
|
|
} ISAPNP_IRQ, *PISAPNP_IRQ;
|
|
|
|
|
2020-03-22 22:23:04 +00:00
|
|
|
typedef struct _ISAPNP_DMA {
|
|
|
|
UCHAR CurrentChannel;
|
|
|
|
ISAPNP_DMA_DESCRIPTION Description;
|
|
|
|
} ISAPNP_DMA, *PISAPNP_DMA;
|
|
|
|
|
2020-03-12 10:53:09 +00:00
|
|
|
typedef struct _ISAPNP_LOGICAL_DEVICE {
|
2020-03-20 18:19:30 +00:00
|
|
|
PDEVICE_OBJECT Pdo;
|
2020-03-21 22:08:00 +00:00
|
|
|
ISAPNP_LOGDEVID LogDevId;
|
2020-03-20 18:19:30 +00:00
|
|
|
UCHAR VendorId[3];
|
|
|
|
USHORT ProdId;
|
|
|
|
ULONG SerialNumber;
|
2020-03-21 22:08:00 +00:00
|
|
|
ISAPNP_IO Io[8];
|
|
|
|
ISAPNP_IRQ Irq[2];
|
2020-03-22 22:23:04 +00:00
|
|
|
ISAPNP_DMA Dma[2];
|
2020-03-20 18:19:30 +00:00
|
|
|
UCHAR CSN;
|
|
|
|
UCHAR LDN;
|
|
|
|
LIST_ENTRY ListEntry;
|
2020-03-12 10:53:09 +00:00
|
|
|
} ISAPNP_LOGICAL_DEVICE, *PISAPNP_LOGICAL_DEVICE;
|
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
typedef struct _ISAPNP_COMMON_EXTENSION {
|
2020-03-20 18:19:30 +00:00
|
|
|
PDEVICE_OBJECT Self;
|
|
|
|
BOOLEAN IsFdo;
|
|
|
|
ISAPNP_DEVICE_STATE State;
|
2010-04-07 20:19:29 +00:00
|
|
|
} ISAPNP_COMMON_EXTENSION, *PISAPNP_COMMON_EXTENSION;
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
typedef struct _ISAPNP_FDO_EXTENSION {
|
2020-03-20 18:19:30 +00:00
|
|
|
ISAPNP_COMMON_EXTENSION Common;
|
|
|
|
PDEVICE_OBJECT Ldo;
|
|
|
|
PDEVICE_OBJECT Pdo;
|
2020-03-16 18:24:07 +00:00
|
|
|
PDEVICE_OBJECT DataPortPdo;
|
2020-03-20 18:19:30 +00:00
|
|
|
LIST_ENTRY DeviceListHead;
|
|
|
|
ULONG DeviceCount;
|
|
|
|
PDRIVER_OBJECT DriverObject;
|
|
|
|
PUCHAR ReadDataPort;
|
|
|
|
KSPIN_LOCK Lock;
|
2010-04-07 20:19:29 +00:00
|
|
|
} ISAPNP_FDO_EXTENSION, *PISAPNP_FDO_EXTENSION;
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2020-03-12 10:53:09 +00:00
|
|
|
typedef struct _ISAPNP_PDO_EXTENSION {
|
2020-03-20 18:19:30 +00:00
|
|
|
ISAPNP_COMMON_EXTENSION Common;
|
|
|
|
PISAPNP_LOGICAL_DEVICE IsaPnpDevice;
|
2020-03-16 18:43:37 +00:00
|
|
|
PISAPNP_FDO_EXTENSION FdoExt;
|
2020-03-16 18:00:00 +00:00
|
|
|
UNICODE_STRING DeviceID;
|
|
|
|
UNICODE_STRING HardwareIDs;
|
2020-03-21 13:58:36 +00:00
|
|
|
UNICODE_STRING CompatibleIDs;
|
2020-03-16 18:00:00 +00:00
|
|
|
UNICODE_STRING InstanceID;
|
2020-03-21 15:58:21 +00:00
|
|
|
PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList;
|
2020-03-21 16:37:45 +00:00
|
|
|
PCM_RESOURCE_LIST ResourceList;
|
|
|
|
ULONG ResourceListSize;
|
2020-03-12 10:53:09 +00:00
|
|
|
} ISAPNP_PDO_EXTENSION, *PISAPNP_PDO_EXTENSION;
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
/* isapnp.c */
|
2013-05-09 14:06:21 +00:00
|
|
|
|
2020-03-16 18:00:00 +00:00
|
|
|
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
|
|
|
|
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaPnpDuplicateUnicodeString(
|
|
|
|
IN ULONG Flags,
|
|
|
|
IN PCUNICODE_STRING SourceString,
|
|
|
|
OUT PUNICODE_STRING DestinationString);
|
|
|
|
|
2020-03-16 17:07:24 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaPnpFillDeviceRelations(
|
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt,
|
2020-03-16 18:24:07 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN BOOLEAN IncludeDataPort);
|
2020-03-16 17:07:24 +00:00
|
|
|
|
2013-05-09 14:06:21 +00:00
|
|
|
DRIVER_INITIALIZE DriverEntry;
|
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DriverEntry(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PUNICODE_STRING RegistryPath);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaForwardIrpSynchronous(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt,
|
|
|
|
IN PIRP Irp);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
/* fdo.c */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaFdoPnp(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IrpSp);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
/* pdo.c */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaPdoPnp(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_PDO_EXTENSION PdoDeviceExtension,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IrpSp);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
/* hardware.c */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2020-03-16 19:58:53 +00:00
|
|
|
IsaHwTryReadDataPort(
|
|
|
|
IN PUCHAR ReadDataPort);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaHwFillDeviceList(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaHwDeactivateDevice(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_LOGICAL_DEVICE LogicalDevice);
|
2001-05-01 23:00:05 +00:00
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
NTSTATUS
|
2008-11-30 11:16:55 +00:00
|
|
|
NTAPI
|
2010-04-07 20:19:29 +00:00
|
|
|
IsaHwActivateDevice(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_LOGICAL_DEVICE LogicalDevice);
|
2005-10-06 21:39:18 +00:00
|
|
|
|
2001-05-01 23:00:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2014-02-06 11:18:34 +00:00
|
|
|
|
|
|
|
#endif /* _ISAPNP_PCH_ */
|