https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9b5b22a8c308483d0c88…
commit e9b5b22a8c308483d0c883a2d40189df433bacad
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Wed Jun 23 08:54:27 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Sat Jul 10 16:27:44 2021 +0200
[VIDEOPRT] Implement VideoPortCreateSecondaryDisplay
---
win32ss/drivers/videoprt/videoprt.c | 40 +++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c
index c8decdcc95d..e36e0ce6c7c 100644
--- a/win32ss/drivers/videoprt/videoprt.c
+++ b/win32ss/drivers/videoprt/videoprt.c
@@ -1350,8 +1350,44 @@ VideoPortCreateSecondaryDisplay(
IN OUT PVOID *SecondaryDeviceExtension,
IN ULONG Flag)
{
- UNIMPLEMENTED;
- return ERROR_DEV_NOT_EXIST;
+ PDEVICE_OBJECT DeviceObject;
+ PVIDEO_PORT_DEVICE_EXTENSION FirstDeviceExtension, DeviceExtension;
+ NTSTATUS Status;
+
+ ASSERT(SecondaryDeviceExtension);
+
+ if (Flag != 0)
+ {
+ UNIMPLEMENTED;
+ }
+
+ FirstDeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
+
+ if (FirstDeviceExtension->DisplayNumber != 0)
+ {
+ DPRINT1("Calling VideoPortCreateSecondaryDisplay for InstanceId
%lu\n",
+ FirstDeviceExtension->DisplayNumber);
+ }
+
+ Status =
IntVideoPortCreateAdapterDeviceObject(FirstDeviceExtension->DriverObject,
+
FirstDeviceExtension->DriverExtension,
+
FirstDeviceExtension->PhysicalDeviceObject,
+
FirstDeviceExtension->AdapterNumber,
+
FirstDeviceExtension->NumberOfSecondaryDisplays + 1,
+ &DeviceObject);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IntVideoPortCreateAdapterDeviceObject() failed with status
0x%08x\n", Status);
+ return ERROR_DEV_NOT_EXIST;
+ }
+
+ DeviceExtension = DeviceObject->DeviceExtension;
+
+ /* Increment secondary display count */
+ FirstDeviceExtension->NumberOfSecondaryDisplays++;
+
+ *SecondaryDeviceExtension = DeviceExtension->MiniPortDeviceExtension;
+ return NO_ERROR;
}
/*