14 typedef struct _PCI_DEVICE
16 // Entry on device list
18 // Physical Device Object of device
23 PCI_SLOT_NUMBER SlotNumber
;
24 // PCI configuration data
25 PCI_COMMON_CONFIG PciConfig
;
26 // Flag used during enumeration to locate removed devices
27 BOOLEAN RemovePending
;
28 } PCI_DEVICE
, *PPCI_DEVICE
;
40 typedef struct _COMMON_DEVICE_EXTENSION
42 // Pointer to device object, this device extension is associated with
43 PDEVICE_OBJECT DeviceObject
;
44 // Wether this device extension is for an FDO or PDO
46 // Wether the device is removed
48 // Current device power state for the device
49 DEVICE_POWER_STATE DevicePowerState
;
50 } __attribute((packed
)) COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
52 /* Physical Device Object device extension for a child device */
53 typedef struct _PDO_DEVICE_EXTENSION
56 COMMON_DEVICE_EXTENSION Common
;
57 // Functional device object
62 PCI_SLOT_NUMBER SlotNumber
;
64 UNICODE_STRING DeviceID
;
66 UNICODE_STRING InstanceID
;
68 UNICODE_STRING HardwareIDs
;
70 UNICODE_STRING CompatibleIDs
;
71 // Textual description of device
72 UNICODE_STRING DeviceDescription
;
73 // Textual description of device location
74 UNICODE_STRING DeviceLocation
;
75 } __attribute((packed
)) PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
77 /* Functional Device Object device extension for the PCI driver device object */
78 typedef struct _FDO_DEVICE_EXTENSION
81 COMMON_DEVICE_EXTENSION Common
;
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 } __attribute((packed
)) FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
99 PDEVICE_OBJECT DeviceObject
,
104 PDEVICE_OBJECT DeviceObject
,
110 PciCreateUnicodeString(
111 PUNICODE_STRING Destination
,
116 PciDuplicateUnicodeString(
117 PUNICODE_STRING Destination
,
118 PUNICODE_STRING Source
,
122 PciCreateDeviceIDString(
123 PUNICODE_STRING DeviceID
,
127 PciCreateInstanceIDString(
128 PUNICODE_STRING InstanceID
,
132 PciCreateHardwareIDsString(
133 PUNICODE_STRING HardwareIDs
,
137 PciCreateCompatibleIDsString(
138 PUNICODE_STRING HardwareIDs
,
142 PciCreateDeviceDescriptionString(
143 PUNICODE_STRING DeviceDescription
,
147 PciCreateDeviceLocationString(
148 PUNICODE_STRING DeviceLocation
,
155 PDEVICE_OBJECT DeviceObject
,
160 PDEVICE_OBJECT DeviceObject
,