8 typedef struct _PCI_DEVICE
10 // Entry on device list
12 // Physical Device Object of device
17 PCI_SLOT_NUMBER SlotNumber
;
18 // PCI configuration data
19 PCI_COMMON_CONFIG PciConfig
;
20 // Flag used during enumeration to locate removed devices
21 BOOLEAN RemovePending
;
22 } PCI_DEVICE
, *PPCI_DEVICE
;
34 typedef struct _COMMON_DEVICE_EXTENSION
36 // Pointer to device object, this device extension is associated with
37 PDEVICE_OBJECT DeviceObject
;
38 // Wether this device extension is for an FDO or PDO
40 // Wether the device is removed
42 // Current device power state for the device
43 DEVICE_POWER_STATE DevicePowerState
;
44 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
46 /* Physical Device Object device extension for a child device */
47 typedef struct _PDO_DEVICE_EXTENSION
50 COMMON_DEVICE_EXTENSION Common
;
51 // Functional device object
53 // Pointer to PCI Device informations
54 PPCI_DEVICE PciDevice
;
56 UNICODE_STRING DeviceID
;
58 UNICODE_STRING InstanceID
;
60 UNICODE_STRING HardwareIDs
;
62 UNICODE_STRING CompatibleIDs
;
63 // Textual description of device
64 UNICODE_STRING DeviceDescription
;
65 // Textual description of device location
66 UNICODE_STRING DeviceLocation
;
67 // Number of interfaces references
69 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
71 /* Functional Device Object device extension for the PCI driver device object */
72 typedef struct _FDO_DEVICE_EXTENSION
75 COMMON_DEVICE_EXTENSION Common
;
76 // Entry on device list
78 // PCI bus number serviced by this FDO
80 // Current state of the driver
81 PCI_DEVICE_STATE State
;
82 // Namespace device list
83 LIST_ENTRY DeviceListHead
;
84 // Number of (not removed) devices in device list
85 ULONG DeviceListCount
;
86 // Lock for namespace device list
87 KSPIN_LOCK DeviceListLock
;
88 // Lower device object
90 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
93 /* Driver extension associated with PCI driver */
94 typedef struct _PCI_DRIVER_EXTENSION
97 LIST_ENTRY BusListHead
;
98 // Lock for namespace bus list
99 KSPIN_LOCK BusListLock
;
100 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
103 /* We need a global variable to get the driver extension,
104 * because at least InterfacePciDevicePresent has no
105 * other way to get it... */
106 extern PPCI_DRIVER_EXTENSION DriverExtension
;
112 PDEVICE_OBJECT DeviceObject
,
117 PDEVICE_OBJECT DeviceObject
,
123 PciCreateDeviceIDString(
124 PUNICODE_STRING DeviceID
,
128 PciCreateInstanceIDString(
129 PUNICODE_STRING InstanceID
,
133 PciCreateHardwareIDsString(
134 PUNICODE_STRING HardwareIDs
,
138 PciCreateCompatibleIDsString(
139 PUNICODE_STRING HardwareIDs
,
143 PciCreateDeviceDescriptionString(
144 PUNICODE_STRING DeviceDescription
,
148 PciCreateDeviceLocationString(
149 PUNICODE_STRING DeviceLocation
,
153 PciDuplicateUnicodeString(
155 IN PCUNICODE_STRING SourceString
,
156 OUT PUNICODE_STRING DestinationString
);
162 PDEVICE_OBJECT DeviceObject
,
167 PDEVICE_OBJECT DeviceObject
,
173 IN PDRIVER_OBJECT DriverObject
,
174 IN PUNICODE_STRING RegistryPath
);