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
68e461a6
Commit
68e461a6
authored
Sep 09, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Avoid unnecessary copy of adapter path and device name.
parent
43434f8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
sysparams.c
dlls/win32u/sysparams.c
+8
-18
No files found.
dlls/win32u/sysparams.c
View file @
68e461a6
...
...
@@ -2468,7 +2468,6 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
LONG
WINAPI
NtUserChangeDisplaySettings
(
UNICODE_STRING
*
devname
,
DEVMODEW
*
devmode
,
HWND
hwnd
,
DWORD
flags
,
void
*
lparam
)
{
WCHAR
device_name
[
CCHDEVICENAME
],
adapter_path
[
MAX_PATH
];
DEVMODEW
full_mode
=
{.
dmSize
=
sizeof
(
DEVMODEW
)};
LONG
ret
=
DISP_CHANGE_SUCCESSFUL
;
struct
adapter
*
adapter
;
...
...
@@ -2479,11 +2478,7 @@ LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devm
if
((
!
devname
||
!
devname
->
Length
)
&&
!
devmode
)
return
apply_display_settings
(
NULL
,
NULL
,
hwnd
,
flags
,
lparam
);
if
(
!
lock_display_devices
())
return
DISP_CHANGE_FAILED
;
if
((
adapter
=
find_adapter
(
devname
)))
{
lstrcpyW
(
device_name
,
adapter
->
dev
.
device_name
);
lstrcpyW
(
adapter_path
,
adapter
->
config_key
);
}
adapter
=
find_adapter
(
devname
);
unlock_display_devices
();
if
(
!
adapter
)
{
...
...
@@ -2492,9 +2487,9 @@ LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devm
}
if
(
!
adapter_get_full_mode
(
adapter
,
devmode
,
&
full_mode
))
ret
=
DISP_CHANGE_BADMODE
;
else
if
((
flags
&
CDS_UPDATEREGISTRY
)
&&
!
write_registry_settings
(
adapter
_path
,
&
full_mode
))
ret
=
DISP_CHANGE_NOTUPDATED
;
else
if
((
flags
&
CDS_UPDATEREGISTRY
)
&&
!
write_registry_settings
(
adapter
->
config_key
,
&
full_mode
))
ret
=
DISP_CHANGE_NOTUPDATED
;
else
if
(
flags
&
(
CDS_TEST
|
CDS_NORESET
))
ret
=
DISP_CHANGE_SUCCESSFUL
;
else
ret
=
apply_display_settings
(
device_name
,
&
full_mode
,
hwnd
,
flags
,
lparam
);
else
ret
=
apply_display_settings
(
adapter
->
dev
.
device_name
,
&
full_mode
,
hwnd
,
flags
,
lparam
);
adapter_release
(
adapter
);
if
(
ret
)
ERR
(
"Changing %s display settings returned %d.
\n
"
,
debugstr_us
(
devname
),
ret
);
...
...
@@ -2507,18 +2502,13 @@ LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devm
BOOL
WINAPI
NtUserEnumDisplaySettings
(
UNICODE_STRING
*
device
,
DWORD
index
,
DEVMODEW
*
devmode
,
DWORD
flags
)
{
static
const
WCHAR
wine_display_driverW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'D'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
' '
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
WCHAR
device_name
[
CCHDEVICENAME
],
adapter_path
[
MAX_PATH
];
struct
adapter
*
adapter
;
BOOL
ret
;
TRACE
(
"device %s, index %#x, devmode %p, flags %#x
\n
"
,
debugstr_us
(
device
),
index
,
devmode
,
flags
);
if
(
!
lock_display_devices
())
return
FALSE
;
if
((
adapter
=
find_adapter
(
device
)))
{
lstrcpyW
(
device_name
,
adapter
->
dev
.
device_name
);
lstrcpyW
(
adapter_path
,
adapter
->
config_key
);
}
adapter
=
find_adapter
(
device
);
unlock_display_devices
();
if
(
!
adapter
)
{
...
...
@@ -2532,12 +2522,12 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD index, DEVM
devmode
->
dmSize
=
offsetof
(
DEVMODEW
,
dmICMMethod
);
memset
(
&
devmode
->
dmDriverExtra
,
0
,
devmode
->
dmSize
-
offsetof
(
DEVMODEW
,
dmDriverExtra
)
);
if
(
index
==
ENUM_REGISTRY_SETTINGS
)
ret
=
read_registry_settings
(
adapter
_path
,
devmode
);
else
if
(
index
!=
ENUM_CURRENT_SETTINGS
)
ret
=
user_driver
->
pEnumDisplaySettingsEx
(
device_name
,
index
,
devmode
,
flags
);
else
ret
=
user_driver
->
pGetCurrentDisplaySettings
(
device_name
,
devmode
);
if
(
index
==
ENUM_REGISTRY_SETTINGS
)
ret
=
read_registry_settings
(
adapter
->
config_key
,
devmode
);
else
if
(
index
!=
ENUM_CURRENT_SETTINGS
)
ret
=
user_driver
->
pEnumDisplaySettingsEx
(
adapter
->
dev
.
device_name
,
index
,
devmode
,
flags
);
else
ret
=
user_driver
->
pGetCurrentDisplaySettings
(
adapter
->
dev
.
device_name
,
devmode
);
adapter_release
(
adapter
);
if
(
!
ret
)
WARN
(
"Failed to query %s display settings.
\n
"
,
debugstr_
w
(
device_nam
e
)
);
if
(
!
ret
)
WARN
(
"Failed to query %s display settings.
\n
"
,
debugstr_
us
(
devic
e
)
);
else
TRACE
(
"position %dx%d, resolution %ux%u, frequency %u, depth %u, orientation %#x.
\n
"
,
devmode
->
dmPosition
.
x
,
devmode
->
dmPosition
.
y
,
devmode
->
dmPelsWidth
,
devmode
->
dmPelsHeight
,
devmode
->
dmDisplayFrequency
,
devmode
->
dmBitsPerPel
,
devmode
->
dmDisplayOrientation
);
...
...
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