11 typedef struct _PCI_DEVICE
13 // Entry on device list
15 // Physical Device Object of device
20 PCI_SLOT_NUMBER SlotNumber
;
21 // PCI configuration data
22 PCI_COMMON_CONFIG PciConfig
;
23 // Flag used during enumeration to locate removed devices
24 BOOLEAN RemovePending
;
25 } PCI_DEVICE
, *PPCI_DEVICE
;
37 typedef struct _COMMON_DEVICE_EXTENSION
39 // Pointer to device object, this device extension is associated with
40 PDEVICE_OBJECT DeviceObject
;
41 // Wether this device extension is for an FDO or PDO
43 // Wether the device is removed
45 // Current device power state for the device
46 DEVICE_POWER_STATE DevicePowerState
;
47 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
49 /* Physical Device Object device extension for a child device */
50 typedef struct _PDO_DEVICE_EXTENSION
53 COMMON_DEVICE_EXTENSION Common
;
54 // Functional device object
56 // Pointer to PCI Device informations
57 PPCI_DEVICE PciDevice
;
59 UNICODE_STRING DeviceID
;
61 UNICODE_STRING InstanceID
;
63 UNICODE_STRING HardwareIDs
;
65 UNICODE_STRING CompatibleIDs
;
66 // Textual description of device
67 UNICODE_STRING DeviceDescription
;
68 // Textual description of device location
69 UNICODE_STRING DeviceLocation
;
70 // Number of interfaces references
72 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
74 /* Functional Device Object device extension for the PCI driver device object */
75 typedef struct _FDO_DEVICE_EXTENSION
78 COMMON_DEVICE_EXTENSION Common
;
79 // Entry on device list
81 // PCI bus number serviced by this FDO
83 // Current state of the driver
84 PCI_DEVICE_STATE State
;
85 // Namespace device list
86 LIST_ENTRY DeviceListHead
;
87 // Number of (not removed) devices in device list
88 ULONG DeviceListCount
;
89 // Lock for namespace device list
90 KSPIN_LOCK DeviceListLock
;
91 // Lower device object
93 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
96 /* Driver extension associated with PCI driver */
97 typedef struct _PCI_DRIVER_EXTENSION
100 LIST_ENTRY BusListHead
;
101 // Lock for namespace bus list
102 KSPIN_LOCK BusListLock
;
103 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
106 /* We need a global variable to get the driver extension,
107 * because at least InterfacePciDevicePresent has no
108 * other way to get it... */
109 extern PPCI_DRIVER_EXTENSION DriverExtension
;
115 PDEVICE_OBJECT DeviceObject
,
120 PDEVICE_OBJECT DeviceObject
,
126 PciCreateDeviceIDString(
127 PUNICODE_STRING DeviceID
,
131 PciCreateInstanceIDString(
132 PUNICODE_STRING InstanceID
,
136 PciCreateHardwareIDsString(
137 PUNICODE_STRING HardwareIDs
,
141 PciCreateCompatibleIDsString(
142 PUNICODE_STRING HardwareIDs
,
146 PciCreateDeviceDescriptionString(
147 PUNICODE_STRING DeviceDescription
,
151 PciCreateDeviceLocationString(
152 PUNICODE_STRING DeviceLocation
,
156 PciDuplicateUnicodeString(
158 IN PCUNICODE_STRING SourceString
,
159 OUT PUNICODE_STRING DestinationString
);
165 PDEVICE_OBJECT DeviceObject
,
170 PDEVICE_OBJECT DeviceObject
,
176 IN PDRIVER_OBJECT DriverObject
,
177 IN PUNICODE_STRING RegistryPath
);