From: Paul Gofman pgofman@codeweavers.com
--- dlls/win32u/sysparams.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 8ca12d4f808..283d40e2e29 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -170,6 +170,7 @@ static const WCHAR monitorW[] = {'M','o','n','i','t','o','r',0}; static const WCHAR yesW[] = {'Y','e','s',0}; static const WCHAR noW[] = {'N','o',0}; static const WCHAR mode_countW[] = {'M','o','d','e','C','o','u','n','t',0}; +static const WCHAR edidW[] = {'E','D','I','D',0};
static const char guid_devclass_displayA[] = "{4D36E968-E325-11CE-BFC1-08002BE10318}"; static const WCHAR guid_devclass_displayW[] = @@ -230,6 +231,8 @@ struct monitor RECT rc_monitor; RECT rc_work; BOOL is_clone; + unsigned char *edid; + unsigned int edid_len; };
static struct list adapters = LIST_INIT(adapters); @@ -717,7 +720,7 @@ static BOOL read_monitor_settings( struct adapter *adapter, UINT index, struct m char buffer[4096]; KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer; WCHAR *device_name, *value_str = (WCHAR *)value->Data, *ptr; - HKEY hkey; + HKEY hkey, subkey; DWORD size, len;
monitor->flags = adapter->id ? 0 : MONITORINFOF_PRIMARY; @@ -824,6 +827,17 @@ static BOOL read_monitor_settings( struct adapter *adapter, UINT index, struct m monitor->dev.device_id[size++] = '\'; lstrcpyW( monitor->dev.device_id + size, device_name );
+ /* EDID */ + if ((subkey = reg_open_key( hkey, device_parametersW, sizeof(device_parametersW) ))) + { + if (query_reg_value( subkey, edidW, value, sizeof(buffer) ) && (monitor->edid = malloc( value->DataLength ))) + { + monitor->edid_len = value->DataLength; + memcpy( monitor->edid, value->Data, monitor->edid_len ); + } + NtClose( subkey ); + } + NtClose( hkey ); return TRUE; } @@ -1367,7 +1381,6 @@ static void add_monitor( const struct gdi_monitor *monitor, void *param ) if ((subkey = reg_create_key( hkey, device_parametersW, sizeof(device_parametersW), 0, NULL ))) { static const WCHAR bad_edidW[] = {'B','A','D','_','E','D','I','D',0}; - static const WCHAR edidW[] = {'E','D','I','D',0};
if (monitor->edid_len) set_reg_value( subkey, edidW, REG_BINARY, monitor->edid, monitor->edid_len ); @@ -1500,6 +1513,7 @@ static void clear_display_devices(void) monitor = LIST_ENTRY( list_head( &monitors ), struct monitor, entry ); adapter_release( monitor->adapter ); list_remove( &monitor->entry ); + free( monitor->edid ); free( monitor ); }