From: Paul Gofman pgofman@codeweavers.com
--- dlls/win32u/sysparams.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index c98c288e72c..64c0af66c3d 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5708,7 +5708,10 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD { DISPLAYCONFIG_TARGET_DEVICE_NAME *target_name = (DISPLAYCONFIG_TARGET_DEVICE_NAME *)packet; char buffer[ARRAY_SIZE(target_name->monitorFriendlyDeviceName)]; + const unsigned char *edid; struct monitor *monitor; + unsigned int i, j; + const char *s;
TRACE( "DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME.\n" );
@@ -5727,13 +5730,26 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD continue;
target_name->outputTechnology = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL; - /* FIXME: get real monitor name. */ snprintf( buffer, ARRAY_SIZE(buffer), "Display%u", monitor->output_id + 1 ); asciiz_to_unicode( target_name->monitorFriendlyDeviceName, buffer ); lstrcpyW( target_name->monitorDevicePath, monitor->dev.interface_name ); + edid = monitor->edid; if (get_monitor_id_from_edid( NULL, &target_name->edidManufactureId, &target_name->edidProductCodeId, - monitor->edid, monitor->edid_len )) + edid, monitor->edid_len )) + { target_name->flags.edidIdsValid = 1; + for (i = 0; i < 4; ++i) + { + if (edid[54 + i * 18 + 3] != 0xfc) continue; + /* "Display name" ASCII descriptor. */ + s = (const char *)&edid[54 + i * 18 + 5]; + for (j = 0; s[j] && j < 13; ++j) + target_name->monitorFriendlyDeviceName[j] = s[j]; + while (j && isspace(s[j - 1])) --j; + target_name->monitorFriendlyDeviceName[j] = 0; + target_name->flags.friendlyNameFromEdid = 1; + } + } ret = STATUS_SUCCESS; break; }