Commit ae157bec authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Handle NULL device and not NULL mode parameters in ChangeDisplaySettingsExW().

This makes sure that user graphics drivers has a valid device name when a DEVMODE is specified. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 12fa0cce
......@@ -3293,12 +3293,21 @@ static void trace_devmode(const DEVMODEW *devmode)
LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd,
DWORD flags, LPVOID lparam )
{
WCHAR primary_adapter[CCHDEVICENAME];
BOOL def_mode = TRUE;
DEVMODEW dm;
TRACE("%s %p %p %#x %p\n", debugstr_w(devname), devmode, hwnd, flags, lparam);
TRACE("flags=%s\n", _CDS_flags(flags));
if (!devname && devmode)
{
if (!get_primary_adapter(primary_adapter))
return DISP_CHANGE_FAILED;
devname = primary_adapter;
}
if (devmode)
{
trace_devmode(devmode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment