5 typedef struct _PCI_DEVICE
7 // Entry on device list
9 // Physical Device Object of device
14 PCI_SLOT_NUMBER SlotNumber
;
15 // PCI configuration data
16 PCI_COMMON_CONFIG PciConfig
;
17 // Flag used during enumeration to locate removed devices
18 BOOLEAN RemovePending
;
19 } PCI_DEVICE
, *PPCI_DEVICE
;
31 typedef struct _COMMON_DEVICE_EXTENSION
33 // Pointer to device object, this device extension is associated with
34 PDEVICE_OBJECT DeviceObject
;
35 // Wether this device extension is for an FDO or PDO
37 // Wether the device is removed
39 // Current device power state for the device
40 DEVICE_POWER_STATE DevicePowerState
;
41 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
43 /* Physical Device Object device extension for a child device */
44 typedef struct _PDO_DEVICE_EXTENSION
47 COMMON_DEVICE_EXTENSION Common
;
48 // Functional device object
50 // Pointer to PCI Device informations
51 PPCI_DEVICE PciDevice
;
53 UNICODE_STRING DeviceID
;
55 UNICODE_STRING InstanceID
;
57 UNICODE_STRING HardwareIDs
;
59 UNICODE_STRING CompatibleIDs
;
60 // Textual description of device
61 UNICODE_STRING DeviceDescription
;
62 // Textual description of device location
63 UNICODE_STRING DeviceLocation
;
64 // Number of interfaces references
66 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
68 /* Functional Device Object device extension for the PCI driver device object */
69 typedef struct _FDO_DEVICE_EXTENSION
72 COMMON_DEVICE_EXTENSION Common
;
73 // Entry on device list
75 // PCI bus number serviced by this FDO
77 // Current state of the driver
78 PCI_DEVICE_STATE State
;
79 // Namespace device list
80 LIST_ENTRY DeviceListHead
;
81 // Number of (not removed) devices in device list
82 ULONG DeviceListCount
;
83 // Lock for namespace device list
84 KSPIN_LOCK DeviceListLock
;
85 // Lower device object
87 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
90 /* Driver extension associated with PCI driver */
91 typedef struct _PCI_DRIVER_EXTENSION
94 LIST_ENTRY BusListHead
;
95 // Lock for namespace bus list
96 KSPIN_LOCK BusListLock
;
97 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
100 /* We need a global variable to get the driver extension,
101 * because at least InterfacePciDevicePresent has no
102 * other way to get it... */
103 extern PPCI_DRIVER_EXTENSION DriverExtension
;
109 PDEVICE_OBJECT DeviceObject
,
114 PDEVICE_OBJECT DeviceObject
,
120 PciCreateDeviceIDString(
121 PUNICODE_STRING DeviceID
,
125 PciCreateInstanceIDString(
126 PUNICODE_STRING InstanceID
,
130 PciCreateHardwareIDsString(
131 PUNICODE_STRING HardwareIDs
,
135 PciCreateCompatibleIDsString(
136 PUNICODE_STRING HardwareIDs
,
140 PciCreateDeviceDescriptionString(
141 PUNICODE_STRING DeviceDescription
,
145 PciCreateDeviceLocationString(
146 PUNICODE_STRING DeviceLocation
,
153 PDEVICE_OBJECT DeviceObject
,
158 PDEVICE_OBJECT DeviceObject
,
164 IN PDRIVER_OBJECT DriverObject
,
165 IN PUNICODE_STRING RegistryPath
);