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
fa32c2ef
Commit
fa32c2ef
authored
Sep 14, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use find_adapter_device_by_(name|id) helpers in find_adapter.
parent
aa1e5939
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
sysparams.c
dlls/win32u/sysparams.c
+10
-18
No files found.
dlls/win32u/sysparams.c
View file @
fa32c2ef
...
...
@@ -2017,16 +2017,16 @@ static struct display_device *find_adapter_device_by_name( UNICODE_STRING *name
*/
static
struct
adapter
*
find_adapter
(
UNICODE_STRING
*
name
)
{
struct
display_device
*
device
;
struct
adapter
*
adapter
;
LIST_FOR_EACH_ENTRY
(
adapter
,
&
adapters
,
struct
adapter
,
entry
)
{
if
(
!
name
||
!
name
->
Length
)
return
adapter_acquire
(
adapter
);
/* use primary adapter */
if
(
!
wcsnicmp
(
name
->
Buffer
,
adapter
->
dev
.
device_name
,
name
->
Length
/
sizeof
(
WCHAR
)
)
&&
!
adapter
->
dev
.
device_name
[
name
->
Length
/
sizeof
(
WCHAR
)])
return
adapter_acquire
(
adapter
);
}
return
NULL
;
if
(
name
&&
name
->
Length
)
device
=
find_adapter_device_by_name
(
name
);
else
device
=
find_adapter_device_by_id
(
0
);
/* use primary adapter */
if
(
!
device
)
adapter
=
NULL
;
else
adapter
=
adapter_acquire
(
CONTAINING_RECORD
(
device
,
struct
adapter
,
dev
)
);
return
adapter
;
}
/***********************************************************************
...
...
@@ -2496,11 +2496,7 @@ LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devm
if
(
!
lock_display_devices
())
return
DISP_CHANGE_FAILED
;
adapter
=
find_adapter
(
devname
);
unlock_display_devices
();
if
(
!
adapter
)
{
WARN
(
"Invalid device name %s.
\n
"
,
debugstr_us
(
devname
)
);
return
DISP_CHANGE_BADPARAM
;
}
if
(
!
adapter
)
return
DISP_CHANGE_BADPARAM
;
if
(
!
adapter_get_full_mode
(
adapter
,
devmode
,
&
full_mode
))
ret
=
DISP_CHANGE_BADMODE
;
else
if
((
flags
&
CDS_UPDATEREGISTRY
)
&&
!
adapter_set_registry_settings
(
adapter
,
&
full_mode
))
ret
=
DISP_CHANGE_NOTUPDATED
;
...
...
@@ -2559,11 +2555,7 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD index, DEVM
if
(
!
lock_display_devices
())
return
FALSE
;
adapter
=
find_adapter
(
device
);
unlock_display_devices
();
if
(
!
adapter
)
{
WARN
(
"Invalid device name %s.
\n
"
,
debugstr_us
(
device
)
);
return
FALSE
;
}
if
(
!
adapter
)
return
FALSE
;
lstrcpynW
(
devmode
->
dmDeviceName
,
wine_display_driverW
,
ARRAY_SIZE
(
devmode
->
dmDeviceName
)
);
devmode
->
dmSpecVersion
=
DM_SPECVERSION
;
...
...
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