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: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
12fa0ccea5
commit
ae157bec34
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue