Skip to content

Commit

Permalink
[NTOS:PNP] Fix resource conflict detection
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hpoussin committed Oct 14, 2021
1 parent ea8cbbd commit 49358f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ntoskrnl/io/pnpmgr/pnpreport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 3 additions & 1 deletion ntoskrnl/io/pnpmgr/pnpres.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -1332,6 +1332,7 @@ IopDetectResourceConflict(
if (!NT_SUCCESS(Status))
goto cleanup;

ChildKeyIndex2 = 0;
while (TRUE)
{
Status = ZwEnumerateKey(ChildKey2,
Expand Down Expand Up @@ -1382,6 +1383,7 @@ IopDetectResourceConflict(
if (!NT_SUCCESS(Status))
goto cleanup;

ChildKeyIndex3 = 0;
while (TRUE)
{
Status = ZwEnumerateValueKey(ChildKey3,
Expand Down

1 comment on commit 49358f3

@JoachimHenze
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attention: This commit did introduce/unhide the following ticket:
https://jira.reactos.org/browse/CORE-17879 'Setup hangs at start of 2nd stage graphical setup for a specific machine' and we don't know yet which commit fixed that later.

Please sign in to comment.