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
3468e96d
Commit
3468e96d
authored
Sep 27, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Lock display devices while applying display settings.
parent
de1d2223
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
sysparams.c
dlls/win32u/sysparams.c
+17
-18
No files found.
dlls/win32u/sysparams.c
View file @
3468e96d
...
@@ -2211,10 +2211,8 @@ static DEVMODEW *get_display_settings( const WCHAR *devname, const DEVMODEW *dev
...
@@ -2211,10 +2211,8 @@ static DEVMODEW *get_display_settings( const WCHAR *devname, const DEVMODEW *dev
struct
adapter
*
adapter
;
struct
adapter
*
adapter
;
BOOL
ret
;
BOOL
ret
;
if
(
!
lock_display_devices
())
return
NULL
;
/* allocate an extra mode for easier iteration */
/* allocate an extra mode for easier iteration */
if
(
!
(
displays
=
calloc
(
list_count
(
&
adapters
)
+
1
,
sizeof
(
DEVMODEW
)
)))
goto
done
;
if
(
!
(
displays
=
calloc
(
list_count
(
&
adapters
)
+
1
,
sizeof
(
DEVMODEW
)
)))
return
NULL
;
mode
=
displays
;
mode
=
displays
;
LIST_FOR_EACH_ENTRY
(
adapter
,
&
adapters
,
struct
adapter
,
entry
)
LIST_FOR_EACH_ENTRY
(
adapter
,
&
adapters
,
struct
adapter
,
entry
)
...
@@ -2226,20 +2224,18 @@ static DEVMODEW *get_display_settings( const WCHAR *devname, const DEVMODEW *dev
...
@@ -2226,20 +2224,18 @@ static DEVMODEW *get_display_settings( const WCHAR *devname, const DEVMODEW *dev
{
{
if
(
!
devname
)
ret
=
adapter_get_registry_settings
(
adapter
,
mode
);
if
(
!
devname
)
ret
=
adapter_get_registry_settings
(
adapter
,
mode
);
else
ret
=
adapter_get_current_settings
(
adapter
,
mode
);
else
ret
=
adapter_get_current_settings
(
adapter
,
mode
);
if
(
!
ret
)
goto
done
;
if
(
!
ret
)
{
free
(
displays
);
return
NULL
;
}
}
}
lstrcpyW
(
mode
->
dmDeviceName
,
adapter
->
dev
.
device_name
);
lstrcpyW
(
mode
->
dmDeviceName
,
adapter
->
dev
.
device_name
);
mode
=
NEXT_DEVMODEW
(
mode
);
mode
=
NEXT_DEVMODEW
(
mode
);
}
}
unlock_display_devices
();
return
displays
;
return
displays
;
done:
unlock_display_devices
();
free
(
displays
);
return
NULL
;
}
}
static
INT
offset_length
(
POINT
offset
)
static
INT
offset_length
(
POINT
offset
)
...
@@ -2433,15 +2429,21 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
...
@@ -2433,15 +2429,21 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
HWND
hwnd
,
DWORD
flags
,
void
*
lparam
)
HWND
hwnd
,
DWORD
flags
,
void
*
lparam
)
{
{
WCHAR
primary_name
[
CCHDEVICENAME
];
WCHAR
primary_name
[
CCHDEVICENAME
];
struct
display_device
*
primary
;
struct
adapter
*
adapter
;
struct
adapter
*
adapter
;
DEVMODEW
*
displays
;
DEVMODEW
*
displays
;
LONG
ret
;
LONG
ret
;
displays
=
get_display_settings
(
devname
,
devmode
);
if
(
!
lock_display_devices
())
return
DISP_CHANGE_FAILED
;
if
(
!
displays
)
return
DISP_CHANGE_FAILED
;
if
(
!
(
displays
=
get_display_settings
(
devname
,
devmode
)))
{
unlock_display_devices
();
return
DISP_CHANGE_FAILED
;
}
if
(
all_detached_settings
(
displays
))
if
(
all_detached_settings
(
displays
))
{
{
unlock_display_devices
();
WARN
(
"Detaching all modes is not permitted.
\n
"
);
WARN
(
"Detaching all modes is not permitted.
\n
"
);
free
(
displays
);
free
(
displays
);
return
DISP_CHANGE_SUCCESSFUL
;
return
DISP_CHANGE_SUCCESSFUL
;
...
@@ -2449,14 +2451,11 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
...
@@ -2449,14 +2451,11 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
place_all_displays
(
displays
);
place_all_displays
(
displays
);
if
(
!
(
adapter
=
find_adapter
(
NULL
)))
primary_name
[
0
]
=
0
;
if
(
!
(
primary
=
find_adapter_device_by_id
(
0
)))
primary_name
[
0
]
=
0
;
else
else
wcscpy
(
primary_name
,
primary
->
device_name
);
{
wcscpy
(
primary_name
,
adapter
->
dev
.
device_name
);
adapter_release
(
adapter
);
}
ret
=
user_driver
->
pChangeDisplaySettings
(
displays
,
primary_name
,
hwnd
,
flags
,
lparam
);
ret
=
user_driver
->
pChangeDisplaySettings
(
displays
,
primary_name
,
hwnd
,
flags
,
lparam
);
unlock_display_devices
();
free
(
displays
);
free
(
displays
);
if
(
ret
)
return
ret
;
if
(
ret
)
return
ret
;
...
...
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