https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9400063aae0bd68858f70…
commit 9400063aae0bd68858f7002385fe68238ba8a37e
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Mar 20 18:12:11 2022 +0100
Commit: hpoussin <32227662+hpoussin(a)users.noreply.github.com>
CommitDate: Fri Apr 15 23:09:16 2022 +0200
[WIN32SS] Enable multidisplay driver when required
For now, it is only a stub which returns an error.
---
win32ss/CMakeLists.txt | 1 +
win32ss/gdi/eng/multidisp.c | 24 ++++++++++++++++++++++++
win32ss/gdi/eng/pdevobj.c | 24 +++++++++++++++++++-----
3 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/win32ss/CMakeLists.txt b/win32ss/CMakeLists.txt
index a786921291c..a5efa7f9f16 100644
--- a/win32ss/CMakeLists.txt
+++ b/win32ss/CMakeLists.txt
@@ -77,6 +77,7 @@ list(APPEND SOURCE
gdi/eng/mem.c
gdi/eng/engmisc.c
gdi/eng/mouse.c
+ gdi/eng/multidisp.c
gdi/eng/paint.c
gdi/eng/pathobj.c
gdi/eng/pdevobj.c
diff --git a/win32ss/gdi/eng/multidisp.c b/win32ss/gdi/eng/multidisp.c
new file mode 100644
index 00000000000..e815e19939d
--- /dev/null
+++ b/win32ss/gdi/eng/multidisp.c
@@ -0,0 +1,24 @@
+/*
+* PROJECT: ReactOS Win32k subsystem
+* LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+* FILE: win32ss/gdi/eng/multidisp.c
+* PURPOSE: Multi-Display driver
+* PROGRAMMERS:
+*/
+
+/* INCLUDES *******************************************************************/
+
+#include <win32k.h>
+#define NDEBUG
+#include <debug.h>
+
+BOOL
+APIENTRY
+MultiEnableDriver(
+ _In_ ULONG iEngineVersion,
+ _In_ ULONG cj,
+ _Inout_bytecount_(cj) PDRVENABLEDATA pded)
+{
+ UNIMPLEMENTED;
+ return FALSE;
+}
diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c
index f39afd18530..41c5045ef2c 100644
--- a/win32ss/gdi/eng/pdevobj.c
+++ b/win32ss/gdi/eng/pdevobj.c
@@ -14,6 +14,13 @@ DBG_DEFAULT_CHANNEL(EngPDev);
static PPDEVOBJ gppdevList = NULL;
static HSEMAPHORE ghsemPDEV;
+BOOL
+APIENTRY
+MultiEnableDriver(
+ _In_ ULONG iEngineVersion,
+ _In_ ULONG cj,
+ _Inout_bytecount_(cj) PDRVENABLEDATA pded);
+
CODE_SEG("INIT")
NTSTATUS
NTAPI
@@ -456,7 +463,10 @@ PDEVOBJ_Create(
}
/* Try to get a display driver */
- pldev = LDEVOBJ_pLoadDriver(pdm->dmDeviceName, ldevtype);
+ if (ldevtype == LDEV_DEVICE_META)
+ pldev = LDEVOBJ_pLoadInternal(MultiEnableDriver, ldevtype);
+ else
+ pldev = LDEVOBJ_pLoadDriver(pdm->dmDeviceName, ldevtype);
if (!pldev)
{
ERR("Could not load display driver '%S'\n",
@@ -877,10 +887,14 @@ PDEVOBJ_lChangeDisplaySettings(
}
else
{
- /* FIXME: currently, only use the first display */
- UNIMPLEMENTED;
- PDEVOBJ_vReference(pmdev->dev[0].ppdev);
- pmdev->ppdevGlobal = pmdev->dev[0].ppdev;
+ /* Enable MultiDriver */
+ pmdev->ppdevGlobal = PDEVOBJ_Create(NULL, (PDEVMODEW)pmdev, 0,
LDEV_DEVICE_META);
+ if (!pmdev->ppdevGlobal)
+ {
+ WARN("Failed to create meta-device. Using only first
display\n");
+ PDEVOBJ_vReference(pmdev->dev[0].ppdev);
+ pmdev->ppdevGlobal = pmdev->dev[0].ppdev;
+ }
}
if (pmdevOld)