Sync with trunk r58740.
[reactos.git] / drivers / bus / pcix / init.c
index 07f226a..58f1328 100644 (file)
@@ -641,6 +641,7 @@ PciBuildHackTable(IN HANDLE KeyHandle)
             Entry->HackFlags = HackFlags;
 
             /* Print out for the debugger's sake */
+#ifdef HACK_DEBUG
             DPRINT1("Adding Hack entry for Vendor:0x%04x Device:0x%04x ",
                     Entry->VendorID, Entry->DeviceID);
             if (Entry->Flags & PCI_HACK_HAS_SUBSYSTEM_INFO)
@@ -649,6 +650,7 @@ PciBuildHackTable(IN HANDLE KeyHandle)
             if (Entry->Flags & PCI_HACK_HAS_REVISION_INFO)
                 DbgPrint("Revision:0x%02x", Entry->RevisionID);
             DbgPrint(" = 0x%I64x\n", Entry->HackFlags);
+#endif
         }
 
         /* Bail out in case of failure */
@@ -676,8 +678,7 @@ NTAPI
 PciGetDebugPorts(IN HANDLE DebugKey)
 {
     /* This function is not yet implemented */
-    UNIMPLEMENTED;
-    while (TRUE);
+    UNIMPLEMENTED_DBGBREAK();
     return STATUS_SUCCESS;
 }
 
@@ -686,9 +687,7 @@ NTAPI
 PciDriverUnload(IN PDRIVER_OBJECT DriverObject)
 {
     /* This function is not yet implemented */
-    DPRINT1("PCI: Unload\n");
-    UNIMPLEMENTED;
-    while (TRUE);
+    UNIMPLEMENTED_DBGBREAK("PCI: Unload\n");
 }
 
 NTSTATUS
@@ -705,6 +704,12 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
     UNICODE_STRING OptionString, PciLockString;
     NTSTATUS Status;
     DPRINT1("PCI: DriverEntry!\n");
+
+    /* Setup initial loop variables */
+    KeyHandle = NULL;
+    ParametersKey = NULL;
+    DebugKey = NULL;
+    ControlSetKey = NULL;
     do
     {
         /* Remember our object so we can get it to it later */
@@ -735,11 +740,11 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
                             KEY_QUERY_VALUE,
                             &ParametersKey,
                             &Status);
-        if (!Result) break;
+        //if (!Result) break;
 
         /* Build the list of all known PCI erratas */
         Status = PciBuildHackTable(ParametersKey);
-        if (!NT_SUCCESS(Status)) break;
+        //if (!NT_SUCCESS(Status)) break;
 
         /* Open the debug key, if it exists */
         Result = PciOpenKey(L"Debug",
@@ -760,12 +765,12 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
         KeInitializeEvent(&PciLegacyDescriptionLock, SynchronizationEvent, TRUE);
 
         /* Open the control set key */
-        Status = PciOpenKey(L"\\Registry\\Machine\\System\\CurrentControlSet",
+        Result = PciOpenKey(L"\\Registry\\Machine\\System\\CurrentControlSet",
                             NULL,
                             KEY_QUERY_VALUE,
                             &ControlSetKey,
                             &Status);
-        if (!NT_SUCCESS(Status)) break;
+        if (!Result) break;
 
         /* Read the command line */
         Status = PciGetRegistryValue(L"SystemStartOptions",
@@ -852,7 +857,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
         if (PciRunningDatacenter) DPRINT1("PCI running on datacenter build\n");
 
         /* Check if the system has an ACPI Hardware Watchdog Timer */
-        WdTable = PciGetAcpiTable(WDRT_SIGNATURE);
+        //WdTable = PciGetAcpiTable(WDRT_SIGNATURE);
         Status = STATUS_SUCCESS;
     } while (FALSE);