Implement InterfacePciDevicePresent(Ex) of PCI_DEVICE_PRESENT_INTERFACE
[reactos.git] / reactos / drivers / bus / pci / pci.c
index 432711f..34d0cbd 100644 (file)
@@ -29,6 +29,7 @@
 
 /*** PUBLIC ******************************************************************/
 
 
 /*** PUBLIC ******************************************************************/
 
+PPCI_DRIVER_EXTENSION DriverExtension = NULL;
 
 /*** PRIVATE *****************************************************************/
 
 
 /*** PRIVATE *****************************************************************/
 
@@ -173,6 +174,8 @@ DriverEntry(
   IN PDRIVER_OBJECT DriverObject,
   IN PUNICODE_STRING RegistryPath)
 {
   IN PDRIVER_OBJECT DriverObject,
   IN PUNICODE_STRING RegistryPath)
 {
+  NTSTATUS Status;
+
   DPRINT("Peripheral Component Interconnect Bus Driver\n");
 
   DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PciDispatchDeviceControl;
   DPRINT("Peripheral Component Interconnect Bus Driver\n");
 
   DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PciDispatchDeviceControl;
@@ -180,6 +183,18 @@ DriverEntry(
   DriverObject->MajorFunction[IRP_MJ_POWER] = PciPowerControl;
   DriverObject->DriverExtension->AddDevice = PciAddDevice;
 
   DriverObject->MajorFunction[IRP_MJ_POWER] = PciPowerControl;
   DriverObject->DriverExtension->AddDevice = PciAddDevice;
 
+  Status = IoAllocateDriverObjectExtension(
+    DriverObject,
+    DriverObject,
+    sizeof(PCI_DRIVER_EXTENSION),
+    (PVOID*)&DriverExtension);
+  if (!NT_SUCCESS(Status))
+    return Status;
+  RtlZeroMemory(DriverExtension, sizeof(PCI_DRIVER_EXTENSION));
+
+  InitializeListHead(&DriverExtension->BusListHead);
+  KeInitializeSpinLock(&DriverExtension->BusListLock);
+
   return STATUS_SUCCESS;
 }
 
   return STATUS_SUCCESS;
 }