mirror of
https://github.com/reactos/reactos.git
synced 2024-06-01 10:11:43 +00:00
[VIDEOPRT] Query children only when device has been opened
HwGetVideoChildDescriptor callback must be called only after HwInitialize. CORE-17979
This commit is contained in:
parent
983d9a1c2a
commit
2538583dbe
|
@ -407,6 +407,9 @@ IntVideoPortDispatchOpen(
|
|||
{
|
||||
Status = STATUS_SUCCESS;
|
||||
InterlockedIncrement((PLONG)&DeviceExtension->DeviceOpened);
|
||||
|
||||
/* Query children, now that device is opened */
|
||||
VideoPortEnumerateChildren(DeviceExtension->MiniPortDeviceExtension, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -938,6 +941,18 @@ IntVideoPortQueryBusRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
PVIDEO_PORT_CHILD_EXTENSION ChildExtension;
|
||||
ULONG i;
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (InterlockedCompareExchange((PLONG)&DeviceExtension->DeviceOpened, 0, 0) == 0)
|
||||
{
|
||||
/* Device not opened. Don't enumerate children yet */
|
||||
WARN_(VIDEOPRT, "Skipping child enumeration because device is not opened");
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
/* Query children of the device. */
|
||||
Status = IntVideoPortEnumerateChildren(DeviceObject, Irp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
/* Count the children */
|
||||
i = 0;
|
||||
|
|
|
@ -474,9 +474,6 @@ IntVideoPortFindAdapter(
|
|||
&HwResetAdaptersLock);
|
||||
}
|
||||
|
||||
/* Query children of the device. */
|
||||
VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL);
|
||||
|
||||
INFO_(VIDEOPRT, "STATUS_SUCCESS\n");
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
|
@ -1170,11 +1167,10 @@ VideoPortSynchronizeExecution(
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VP_STATUS
|
||||
NTAPI
|
||||
VideoPortEnumerateChildren(
|
||||
IN PVOID HwDeviceExtension,
|
||||
IN PVOID Reserved)
|
||||
NTSTATUS NTAPI
|
||||
IntVideoPortEnumerateChildren(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
ULONG Status;
|
||||
|
@ -1187,17 +1183,17 @@ VideoPortEnumerateChildren(
|
|||
PVIDEO_PORT_CHILD_EXTENSION ChildExtension;
|
||||
|
||||
INFO_(VIDEOPRT, "Starting child device probe\n");
|
||||
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
||||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
if (DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor == NULL)
|
||||
{
|
||||
WARN_(VIDEOPRT, "Miniport's HwGetVideoChildDescriptor is NULL!\n");
|
||||
return NO_ERROR;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (!IsListEmpty(&DeviceExtension->ChildDeviceList))
|
||||
{
|
||||
ERR_(VIDEOPRT, "FIXME: Support calling VideoPortEnumerateChildren again!\n");
|
||||
return NO_ERROR;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Enumerate the children */
|
||||
|
@ -1239,7 +1235,7 @@ VideoPortEnumerateChildren(
|
|||
|
||||
INFO_(VIDEOPRT, "Probing child: %d\n", ChildEnumInfo.ChildIndex);
|
||||
Status = DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor(
|
||||
HwDeviceExtension,
|
||||
DeviceExtension->MiniPortDeviceExtension,
|
||||
&ChildEnumInfo,
|
||||
&ChildExtension->ChildType,
|
||||
ChildExtension->ChildDescriptor,
|
||||
|
@ -1331,8 +1327,25 @@ VideoPortEnumerateChildren(
|
|||
&ChildExtension->ListEntry);
|
||||
}
|
||||
|
||||
/* Trigger reenumeration by the PnP manager */
|
||||
IoInvalidateDeviceRelations(DeviceExtension->PhysicalDeviceObject, BusRelations);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
VP_STATUS
|
||||
NTAPI
|
||||
VideoPortEnumerateChildren(
|
||||
IN PVOID HwDeviceExtension,
|
||||
IN PVOID Reserved)
|
||||
{
|
||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
|
||||
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
||||
ASSERT(DeviceExtension);
|
||||
|
||||
if (DeviceExtension->PhysicalDeviceObject)
|
||||
{
|
||||
/* Trigger reenumeration by the PnP manager */
|
||||
IoInvalidateDeviceRelations(DeviceExtension->PhysicalDeviceObject, BusRelations);
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
|
|
@ -279,6 +279,11 @@ IntVideoPortGetProcAddress(
|
|||
IN PVOID HwDeviceExtension,
|
||||
IN PUCHAR FunctionName);
|
||||
|
||||
NTSTATUS NTAPI
|
||||
IntVideoPortEnumerateChildren(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
/* int10.c */
|
||||
|
||||
NTSTATUS
|
||||
|
|
Loading…
Reference in a new issue