Patches to allow Windows PCI Bus Driver to start working somewhat (need to implement...
authorSir Richard <sir_richard@svn.reactos.org>
Tue, 21 Sep 2010 05:34:05 +0000 (05:34 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Tue, 21 Sep 2010 05:34:05 +0000 (05:34 +0000)
[BOOTDATA]: Windows Bus Drivers/HAL/Kernel require Arbiter data in the registry placed by the installer, otherwise they will not load. Add this Arbiter data.
[NTOS]: Add support for KeyValueFullInformationAlign64, used by some Windows drivers (as a bonus, support Win64). PartialInformationAlign64 is a different beast -- warn when a driver attempts to use it, instead of silent failure.
[NTOS]: Export VfFailSystemBIOS and stub it.
[NTOS]: Warn when a driver fails to load due to a missing dependency and print the name and/or missing module, instead of silently failing.
[NTOS]: Due to a bug in the ReactOS PnP manager, Windows PCI Driver hits an internal pseudo-assert. Hack KeBugCheckEx to ignore this pseudo-assert and continue executing normally.

svn path=/trunk/; revision=48839

reactos/boot/bootdata/hivesys_i386.inf
reactos/include/ddk/wdm.h
reactos/ntoskrnl/config/cmvalche.c
reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/mm/ARM3/sysldr.c
reactos/ntoskrnl/ntoskrnl.pspec
reactos/ntoskrnl/vf/driver.c

index d1d5c39..2d7979f 100644 (file)
@@ -7,6 +7,98 @@ HKLM,"SYSTEM\CurrentControlSet\Control","CurrentUser",2,"USERNAME"
 HKLM,"SYSTEM\CurrentControlSet\Control","WaitToKillServiceTimeout",2,"20000"
 HKLM,"SYSTEM\CurrentControlSet\Control\Biosinfo","InfName",2,"biosinfo.inf"
 HKLM,"SYSTEM\CurrentControlSet\Control\PnP",,0x00000012
+HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters",,0x00000012
+
+HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters\AllocationOrder","Root",0x000a0001,\
+a8,04,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,01,00,00,00,01,00,01,00,24,00,00,00,00,01,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,05,00,00,00,00,00,00,ff,ff,00,00,00,00,00,\
+00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,40,01,00,00,00,00,00,00,\
+7f,01,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+02,00,00,00,00,00,00,ff,02,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,03,00,00,00,00,00,00,6f,03,00,00,00,00,00,00,08,01,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,78,03,00,00,00,00,00,00,7a,03,00,00,\
+00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,e8,02,00,00,00,\
+00,00,00,ff,02,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,f0,01,00,00,00,00,00,00,f8,01,00,00,00,00,00,00,08,01,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,b0,03,00,00,00,00,00,00,cf,03,00,00,00,00,00,00,\
+08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,e8,03,00,00,00,00,00,00,ff,\
+03,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,ce,01,\
+00,00,00,00,00,00,cf,01,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,01,00,00,00,00,00,00,ff,03,00,00,00,00,00,00,08,02,00,00,\
+00,00,00,00,09,00,00,00,09,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,08,02,00,00,00,00,00,00,08,00,00,00,08,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,08,02,00,00,00,00,00,00,07,00,00,00,07,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,02,00,00,00,00,00,00,\
+0b,00,00,00,0b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,\
+02,00,00,00,00,00,00,0a,00,00,00,0a,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,08,02,00,00,00,00,00,00,02,00,00,00,02,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,00,00,00,03,00,00,00,\
+03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,02,00,00,00,\
+00,00,00,05,00,00,00,05,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,08,02,00,00,00,00,00,00,04,00,00,00,04,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,08,02,00,00,00,00,00,00,0f,00,00,00,0f,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,02,00,00,00,00,00,00,0d,\
+00,00,00,0d,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,02,\
+00,00,00,00,00,00,0e,00,00,00,0e,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,08,02,00,00,00,00,00,00,06,00,00,00,06,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,08,02,00,00,00,00,00,00,0c,00,00,00,0c,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,02,00,00,00,00,\
+00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,08,02,00,00,00,00,00,00,00,00,ff,ff,fe,ff,ff,ff,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,08,02,00,00,00,00,00,00,10,00,00,00,ff,ff,fe,ff,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,10,00,00,00,00,00,ff,ff,ff,ff,ff,ff,ff,ff,08,03,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0f,00,00,00,00,00,ff,ff,0f,00,\
+00,00,00,00,08,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,00,00,\
+00,00,00,ff,ff,0b,00,00,00,00,00,08,03,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,08,00,00,00,00,00,ff,ff,0f,00,00,00,00,00,08,03,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,08,00,00,00,00,00,ff,ff,bf,ff,00,00,00,00,\
+00,04,00,00,00,00,00,00,06,00,00,00,0f,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,08,04,00,00,00,00,00,00,03,00,00,00,04,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,04,00,00,00,00,00,00,00,00,00,\
+00,0f,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
+
+HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters\AllocationOrder","Pci",0x000a0001,\
+48,02,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,01,00,00,00,01,00,01,00,11,00,00,00,00,01,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,ff,ff,ff,ff,00,00,00,00,\
+08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,05,00,00,00,00,00,00,ff,\
+ff,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,40,01,\
+00,00,00,00,00,00,7f,01,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,02,00,00,00,00,00,00,ff,02,00,00,00,00,00,00,08,01,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,00,6f,03,00,00,00,\
+00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,78,03,00,00,00,00,\
+00,00,7a,03,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,e8,02,00,00,00,00,00,00,ff,02,00,00,00,00,00,00,08,01,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,f0,01,00,00,00,00,00,00,f8,01,00,00,00,00,00,00,08,\
+01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,b0,03,00,00,00,00,00,00,cf,03,\
+00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,e8,03,00,\
+00,00,00,00,00,ff,03,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,ce,01,00,00,00,00,00,00,cf,01,00,00,00,00,00,00,08,01,00,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,ff,03,00,00,00,00,\
+00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,10,00,00,00,00,\
+00,ff,ff,ff,ff,ff,ff,ff,ff,08,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,0f,00,00,00,00,00,ff,ff,0f,00,00,00,00,00,08,03,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,08,00,00,00,00,00,ff,ff,0b,00,00,00,00,00,08,03,\
+00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,00,00,00,00,00,ff,ff,0f,\
+00,00,00,00,00,08,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08,00,\
+00,00,00,00,ff,ff,bf,ff,00,00,00,00
+
+HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters\ReservedResources","Pci",0x00000002, "PCStandard"
+HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters\ReservedResources","Root",0x00000002, "PCStandard"
+HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters\ReservedResources","PCStandard",0x000a0001,\
+08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,00,01,00,00,00,01,00,01,00,07,00,00,00,00,01,00,00,\
+00,00,00,00,00,00,00,00,00,00,00,00,f8,02,00,00,00,00,00,00,ff,02,00,00,00,\
+00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,b0,03,00,00,00,00,\
+00,00,bb,03,00,00,00,00,00,00,08,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+00,bc,03,00,00,00,00,00,00,be,03,00,00,00,00,00,00,08,01,00,00,00,00,00,00,\
+00,00,00,00,00,00,00,00,c0,03,00,00,00,00,00,00,df,03,00,00,00,00,00,00,08,\
+01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,f8,03,00,00,00,00,00,00,ff,03,\
+00,00,00,00,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0a,\
+00,00,00,00,00,ff,ff,0b,00,00,00,00,00,08,03,00,00,00,00,00,00,00,00,00,00,\
+00,00,00,00,00,00,f0,ff,00,00,00,00,ff,ff,ff,ff,00,00,00,00
 
 HKLM,"SYSTEM\CurrentControlSet\Control\FileSystem","NtfsDisable8dot3NameCreation",0x00010003,0
 HKLM,"SYSTEM\CurrentControlSet\Control\FileSystem","Win31FileSystem",0x00010001,0
index daffb9b..27dba86 100644 (file)
@@ -9773,7 +9773,7 @@ KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock)
 #endif
 
 NTKERNELAPI
-DECLSPEC_NORETURN
+//DECLSPEC_NORETURN
 VOID
 NTAPI
 KeBugCheckEx(
index 02bbbf9..8c8c361 100644 (file)
@@ -428,6 +428,7 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb,
 
         /* Full key information */
         case KeyValueFullInformation:
+        case KeyValueFullInformationAlign64:
 
             /* Check if this is a small key and compute key size */
             IsSmall = CmpIsKeyValueSmall(&KeySize,
@@ -447,9 +448,20 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb,
                 /* Calculate the data offset */
                 DataOffset = Size - KeySize;
 
-                /* Align the offset to 4 bytes */
-                AlignedData = ALIGN_UP(DataOffset, ULONG);
-
+#ifdef _WIN64
+                /* On 64-bit, always align to 8 bytes */
+                AlignedData = ALIGN_UP(DataOffset, ULONGLONG);
+#else
+                /* On 32-bit, align the offset to 4 or 8 bytes */
+                if (KeyValueInformationClass == KeyValueFullInformationAlign64)
+                {
+                    AlignedData = ALIGN_UP(DataOffset, ULONGLONG);
+                }
+                else
+                {
+                    AlignedData = ALIGN_UP(DataOffset, ULONG);
+                }
+#endif
                 /* If alignment was required, we'll need more space */
                 if (AlignedData > DataOffset) Size += (AlignedData-DataOffset);
             }
@@ -656,6 +668,7 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb,
         default:
 
             /* We got some class that we don't support */
+            DPRINT1("Caller requested unknown class: %lx\n", KeyValueInformationClass);
             *Status = STATUS_INVALID_PARAMETER;
             break;
     }
index 56c61df..8559d9d 100644 (file)
@@ -1430,13 +1430,18 @@ KeBugCheckEx(IN ULONG BugCheckCode,
              IN ULONG_PTR BugCheckParameter3,
              IN ULONG_PTR BugCheckParameter4)
 {
-    /* Call the internal API */
-    KeBugCheckWithTf(BugCheckCode,
-                     BugCheckParameter1,
-                     BugCheckParameter2,
-                     BugCheckParameter3,
-                     BugCheckParameter4,
-                     NULL);
+    /* Workaround for Windows Server 2003 Checked PCI Driver issue */
+    if (!(BugCheckCode == PCI_BUS_DRIVER_INTERNAL) &&
+         (BugCheckParameter1 == 0xDEAD0010))
+    {
+        /* Call the internal API */
+        KeBugCheckWithTf(BugCheckCode,
+                         BugCheckParameter1,
+                         BugCheckParameter2,
+                         BugCheckParameter3,
+                         BugCheckParameter4,
+                         NULL);
+    }
 }
 
 /*
index 5c716ce..7990b82 100644 (file)
@@ -746,7 +746,11 @@ MiSnapThunk(IN PVOID DllBase,
             }
 
             /* Check if we couldn't find it */
-            if (High < Low) return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND;
+            if (High < Low)
+            {
+                DPRINT1("Warning: Driver failed to load, %s not found\n", NameImport->Name);
+                return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND;
+            }
 
             /* Otherwise, this is the ordinal */
             Ordinal = OrdinalTable[Mid];
@@ -1237,6 +1241,7 @@ CheckDllState:
             /* Cleanup and return */
             MiDereferenceImports(LoadedImports);
             if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
+            DPRINT1("Warning: Driver failed to load, %S not found\n", *MissingDriver);
             return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND;
         }
 
index b359d38..cc7415b 100644 (file)
 @ stdcall VerSetConditionMask(long long long long)
 @ cdecl VfFailDeviceNode(ptr long long long ptr ptr ptr)
 ;VfFailDriver
-;VfFailSystemBIOS
+@ cdecl VfFailSystemBIOS(long long long ptr ptr ptr)
 @ stdcall VfIsVerificationEnabled(long ptr)
 #ifndef __x86_64__
 @ stdcall WRITE_REGISTER_BUFFER_UCHAR(ptr ptr long)
index 8f9cc2b..cf7b61e 100644 (file)
@@ -43,4 +43,20 @@ VfFailDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject,
     UNIMPLEMENTED;
 }
 
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+VfFailSystemBIOS(IN ULONG BugCheckMajorCode,
+                 IN ULONG BugCheckMinorCode,
+                 IN VF_FAILURE_CLASS FailureClass,
+                 IN OUT PULONG AssertionControl,
+                 IN PSTR DebuggerMessageText,
+                 IN PSTR ParameterFormatString,
+                 ...)
+{
+    UNIMPLEMENTED;
+}
+
 /* EOF */