Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d4c62162
Commit
d4c62162
authored
Jan 27, 2006
by
Rein Klazes
Committed by
Alexandre Julliard
Jan 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Fix SPI_{G|S}ETFONTSMOOTHING with tests.
parent
e0cffe35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
8 deletions
+49
-8
sysparams.c
dlls/user/sysparams.c
+6
-2
sysparams.c
dlls/user/tests/sysparams.c
+43
-6
No files found.
dlls/user/sysparams.c
View file @
d4c62162
...
...
@@ -1898,13 +1898,17 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
WINE_SPI_WARN
(
SPI_SETANIMATION
);
/* 73 WINVER >= 0x400 */
case
SPI_GETFONTSMOOTHING
:
{
UINT
tmpval
;
ret
=
get_uint_param
(
SPI_SETFONTSMOOTHING_IDX
,
SPI_SETFONTSMOOTHING_REGKEY
,
SPI_SETFONTSMOOTHING_VALNAME
,
&
font_smoothing
,
pvParam
);
&
font_smoothing
,
&
tmpval
);
*
(
UINT
*
)
pvParam
=
(
tmpval
!=
0
);
break
;
}
case
SPI_SETFONTSMOOTHING
:
uiParam
=
uiParam
?
2
:
0
;
/* Win NT4/2k/XP behavior */
ret
=
set_uint_param
(
SPI_SETFONTSMOOTHING_IDX
,
SPI_SETFONTSMOOTHING_REGKEY
,
SPI_SETFONTSMOOTHING_VALNAME
,
...
...
dlls/user/tests/sysparams.c
View file @
d4c62162
...
...
@@ -39,6 +39,7 @@
static
int
strict
;
static
int
dpi
;
static
int
iswin9x
;
static
HDC
hdc
;
#define eq(received, expected, label, type) \
...
...
@@ -118,6 +119,8 @@ static HDC hdc;
#define SPI_SETSCREENREADER_VALNAME "On"
#define SPI_SETSCREENREADER_REGKEY_LEGACY "Control Panel\\Accessibility"
#define SPI_SETSCREENREADER_VALNAME_LEGACY "Blind Access"
#define SPI_SETFONTSMOOTHING_REGKEY "Control Panel\\Desktop"
#define SPI_SETFONTSMOOTHING_VALNAME "FontSmoothing"
#define SPI_SETLOWPOWERACTIVE_REGKEY "Control Panel\\Desktop"
#define SPI_SETLOWPOWERACTIVE_VALNAME "LowPowerActive"
#define SPI_SETPOWEROFFACTIVE_REGKEY "Control Panel\\Desktop"
...
...
@@ -675,7 +678,6 @@ static void test_SPI_SETBORDER( void ) /* 6 */
{
BOOL
rc
;
UINT
old_border
;
int
iswin9x
;
NONCLIENTMETRICSA
ncmsave
;
INT
CaptionWidth
;
...
...
@@ -689,11 +691,6 @@ static void test_SPI_SETBORDER( void ) /* 6 */
"Control Panel
\\
Desktop
\\
WindowMetrics"
,
"CaptionWidth"
,
dpi
);
ncmsave
.
iCaptionWidth
=
CaptionWidth
;
/* The SPI_SETBORDER seems to be buggy on Win9x/ME (looks like you need to
* do it twice to make the intended change). So skip parts of the tests on
* those platforms */
iswin9x
=
GetVersion
()
&
0x80000000
;
/* These tests hang when XFree86 4.0 for Windows is running (tested on
* WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is
* running.
...
...
@@ -711,6 +708,9 @@ static void test_SPI_SETBORDER( void ) /* 6 */
if
(
old_border
==
7
||
old_border
==
20
)
old_border
=
1
;
/* The SPI_SETBORDER seems to be buggy on Win9x/ME (looks like you need to
* do it twice to make the intended change). So skip parts of the tests on
* those platforms */
if
(
!
iswin9x
)
{
test_setborder
(
1
,
1
,
dpi
);
test_setborder
(
0
,
1
,
dpi
);
...
...
@@ -1837,6 +1837,41 @@ static void test_SPI_SETSCREENREADER( void ) /* 71 */
ok
(
rc
!=
0
,
"***warning*** failed to restore the original value: rc=%d err=%ld
\n
"
,
rc
,
GetLastError
());
}
static
void
test_SPI_SETFONTSMOOTHING
(
void
)
/* 75 */
{
BOOL
rc
;
BOOL
old_b
;
const
UINT
vals
[]
=
{
0xffffffff
,
0
,
1
,
2
};
unsigned
int
i
;
trace
(
"testing SPI_{GET,SET}FONTSMOOTHING
\n
"
);
if
(
iswin9x
)
return
;
/* 95/98/ME don't seem to implement this fully */
SetLastError
(
0xdeadbeef
);
rc
=
SystemParametersInfoA
(
SPI_GETFONTSMOOTHING
,
0
,
&
old_b
,
0
);
if
(
!
test_error_msg
(
rc
,
"SPI_{GET,SET}FONTSMOOTHING"
))
return
;
for
(
i
=
0
;
i
<
sizeof
(
vals
)
/
sizeof
(
*
vals
);
i
++
)
{
UINT
v
;
rc
=
SystemParametersInfoA
(
SPI_SETFONTSMOOTHING
,
vals
[
i
],
0
,
SPIF_UPDATEINIFILE
|
SPIF_SENDCHANGE
);
ok
(
rc
!=
0
,
"%d: rc=%d err=%ld
\n
"
,
i
,
rc
,
GetLastError
());
test_change_message
(
SPI_SETFONTSMOOTHING
,
0
);
test_reg_key
(
SPI_SETFONTSMOOTHING_REGKEY
,
SPI_SETFONTSMOOTHING_VALNAME
,
vals
[
i
]
?
"2"
:
"0"
);
rc
=
SystemParametersInfoA
(
SPI_GETFONTSMOOTHING
,
0
,
&
v
,
0
);
ok
(
rc
!=
0
,
"%d: rc=%d err=%ld
\n
"
,
i
,
rc
,
GetLastError
());
eq
(
v
,
vals
[
i
]
?
1
:
0
,
"SPI_GETFONTSMOOTHING"
,
"%d"
);
}
rc
=
SystemParametersInfoA
(
SPI_SETFONTSMOOTHING
,
old_b
,
0
,
SPIF_UPDATEINIFILE
);
ok
(
rc
!=
0
,
"***warning*** failed to restore the original value: rc=%d err=%ld
\n
"
,
rc
,
GetLastError
());
}
static
void
test_SPI_SETLOWPOWERACTIVE
(
void
)
/* 85 */
{
BOOL
rc
;
...
...
@@ -2160,6 +2195,7 @@ static DWORD WINAPI SysParamsThreadFunc( LPVOID lpParam )
test_SPI_SETSHOWSOUNDS
();
/* 57 */
test_SPI_SETKEYBOARDPREF
();
/* 69 */
test_SPI_SETSCREENREADER
();
/* 71 */
test_SPI_SETFONTSMOOTHING
();
/* 75 */
test_SPI_SETLOWPOWERACTIVE
();
/* 85 */
test_SPI_SETPOWEROFFACTIVE
();
/* 86 */
test_SPI_SETMOUSEHOVERWIDTH
();
/* 99 */
...
...
@@ -2405,6 +2441,7 @@ START_TEST(sysparams)
hdc
=
GetDC
(
0
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
iswin9x
=
GetVersion
()
&
0x80000000
;
/* This test requires interactivity, if we don't have it, give up */
if
(
!
SystemParametersInfoA
(
SPI_SETBEEP
,
TRUE
,
0
,
SPIF_UPDATEINIFILE
|
SPIF_SENDCHANGE
)
&&
...
...
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