mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 04:13:33 +00:00
[NTOSKRNL]
- Partially implement IoAssignResources so that it creates a non-conflicting resource list from the requirements but it doesn't claim the resources for the device in the registry - Partially implement IoReportResourceUsage so that it checks the resource list for conflicts but doesn't claim the resources in the registry - Please test this revision with a variety of hardware and drivers because it activates several code paths in the PnP manager - If this causes problems, look for "Denying an attempt to claim resources currently in use by another device!" in the debug log and report the bug to me svn path=/trunk/; revision=49249
This commit is contained in:
@@ -841,7 +841,7 @@ IoGetConfigurationInformation(VOID)
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @halfplemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
IoReportResourceUsage(PUNICODE_STRING DriverClassName,
|
||||
@@ -876,13 +876,48 @@ IoReportResourceUsage(PUNICODE_STRING DriverClassName,
|
||||
* a conflict is detected with another driver.
|
||||
*/
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
*ConflictDetected = FALSE;
|
||||
return STATUS_SUCCESS;
|
||||
NTSTATUS Status;
|
||||
PCM_RESOURCE_LIST ResourceList;
|
||||
|
||||
DPRINT1("IoReportResourceUsage is halfplemented!\n");
|
||||
|
||||
if (!DriverList && !DeviceList)
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (DeviceList)
|
||||
ResourceList = DeviceList;
|
||||
else
|
||||
ResourceList = DriverList;
|
||||
|
||||
Status = IopDetectResourceConflict(ResourceList, FALSE, NULL);
|
||||
if (Status == STATUS_CONFLICTING_ADDRESSES)
|
||||
{
|
||||
*ConflictDetected = TRUE;
|
||||
|
||||
if (!OverrideConflict)
|
||||
{
|
||||
DPRINT1("Denying an attempt to claim resources currently in use by another device!\n");
|
||||
return STATUS_CONFLICTING_ADDRESSES;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Proceeding with conflicting resources\n");
|
||||
}
|
||||
}
|
||||
else if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* TODO: Claim resources in registry */
|
||||
|
||||
*ConflictDetected = FALSE;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @halfplemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
IoAssignResources(PUNICODE_STRING RegistryPath,
|
||||
@@ -892,8 +927,23 @@ IoAssignResources(PUNICODE_STRING RegistryPath,
|
||||
PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources,
|
||||
PCM_RESOURCE_LIST* AllocatedResources)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return(STATUS_NOT_IMPLEMENTED);
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT1("IoAssignResources is halfplemented!\n");
|
||||
|
||||
Status = IopCreateResourceListFromRequirements(RequestedResources,
|
||||
AllocatedResources);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
if (Status == STATUS_CONFLICTING_ADDRESSES)
|
||||
DPRINT1("Denying an attempt to claim resources currently in use by another device!\n");
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* TODO: Claim resources in registry */
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user