10 typedef struct _PCI_DEVICE
12 // Entry on device list
14 // Physical Device Object of device
19 PCI_SLOT_NUMBER SlotNumber
;
20 // PCI configuration data
21 PCI_COMMON_CONFIG PciConfig
;
22 // Flag used during enumeration to locate removed devices
23 BOOLEAN RemovePending
;
24 } PCI_DEVICE
, *PPCI_DEVICE
;
36 typedef struct _COMMON_DEVICE_EXTENSION
38 // Pointer to device object, this device extension is associated with
39 PDEVICE_OBJECT DeviceObject
;
40 // Wether this device extension is for an FDO or PDO
42 // Wether the device is removed
44 // Current device power state for the device
45 DEVICE_POWER_STATE DevicePowerState
;
46 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
48 /* Physical Device Object device extension for a child device */
49 typedef struct _PDO_DEVICE_EXTENSION
52 COMMON_DEVICE_EXTENSION Common
;
53 // Functional device object
55 // Pointer to PCI Device informations
56 PPCI_DEVICE PciDevice
;
58 UNICODE_STRING DeviceID
;
60 UNICODE_STRING InstanceID
;
62 UNICODE_STRING HardwareIDs
;
64 UNICODE_STRING CompatibleIDs
;
65 // Textual description of device
66 UNICODE_STRING DeviceDescription
;
67 // Textual description of device location
68 UNICODE_STRING DeviceLocation
;
69 // Number of interfaces references
71 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
73 /* Functional Device Object device extension for the PCI driver device object */
74 typedef struct _FDO_DEVICE_EXTENSION
77 COMMON_DEVICE_EXTENSION Common
;
78 // Entry on device list
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
;
95 /* Driver extension associated with PCI driver */
96 typedef struct _PCI_DRIVER_EXTENSION
99 LIST_ENTRY BusListHead
;
100 // Lock for namespace bus list
101 KSPIN_LOCK BusListLock
;
102 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
105 /* We need a global variable to get the driver extension,
106 * because at least InterfacePciDevicePresent has no
107 * other way to get it... */
108 extern PPCI_DRIVER_EXTENSION DriverExtension
;
114 PDEVICE_OBJECT DeviceObject
,
119 PDEVICE_OBJECT DeviceObject
,
125 PciCreateDeviceIDString(
126 PUNICODE_STRING DeviceID
,
130 PciCreateInstanceIDString(
131 PUNICODE_STRING InstanceID
,
135 PciCreateHardwareIDsString(
136 PUNICODE_STRING HardwareIDs
,
140 PciCreateCompatibleIDsString(
141 PUNICODE_STRING HardwareIDs
,
145 PciCreateDeviceDescriptionString(
146 PUNICODE_STRING DeviceDescription
,
150 PciCreateDeviceLocationString(
151 PUNICODE_STRING DeviceLocation
,
155 PciDuplicateUnicodeString(
157 IN PCUNICODE_STRING SourceString
,
158 OUT PUNICODE_STRING DestinationString
);
164 PDEVICE_OBJECT DeviceObject
,
169 PDEVICE_OBJECT DeviceObject
,
175 IN PDRIVER_OBJECT DriverObject
,
176 IN PUNICODE_STRING RegistryPath
);