mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
121 lines
4.7 KiB
Diff
121 lines
4.7 KiB
Diff
From 9229c4fe3078946d7f5fd976b4e2c9f0a5a8ccb1 Mon Sep 17 00:00:00 2001
|
|
From: Derek Lesho <dlesho@codeweavers.com>
|
|
Date: Fri, 10 Jan 2020 15:34:45 -0600
|
|
Subject: [PATCH] user32: Implement QueryDisplayConfig
|
|
|
|
---
|
|
dlls/user32/sysparams.c | 95 +++++++++++++++++++++++++++++++++--------
|
|
1 file changed, 77 insertions(+), 18 deletions(-)
|
|
|
|
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
|
|
index 7ebe8099419..6d673c68e8c 100644
|
|
--- a/dlls/user32/sysparams.c
|
|
+++ b/dlls/user32/sysparams.c
|
|
@@ -1184,26 +1184,85 @@ LONG WINAPI QueryDisplayConfig(UINT32 flags, UINT32 *numpathelements, DISPLAYCON
|
|
LUID gpu_luid;
|
|
WCHAR device_name[CCHDEVICENAME];
|
|
DEVMODEW devmode;
|
|
+ POINT origin;
|
|
+ HMONITOR monitor;
|
|
+ MONITORINFOEXW monitor_info;
|
|
+ DISPLAYCONFIG_SOURCE_MODE *source_mode = &modeinfo[0].sourceMode;
|
|
+ DISPLAYCONFIG_TARGET_MODE *target_mode = &modeinfo[1].targetMode;
|
|
+ DISPLAYCONFIG_PATH_SOURCE_INFO *source_info = &pathinfo[0].sourceInfo;
|
|
+ DISPLAYCONFIG_PATH_TARGET_INFO *target_info = &pathinfo[0].targetInfo;
|
|
+
|
|
+ TRACE("(%08x %p %p %p %p %p)\n", flags, numpathelements, pathinfo, numinfoelements, modeinfo, topologyid);
|
|
+
|
|
+ if (*numpathelements < 1 || *numinfoelements < 2)
|
|
+ return ERROR_INSUFFICIENT_BUFFER;
|
|
+
|
|
+ origin.x = 0;
|
|
+ origin.y = 0;
|
|
+ monitor = MonitorFromPoint(origin, MONITOR_DEFAULTTOPRIMARY);
|
|
+ monitor_info.cbSize = sizeof(monitor_info);
|
|
+ if (!(GetMonitorInfoW(monitor, (MONITORINFO*) &monitor_info)))
|
|
+ {
|
|
+ return ERROR_GEN_FAILURE;
|
|
+ }
|
|
+ if (!(EnumDisplaySettingsW(monitor_info.szDevice, 0, &devmode)))
|
|
+ {
|
|
+ return ERROR_GEN_FAILURE;
|
|
+ }
|
|
|
|
- FIXME("(%08x %p %p %p %p %p): semi-stub\n", flags, numpathelements, pathinfo, numinfoelements, modeinfo, topologyid);
|
|
-
|
|
- if (!numpathelements || !numinfoelements)
|
|
- return ERROR_INVALID_PARAMETER;
|
|
-
|
|
- if (!*numpathelements || !*numinfoelements)
|
|
- return ERROR_INVALID_PARAMETER;
|
|
-
|
|
- if (flags != QDC_ALL_PATHS &&
|
|
- flags != QDC_ONLY_ACTIVE_PATHS &&
|
|
- flags != QDC_DATABASE_CURRENT)
|
|
- return ERROR_INVALID_PARAMETER;
|
|
-
|
|
- if (((flags == QDC_DATABASE_CURRENT) && !topologyid) ||
|
|
- ((flags != QDC_DATABASE_CURRENT) && topologyid))
|
|
- return ERROR_INVALID_PARAMETER;
|
|
+ AllocateLocallyUniqueId(&gpu_luid);
|
|
+
|
|
+ source_mode->width = devmode.dmPelsWidth;
|
|
+ source_mode->height = devmode.dmPelsHeight;
|
|
+ source_mode->pixelFormat = DISPLAYCONFIG_PIXELFORMAT_32BPP;
|
|
+ source_mode->position.x = 0;
|
|
+ source_mode->position.y = 0;
|
|
+
|
|
+ /* no idea what pixel rate is */
|
|
+ target_mode->targetVideoSignalInfo.pixelRate = 0xdeadbeef;
|
|
+ target_mode->targetVideoSignalInfo.hSyncFreq.Numerator = devmode.dmDisplayFrequency * devmode.dmPelsHeight;
|
|
+ target_mode->targetVideoSignalInfo.hSyncFreq.Denominator = 1;
|
|
+ target_mode->targetVideoSignalInfo.vSyncFreq.Numerator = devmode.dmDisplayFrequency;
|
|
+ target_mode->targetVideoSignalInfo.vSyncFreq.Denominator = 1;
|
|
+ target_mode->targetVideoSignalInfo.activeSize.cx = devmode.dmPelsWidth;
|
|
+ target_mode->targetVideoSignalInfo.activeSize.cy = devmode.dmPelsHeight;
|
|
+ target_mode->targetVideoSignalInfo.totalSize.cx = devmode.dmPelsWidth;
|
|
+ target_mode->targetVideoSignalInfo.totalSize.cy = devmode.dmPelsHeight;
|
|
+ target_mode->targetVideoSignalInfo.videoStandard = D3DKMDT_VSS_NTSC_M;
|
|
+ target_mode->targetVideoSignalInfo.scanLineOrdering = DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED;
|
|
+
|
|
+ modeinfo[0].infoType = DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE;
|
|
+ modeinfo[0].id = 0;
|
|
+ modeinfo[0].adapterId = gpu_luid;
|
|
+ modeinfo[1].infoType = DISPLAYCONFIG_MODE_INFO_TYPE_TARGET;
|
|
+ modeinfo[1].id = 0;
|
|
+ modeinfo[1].adapterId = gpu_luid;
|
|
+
|
|
+ source_info->adapterId = gpu_luid;
|
|
+ source_info->id = 0;
|
|
+ source_info->modeInfoIdx = 0;
|
|
+ source_info->statusFlags = DISPLAYCONFIG_SOURCE_IN_USE;
|
|
+
|
|
+ target_info->adapterId = gpu_luid;
|
|
+ target_info->id = 0;
|
|
+
|
|
+ target_info->modeInfoIdx = 1;
|
|
+ target_info->outputTechnology = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI;
|
|
+ target_info->rotation = DISPLAYCONFIG_ROTATION_IDENTITY;
|
|
+ target_info->scaling = DISPLAYCONFIG_SCALING_IDENTITY;
|
|
+ target_info->refreshRate.Numerator = devmode.dmDisplayFrequency;
|
|
+ target_info->refreshRate.Denominator = 1;
|
|
+ target_info->scanLineOrdering = DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED;
|
|
+ target_info->targetAvailable = TRUE;
|
|
+ target_info->statusFlags = DISPLAYCONFIG_TARGET_IN_USE;
|
|
+
|
|
+ pathinfo[0].flags = DISPLAYCONFIG_PATH_ACTIVE;
|
|
+
|
|
+ if (flags == QDC_DATABASE_CURRENT && topologyid)
|
|
+ {
|
|
+ *topologyid = DISPLAYCONFIG_TOPOLOGY_INTERNAL;
|
|
+ }
|
|
|
|
- if (flags != QDC_ONLY_ACTIVE_PATHS)
|
|
- FIXME("only returning active paths\n");
|
|
|
|
if (topologyid)
|
|
{
|
|
--
|
|
2.35.1
|
|
|