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 // Enable memory space
21 BOOLEAN EnableMemorySpace
;
23 BOOLEAN EnableIoSpace
;
25 BOOLEAN EnableBusMaster
;
26 } PCI_DEVICE
, *PPCI_DEVICE
;
38 typedef struct _COMMON_DEVICE_EXTENSION
40 // Pointer to device object, this device extension is associated with
41 PDEVICE_OBJECT DeviceObject
;
42 // Wether this device extension is for an FDO or PDO
44 // Wether the device is removed
46 // Current device power state for the device
47 DEVICE_POWER_STATE DevicePowerState
;
48 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
50 /* Physical Device Object device extension for a child device */
51 typedef struct _PDO_DEVICE_EXTENSION
54 COMMON_DEVICE_EXTENSION Common
;
55 // Functional device object
57 // Pointer to PCI Device informations
58 PPCI_DEVICE PciDevice
;
60 UNICODE_STRING DeviceID
;
62 UNICODE_STRING InstanceID
;
64 UNICODE_STRING HardwareIDs
;
66 UNICODE_STRING CompatibleIDs
;
67 // Textual description of device
68 UNICODE_STRING DeviceDescription
;
69 // Textual description of device location
70 UNICODE_STRING DeviceLocation
;
71 // Number of interfaces references
73 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
75 /* Functional Device Object device extension for the PCI driver device object */
76 typedef struct _FDO_DEVICE_EXTENSION
79 COMMON_DEVICE_EXTENSION Common
;
80 // Entry on device list
82 // PCI bus number serviced by this FDO
84 // Current state of the driver
85 PCI_DEVICE_STATE State
;
86 // Namespace device list
87 LIST_ENTRY DeviceListHead
;
88 // Number of (not removed) devices in device list
89 ULONG DeviceListCount
;
90 // Lock for namespace device list
91 KSPIN_LOCK DeviceListLock
;
92 // Lower device object
94 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
97 /* Driver extension associated with PCI driver */
98 typedef struct _PCI_DRIVER_EXTENSION
101 LIST_ENTRY BusListHead
;
102 // Lock for namespace bus list
103 KSPIN_LOCK BusListLock
;
104 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
107 /* We need a global variable to get the driver extension,
108 * because at least InterfacePciDevicePresent has no
109 * other way to get it... */
110 extern PPCI_DRIVER_EXTENSION DriverExtension
;
116 PDEVICE_OBJECT DeviceObject
,
121 PDEVICE_OBJECT DeviceObject
,
127 PciCreateDeviceIDString(
128 PUNICODE_STRING DeviceID
,
132 PciCreateInstanceIDString(
133 PUNICODE_STRING InstanceID
,
137 PciCreateHardwareIDsString(
138 PUNICODE_STRING HardwareIDs
,
142 PciCreateCompatibleIDsString(
143 PUNICODE_STRING HardwareIDs
,
147 PciCreateDeviceDescriptionString(
148 PUNICODE_STRING DeviceDescription
,
152 PciCreateDeviceLocationString(
153 PUNICODE_STRING DeviceLocation
,
157 PciDuplicateUnicodeString(
159 IN PCUNICODE_STRING SourceString
,
160 OUT PUNICODE_STRING DestinationString
);
166 PDEVICE_OBJECT DeviceObject
,
171 PDEVICE_OBJECT DeviceObject
,
177 IN PDRIVER_OBJECT DriverObject
,
178 IN PUNICODE_STRING RegistryPath
);