Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3ec21c3e
Commit
3ec21c3e
authored
Aug 04, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Read registry or current mode when validation needs it.
parent
dd79a25b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
sysparams.c
dlls/win32u/sysparams.c
+9
-11
No files found.
dlls/win32u/sysparams.c
View file @
3ec21c3e
...
...
@@ -2031,7 +2031,7 @@ static BOOL is_detached_mode( const DEVMODEW *mode )
mode
->
dmPelsHeight
==
0
;
}
static
DEVMODEW
*
validate_display_settings
(
DEVMODEW
*
default_mode
,
DEVMODEW
*
current_mode
,
DEVMODEW
*
dev
mode
)
static
DEVMODEW
*
validate_display_settings
(
const
WCHAR
*
adapter_path
,
const
WCHAR
*
device_name
,
DEVMODEW
*
devmode
,
DEVMODEW
*
temp_
mode
)
{
if
(
devmode
)
{
...
...
@@ -2048,9 +2048,9 @@ static DEVMODEW *validate_display_settings( DEVMODEW *default_mode, DEVMODEW *cu
if
(
!
devmode
)
{
if
(
!
default_mode
->
dmSize
)
return
NULL
;
if
(
!
read_registry_settings
(
adapter_path
,
temp_mode
)
)
return
NULL
;
TRACE
(
"Return to original display mode
\n
"
);
devmode
=
default
_mode
;
devmode
=
temp
_mode
;
}
if
((
devmode
->
dmFields
&
(
DM_PELSWIDTH
|
DM_PELSHEIGHT
))
!=
(
DM_PELSWIDTH
|
DM_PELSHEIGHT
))
...
...
@@ -2061,9 +2061,10 @@ static DEVMODEW *validate_display_settings( DEVMODEW *default_mode, DEVMODEW *cu
if
(
!
is_detached_mode
(
devmode
)
&&
(
!
devmode
->
dmPelsWidth
||
!
devmode
->
dmPelsHeight
))
{
if
(
!
current_mode
->
dmSize
)
return
NULL
;
if
(
!
devmode
->
dmPelsWidth
)
devmode
->
dmPelsWidth
=
current_mode
->
dmPelsWidth
;
if
(
!
devmode
->
dmPelsHeight
)
devmode
->
dmPelsHeight
=
current_mode
->
dmPelsHeight
;
DEVMODEW
current_mode
=
{.
dmSize
=
sizeof
(
DEVMODEW
)};
if
(
!
user_driver
->
pGetCurrentDisplaySettings
(
device_name
,
&
current_mode
))
return
NULL
;
if
(
!
devmode
->
dmPelsWidth
)
devmode
->
dmPelsWidth
=
current_mode
.
dmPelsWidth
;
if
(
!
devmode
->
dmPelsHeight
)
devmode
->
dmPelsHeight
=
current_mode
.
dmPelsHeight
;
}
return
devmode
;
...
...
@@ -2075,8 +2076,8 @@ static DEVMODEW *validate_display_settings( DEVMODEW *default_mode, DEVMODEW *cu
LONG
WINAPI
NtUserChangeDisplaySettings
(
UNICODE_STRING
*
devname
,
DEVMODEW
*
devmode
,
HWND
hwnd
,
DWORD
flags
,
void
*
lparam
)
{
DEVMODEW
default_mode
=
{.
dmSize
=
sizeof
(
DEVMODEW
)},
current_mode
=
{.
dmSize
=
sizeof
(
DEVMODEW
)};
WCHAR
device_name
[
CCHDEVICENAME
],
adapter_path
[
MAX_PATH
];
DEVMODEW
temp_mode
=
{.
dmSize
=
sizeof
(
DEVMODEW
)};
LONG
ret
=
DISP_CHANGE_SUCCESSFUL
;
struct
adapter
*
adapter
;
...
...
@@ -2104,10 +2105,7 @@ LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devm
return
DISP_CHANGE_BADPARAM
;
}
if
(
!
read_registry_settings
(
adapter_path
,
&
default_mode
))
default_mode
.
dmSize
=
0
;
if
(
!
NtUserEnumDisplaySettings
(
devname
,
ENUM_CURRENT_SETTINGS
,
&
current_mode
,
0
))
current_mode
.
dmSize
=
0
;
if
(
!
(
devmode
=
validate_display_settings
(
&
default_mode
,
&
current_mode
,
devmode
)))
ret
=
DISP_CHANGE_BADMODE
;
if
(
!
(
devmode
=
validate_display_settings
(
adapter_path
,
device_name
,
devmode
,
&
temp_mode
)))
ret
=
DISP_CHANGE_BADMODE
;
else
if
(
user_driver
->
pChangeDisplaySettingsEx
(
device_name
,
devmode
,
hwnd
,
flags
|
CDS_TEST
,
lparam
))
ret
=
DISP_CHANGE_BADMODE
;
else
if
((
flags
&
CDS_UPDATEREGISTRY
)
&&
!
write_registry_settings
(
adapter_path
,
devmode
))
ret
=
DISP_CHANGE_NOTUPDATED
;
else
if
(
flags
&
(
CDS_TEST
|
CDS_NORESET
))
ret
=
DISP_CHANGE_SUCCESSFUL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment