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
47b49601
Commit
47b49601
authored
May 18, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Make ChangeDisplaySettingsA/W reset dmDriverExtra to 0 like XP and Vista do.
parent
fd20b1be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
6 deletions
+51
-6
sysparams.c
dlls/user32/sysparams.c
+4
-0
monitor.c
dlls/user32/tests/monitor.c
+47
-6
No files found.
dlls/user32/sysparams.c
View file @
47b49601
...
...
@@ -2975,6 +2975,8 @@ HPEN SYSCOLOR_GetPen( INT index )
*/
LONG
WINAPI
ChangeDisplaySettingsA
(
LPDEVMODEA
devmode
,
DWORD
flags
)
{
if
(
devmode
)
devmode
->
dmDriverExtra
=
0
;
return
ChangeDisplaySettingsExA
(
NULL
,
devmode
,
NULL
,
flags
,
NULL
);
}
...
...
@@ -2984,6 +2986,8 @@ LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags )
*/
LONG
WINAPI
ChangeDisplaySettingsW
(
LPDEVMODEW
devmode
,
DWORD
flags
)
{
if
(
devmode
)
devmode
->
dmDriverExtra
=
0
;
return
ChangeDisplaySettingsExW
(
NULL
,
devmode
,
NULL
,
flags
,
NULL
);
}
...
...
dlls/user32/tests/monitor.c
View file @
47b49601
...
...
@@ -131,7 +131,9 @@ static const struct vid_mode vid_modes_test[] = {
{
0
,
480
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
,
0
},
{
640
,
0
,
0
,
0
,
DM_PELSWIDTH
|
DM_PELSHEIGHT
,
0
},
{
0
,
0
,
0
,
0
,
DM_DISPLAYFREQUENCY
,
0
},
/* the following test succeeds under XP SP3
{0, 0, 0, 0, DM_DISPLAYFREQUENCY, 0}
*/
};
#define vid_modes_cnt (sizeof(vid_modes_test) / sizeof(vid_modes_test[0]))
...
...
@@ -155,6 +157,44 @@ static void test_ChangeDisplaySettingsEx(void)
width
=
dm
.
dmPelsWidth
;
dm
.
dmDriverExtra
=
1
;
res
=
ChangeDisplaySettingsA
(
&
dm
,
CDS_TEST
);
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"ChangeDisplaySettingsA returned %d, expected DISP_CHANGE_SUCCESSFUL
\n
"
,
res
);
ok
(
dm
.
dmDriverExtra
==
0
,
"ChangeDisplaySettingsA didn't reset dmDriverExtra to 0
\n
"
);
/* crashes under XP SP3 for large dmDriverExtra values */
dm
.
dmDriverExtra
=
1
;
res
=
pChangeDisplaySettingsExA
(
NULL
,
&
dm
,
NULL
,
CDS_TEST
,
NULL
);
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_BADMODE
\n
"
,
res
);
ok
(
dm
.
dmDriverExtra
==
1
,
"ChangeDisplaySettingsExA shouldn't reset dmDriverExtra to 0
\n
"
);
memset
(
&
dmW
,
0
,
sizeof
(
dmW
));
dmW
.
dmSize
=
sizeof
(
dmW
);
dmW
.
dmFields
=
DM_PELSWIDTH
|
DM_PELSHEIGHT
;
dmW
.
dmPelsWidth
=
dm
.
dmPelsWidth
;
dmW
.
dmPelsHeight
=
dm
.
dmPelsHeight
;
dmW
.
dmDriverExtra
=
1
;
SetLastError
(
0xdeadbeef
);
res
=
ChangeDisplaySettingsW
(
&
dmW
,
CDS_TEST
);
if
(
GetLastError
()
!=
ERROR_CALL_NOT_IMPLEMENTED
)
{
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"ChangeDisplaySettingsW returned %d, expected DISP_CHANGE_SUCCESSFUL
\n
"
,
res
);
ok
(
dmW
.
dmDriverExtra
==
0
,
"ChangeDisplaySettingsW didn't reset dmDriverExtra to 0
\n
"
);
}
/* Apparently XP treats dmDriverExtra being != 0 as an error */
dmW
.
dmDriverExtra
=
1
;
res
=
pChangeDisplaySettingsExW
(
NULL
,
&
dmW
,
NULL
,
CDS_TEST
,
NULL
);
if
(
GetLastError
()
!=
ERROR_CALL_NOT_IMPLEMENTED
)
{
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_BADMODE
\n
"
,
res
);
ok
(
dmW
.
dmDriverExtra
==
1
,
"ChangeDisplaySettingsExW shouldn't reset dmDriverExtra to 0
\n
"
);
}
/* the following 2 tests show that dm.dmSize being 0 is invalid, but
* ChangeDisplaySettingsExA still reports success.
*/
...
...
@@ -171,8 +211,9 @@ static void test_ChangeDisplaySettingsEx(void)
SetLastError
(
0xdeadbeef
);
res
=
pChangeDisplaySettingsExW
(
NULL
,
&
dmW
,
NULL
,
CDS_TEST
,
NULL
);
if
(
GetLastError
()
!=
ERROR_CALL_NOT_IMPLEMENTED
)
ok
(
res
==
DISP_CHANGE_FAILED
,
"ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_FAILED
\n
"
,
res
);
ok
(
res
==
DISP_CHANGE_FAILED
||
res
==
DISP_CHANGE_BADMODE
/* XP SP3 */
,
"ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_FAILED or DISP_CHANGE_BADMODE
\n
"
,
res
);
memset
(
&
dm
,
0
,
sizeof
(
dm
));
dm
.
dmSize
=
sizeof
(
dm
);
...
...
@@ -184,7 +225,7 @@ static void test_ChangeDisplaySettingsEx(void)
dm
.
dmBitsPerPel
=
vid_modes_test
[
i
].
bpp
;
dm
.
dmDisplayFrequency
=
vid_modes_test
[
i
].
freq
;
dm
.
dmFields
=
vid_modes_test
[
i
].
fields
;
res
=
pChangeDisplaySettingsExA
(
NULL
,
&
dm
,
NULL
,
CDS_
FULLSCREEN
,
NULL
);
res
=
pChangeDisplaySettingsExA
(
NULL
,
&
dm
,
NULL
,
CDS_
TEST
,
NULL
);
ok
(
vid_modes_test
[
i
].
success
?
(
res
==
DISP_CHANGE_SUCCESSFUL
)
:
(
res
==
DISP_CHANGE_BADMODE
||
res
==
DISP_CHANGE_BADPARAM
),
...
...
@@ -243,8 +284,8 @@ START_TEST(monitor)
{
init_function_pointers
();
test_enumdisplaydevices
();
if
(
winetest_interactive
)
test_ChangeDisplaySettingsEx
();
test_ChangeDisplaySettingsEx
();
if
(
pMonitorFromPoint
&&
pMonitorFromWindow
)
test_monitors
();
else
...
...
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