12 typedef struct _PCI_DEVICE
14 // Entry on device list
16 // Physical Device Object of device
21 PCI_SLOT_NUMBER SlotNumber
;
22 // PCI configuration data
23 PCI_COMMON_CONFIG PciConfig
;
24 // Flag used during enumeration to locate removed devices
25 BOOLEAN RemovePending
;
26 } PCI_DEVICE
, *PPCI_DEVICE
;
38 typedef struct _COMMON_DEVICE_EXTENSION
40 // Pointer to device object, this device extension is associated with
41 PDEVICE_OBJECT DeviceObject
;
42 // Wether this device extension is for an FDO or PDO
44 // Wether the device is removed
46 // Current device power state for the device
47 DEVICE_POWER_STATE DevicePowerState
;
48 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
50 /* Physical Device Object device extension for a child device */
51 typedef struct _PDO_DEVICE_EXTENSION
54 COMMON_DEVICE_EXTENSION Common
;
55 // Functional device object
57 // Pointer to PCI Device informations
58 PPCI_DEVICE PciDevice
;
60 UNICODE_STRING DeviceID
;
62 UNICODE_STRING InstanceID
;
64 UNICODE_STRING HardwareIDs
;
66 UNICODE_STRING CompatibleIDs
;
67 // Textual description of device
68 UNICODE_STRING DeviceDescription
;
69 // Textual description of device location
70 UNICODE_STRING DeviceLocation
;
71 // Number of interfaces references
73 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
75 /* Functional Device Object device extension for the PCI driver device object */
76 typedef struct _FDO_DEVICE_EXTENSION
79 COMMON_DEVICE_EXTENSION Common
;
80 // PCI bus number serviced by this FDO
82 // Current state of the driver
83 PCI_DEVICE_STATE State
;
84 // Namespace device list
85 LIST_ENTRY DeviceListHead
;
86 // Number of (not removed) devices in device list
87 ULONG DeviceListCount
;
88 // Lock for namespace device list
89 KSPIN_LOCK DeviceListLock
;
90 // Lower device object
92 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
99 PDEVICE_OBJECT DeviceObject
,
104 PDEVICE_OBJECT DeviceObject
,
110 PciCreateDeviceIDString(
111 PUNICODE_STRING DeviceID
,
115 PciCreateInstanceIDString(
116 PUNICODE_STRING InstanceID
,
120 PciCreateHardwareIDsString(
121 PUNICODE_STRING HardwareIDs
,
125 PciCreateCompatibleIDsString(
126 PUNICODE_STRING HardwareIDs
,
130 PciCreateDeviceDescriptionString(
131 PUNICODE_STRING DeviceDescription
,
135 PciCreateDeviceLocationString(
136 PUNICODE_STRING DeviceLocation
,
143 PDEVICE_OBJECT DeviceObject
,
148 PDEVICE_OBJECT DeviceObject
,
154 IN PDRIVER_OBJECT DriverObject
,
155 IN PUNICODE_STRING RegistryPath
);