https://git.reactos.org/?p=reactos.git;a=commitdiff;h=49358f34160e75623690d…
commit 49358f34160e75623690d1b7fdc4138a4d2391c0
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Thu Oct 7 21:45:10 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu Oct 14 23:39:31 2021 +0200
[NTOS:PNP] Fix resource conflict detection
Only resources of HAL were checked against conflicts, not those of PnP Manager
Let IoReportResourceForDetection() make a silent conflict check.
Otherwise IopCheckResourceDescriptor() will always return 'no conflict'.
CORE-17789
---
ntoskrnl/io/pnpmgr/pnpreport.c | 2 +-
ntoskrnl/io/pnpmgr/pnpres.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/io/pnpmgr/pnpreport.c b/ntoskrnl/io/pnpmgr/pnpreport.c
index 65e256075da..3357925ec65 100644
--- a/ntoskrnl/io/pnpmgr/pnpreport.c
+++ b/ntoskrnl/io/pnpmgr/pnpreport.c
@@ -376,7 +376,7 @@ IoReportResourceForDetection(IN PDRIVER_OBJECT DriverObject,
ResourceList = DriverList;
/* Look for a resource conflict */
- Status = IopDetectResourceConflict(ResourceList, FALSE, NULL);
+ Status = IopDetectResourceConflict(ResourceList, TRUE, NULL);
if (Status == STATUS_CONFLICTING_ADDRESSES)
{
/* Oh noes */
diff --git a/ntoskrnl/io/pnpmgr/pnpres.c b/ntoskrnl/io/pnpmgr/pnpres.c
index 57eabfe69c2..982ffe2afed 100644
--- a/ntoskrnl/io/pnpmgr/pnpres.c
+++ b/ntoskrnl/io/pnpmgr/pnpres.c
@@ -1264,7 +1264,7 @@ IopDetectResourceConflict(
PKEY_BASIC_INFORMATION KeyInformation;
PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation;
PKEY_VALUE_BASIC_INFORMATION KeyNameInformation;
- ULONG ChildKeyIndex1 = 0, ChildKeyIndex2 = 0, ChildKeyIndex3 = 0;
+ ULONG ChildKeyIndex1 = 0, ChildKeyIndex2, ChildKeyIndex3;
NTSTATUS Status;
RtlInitUnicodeString(&KeyName,
L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP");
@@ -1332,6 +1332,7 @@ IopDetectResourceConflict(
if (!NT_SUCCESS(Status))
goto cleanup;
+ ChildKeyIndex2 = 0;
while (TRUE)
{
Status = ZwEnumerateKey(ChildKey2,
@@ -1382,6 +1383,7 @@ IopDetectResourceConflict(
if (!NT_SUCCESS(Status))
goto cleanup;
+ ChildKeyIndex3 = 0;
while (TRUE)
{
Status = ZwEnumerateValueKey(ChildKey3,