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
4ce220e4
Commit
4ce220e4
authored
Jun 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Set generic DEVMODEW fields in NtUserEnumDisplaySettings.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
360f12d3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
46 deletions
+23
-46
sysparams.c
dlls/win32u/sysparams.c
+15
-12
init.c
dlls/wineandroid.drv/init.c
+0
-8
display.c
dlls/winemac.drv/display.c
+0
-9
display.c
dlls/winex11.drv/display.c
+8
-17
No files found.
dlls/win32u/sysparams.c
View file @
4ce220e4
...
...
@@ -1926,14 +1926,14 @@ LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devm
/***********************************************************************
* NtUserEnumDisplaySettings (win32u.@)
*/
BOOL
WINAPI
NtUserEnumDisplaySettings
(
UNICODE_STRING
*
device
,
DWORD
mode
,
DEVMODEW
*
dev_mode
,
DWORD
flags
)
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
];
struct
adapter
*
adapter
;
BOOL
ret
;
TRACE
(
"
%s %#x %p %#x
\n
"
,
debugstr_us
(
device
),
mode
,
dev_
mode
,
flags
);
TRACE
(
"
device %s, index %#x, devmode %p, flags %#x
\n
"
,
debugstr_us
(
device
),
index
,
dev
mode
,
flags
);
if
(
!
lock_display_devices
())
return
FALSE
;
if
((
adapter
=
find_adapter
(
device
)))
lstrcpyW
(
device_name
,
adapter
->
dev
.
device_name
);
...
...
@@ -1944,15 +1944,18 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
return
FALSE
;
}
ret
=
user_driver
->
pEnumDisplaySettingsEx
(
device_name
,
mode
,
dev_mode
,
flags
);
if
(
ret
)
TRACE
(
"device:%s mode index:%#x position:(%d,%d) resolution:%ux%u frequency:%uHz "
"depth:%ubits orientation:%#x.
\n
"
,
debugstr_w
(
device_name
),
mode
,
dev_mode
->
dmPosition
.
x
,
dev_mode
->
dmPosition
.
y
,
dev_mode
->
dmPelsWidth
,
dev_mode
->
dmPelsHeight
,
dev_mode
->
dmDisplayFrequency
,
dev_mode
->
dmBitsPerPel
,
dev_mode
->
dmDisplayOrientation
);
else
WARN
(
"Failed to query %s display settings.
\n
"
,
wine_dbgstr_w
(
device_name
)
);
lstrcpynW
(
devmode
->
dmDeviceName
,
wine_display_driverW
,
ARRAY_SIZE
(
devmode
->
dmDeviceName
)
);
devmode
->
dmSpecVersion
=
DM_SPECVERSION
;
devmode
->
dmDriverVersion
=
DM_SPECVERSION
;
devmode
->
dmSize
=
offsetof
(
DEVMODEW
,
dmICMMethod
);
memset
(
&
devmode
->
dmDriverExtra
,
0
,
devmode
->
dmSize
-
offsetof
(
DEVMODEW
,
dmDriverExtra
)
);
ret
=
user_driver
->
pEnumDisplaySettingsEx
(
device_name
,
index
,
devmode
,
flags
);
if
(
!
ret
)
WARN
(
"Failed to query %s display settings.
\n
"
,
debugstr_w
(
device_name
)
);
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
);
return
ret
;
}
...
...
dlls/wineandroid.drv/init.c
View file @
4ce220e4
...
...
@@ -303,14 +303,6 @@ BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag
*/
BOOL
ANDROID_EnumDisplaySettingsEx
(
LPCWSTR
name
,
DWORD
n
,
LPDEVMODEW
devmode
,
DWORD
flags
)
{
static
const
WCHAR
dev_name
[
CCHDEVICENAME
]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'A'
,
'n'
,
'd'
,
'r'
,
'o'
,
'i'
,
'd'
,
' '
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
devmode
->
dmSize
=
offsetof
(
DEVMODEW
,
dmICMMethod
);
devmode
->
dmSpecVersion
=
DM_SPECVERSION
;
devmode
->
dmDriverVersion
=
DM_SPECVERSION
;
memcpy
(
devmode
->
dmDeviceName
,
dev_name
,
sizeof
(
dev_name
)
);
devmode
->
dmDriverExtra
=
0
;
devmode
->
u2
.
dmDisplayFlags
=
0
;
devmode
->
dmDisplayFrequency
=
0
;
devmode
->
u1
.
s2
.
dmPosition
.
x
=
0
;
...
...
dlls/winemac.drv/display.c
View file @
4ce220e4
...
...
@@ -1044,8 +1044,6 @@ better:
*/
BOOL
macdrv_EnumDisplaySettingsEx
(
LPCWSTR
devname
,
DWORD
mode
,
DEVMODEW
*
devmode
,
DWORD
flags
)
{
static
const
WCHAR
dev_name
[
CCHDEVICENAME
]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'M'
,
'a'
,
'c'
,
' '
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
struct
macdrv_display
*
displays
=
NULL
;
int
num_displays
;
CGDisplayModeRef
display_mode
;
...
...
@@ -1058,13 +1056,6 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, DEVMODEW *devmode
init_original_display_mode
();
memcpy
(
devmode
->
dmDeviceName
,
dev_name
,
sizeof
(
dev_name
));
devmode
->
dmSpecVersion
=
DM_SPECVERSION
;
devmode
->
dmDriverVersion
=
DM_SPECVERSION
;
devmode
->
dmSize
=
FIELD_OFFSET
(
DEVMODEW
,
dmICMMethod
);
devmode
->
dmDriverExtra
=
0
;
memset
(
&
devmode
->
dmFields
,
0
,
devmode
->
dmSize
-
FIELD_OFFSET
(
DEVMODEW
,
dmFields
));
if
(
mode
==
ENUM_REGISTRY_SETTINGS
)
{
TRACE
(
"mode %d (registry) -- getting default mode
\n
"
,
mode
);
...
...
dlls/winex11.drv/display.c
View file @
4ce220e4
...
...
@@ -464,9 +464,7 @@ static DWORD get_display_depth(ULONG_PTR display_id)
*/
BOOL
X11DRV_EnumDisplaySettingsEx
(
LPCWSTR
name
,
DWORD
n
,
LPDEVMODEW
devmode
,
DWORD
flags
)
{
static
const
WCHAR
dev_name
[
CCHDEVICENAME
]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'X'
,
'1'
,
'1'
,
' '
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
DEVMODEW
*
modes
;
DEVMODEW
*
modes
,
mode
;
UINT
mode_count
;
ULONG_PTR
id
;
...
...
@@ -477,21 +475,20 @@ BOOL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DW
ERR
(
"Failed to get %s registry display settings.
\n
"
,
wine_dbgstr_w
(
name
));
return
FALSE
;
}
goto
done
;
return
TRUE
;
}
if
(
n
==
ENUM_CURRENT_SETTINGS
)
{
if
(
!
settings_handler
.
get_id
(
name
,
&
id
)
||
!
settings_handler
.
get_current_mode
(
id
,
devmode
))
if
(
!
settings_handler
.
get_id
(
name
,
&
id
)
||
!
settings_handler
.
get_current_mode
(
id
,
&
mode
))
{
ERR
(
"Failed to get %s current display settings.
\n
"
,
wine_dbgstr_w
(
name
));
return
FALSE
;
}
if
(
!
is_detached_mode
(
devmode
))
devmode
->
dmBitsPerPel
=
get_display_depth
(
id
);
goto
done
;
memcpy
(
&
devmode
->
dmFields
,
&
mode
.
dmFields
,
devmode
->
dmSize
-
offsetof
(
DEVMODEW
,
dmFields
)
);
if
(
!
is_detached_mode
(
devmode
))
devmode
->
dmBitsPerPel
=
get_display_depth
(
id
);
return
TRUE
;
}
pthread_mutex_lock
(
&
settings_mutex
);
...
...
@@ -522,16 +519,10 @@ BOOL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DW
return
FALSE
;
}
m
emcpy
(
devmode
,
(
BYTE
*
)
cached_modes
+
(
sizeof
(
*
cached_modes
)
+
cached_modes
[
0
].
dmDriverExtra
)
*
n
,
sizeof
(
*
devmode
)
);
m
ode
=
*
(
DEVMODEW
*
)((
BYTE
*
)
cached_modes
+
(
sizeof
(
*
cached_modes
)
+
cached_modes
[
0
].
dmDriverExtra
)
*
n
);
pthread_mutex_unlock
(
&
settings_mutex
);
done:
/* Set generic fields */
devmode
->
dmSize
=
FIELD_OFFSET
(
DEVMODEW
,
dmICMMethod
);
devmode
->
dmDriverExtra
=
0
;
devmode
->
dmSpecVersion
=
DM_SPECVERSION
;
devmode
->
dmDriverVersion
=
DM_SPECVERSION
;
lstrcpyW
(
devmode
->
dmDeviceName
,
dev_name
);
memcpy
(
&
devmode
->
dmFields
,
&
mode
.
dmFields
,
devmode
->
dmSize
-
offsetof
(
DEVMODEW
,
dmFields
)
);
return
TRUE
;
}
...
...
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