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
ec94d0d5
Commit
ec94d0d5
authored
Dec 11, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Fix some test failures on latest Windows 10.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
804eb5c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
20 deletions
+36
-20
sysparams.c
dlls/user32/tests/sysparams.c
+35
-20
windef.h
include/windef.h
+1
-0
No files found.
dlls/user32/tests/sysparams.c
View file @
ec94d0d5
...
...
@@ -3537,14 +3537,16 @@ static void test_dpi_context(void)
{
DPI_AWARENESS
awareness
;
DPI_AWARENESS_CONTEXT
context
;
ULONG_PTR
i
;
ULONG_PTR
i
,
flags
;
BOOL
ret
;
UINT
dpi
;
HDC
hdc
=
GetDC
(
0
);
context
=
pGetThreadDpiAwarenessContext
();
/* Windows 10 >= 1709 adds extra 0x6000 flags */
flags
=
(
ULONG_PTR
)
context
&
0x6000
;
todo_wine
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x10
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x10
|
flags
)
,
"wrong context %p
\n
"
,
context
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
todo_wine
ok
(
awareness
==
DPI_AWARENESS_UNAWARE
,
"wrong awareness %u
\n
"
,
awareness
);
...
...
@@ -3561,7 +3563,7 @@ static void test_dpi_context(void)
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pSetProcessDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
-
5
);
ret
=
pSetProcessDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
-
6
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
ret
=
pSetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
);
...
...
@@ -3596,7 +3598,7 @@ static void test_dpi_context(void)
ret
=
pIsProcessDPIAware
();
ok
(
ret
,
"got %d
\n
"
,
ret
);
context
=
pGetThreadDpiAwarenessContext
();
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x11
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x11
|
flags
)
,
"wrong context %p
\n
"
,
context
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
DPI_AWARENESS_SYSTEM_AWARE
,
"wrong awareness %u
\n
"
,
awareness
);
SetLastError
(
0xdeadbeef
);
...
...
@@ -3604,11 +3606,11 @@ static void test_dpi_context(void)
ok
(
!
context
,
"got %p
\n
"
,
context
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
-
5
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
-
6
);
ok
(
!
context
,
"got %p
\n
"
,
context
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
context
=
pSetThreadDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_UNAWARE
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x80000011
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x80000011
|
flags
)
,
"wrong context %p
\n
"
,
context
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
DPI_AWARENESS_SYSTEM_AWARE
,
"wrong awareness %u
\n
"
,
awareness
);
dpi
=
pGetDpiForSystem
();
...
...
@@ -3617,11 +3619,11 @@ static void test_dpi_context(void)
ok
(
dpi
==
USER_DEFAULT_SCREEN_DPI
,
"wrong dpi %u
\n
"
,
dpi
);
ok
(
!
pIsProcessDPIAware
(),
"still aware
\n
"
);
context
=
pGetThreadDpiAwarenessContext
();
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x10
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x10
|
flags
)
,
"wrong context %p
\n
"
,
context
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
DPI_AWARENESS_UNAWARE
,
"wrong awareness %u
\n
"
,
awareness
);
context
=
pSetThreadDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x10
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x10
|
flags
)
,
"wrong context %p
\n
"
,
context
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
DPI_AWARENESS_UNAWARE
,
"wrong awareness %u
\n
"
,
awareness
);
dpi
=
pGetDpiForSystem
();
...
...
@@ -3642,21 +3644,21 @@ static void test_dpi_context(void)
ok
(
dpi
==
real_dpi
,
"wrong dpi %u
\n
"
,
dpi
);
ok
(
pIsProcessDPIAware
(),
"not aware
\n
"
);
context
=
pGetThreadDpiAwarenessContext
();
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x11
,
"wrong context %p
\n
"
,
context
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
0x80000010
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x11
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x11
|
flags
)
,
"wrong context %p
\n
"
,
context
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
(
0x80000010
|
flags
)
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x11
|
flags
)
,
"wrong context %p
\n
"
,
context
);
context
=
pGetThreadDpiAwarenessContext
();
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x11
,
"wrong context %p
\n
"
,
context
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
0x80000011
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x80000011
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x11
|
flags
)
,
"wrong context %p
\n
"
,
context
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
(
0x80000011
|
flags
)
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x80000011
|
flags
)
,
"wrong context %p
\n
"
,
context
);
context
=
pGetThreadDpiAwarenessContext
();
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x11
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x11
|
flags
)
,
"wrong context %p
\n
"
,
context
);
context
=
pSetThreadDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
0x12
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x80000011
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x80000011
|
flags
)
,
"wrong context %p
\n
"
,
context
);
context
=
pSetThreadDpiAwarenessContext
(
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x12
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x12
)
,
"wrong context %p
\n
"
,
context
);
context
=
pGetThreadDpiAwarenessContext
();
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
0x11
,
"wrong context %p
\n
"
,
context
);
ok
(
context
==
(
DPI_AWARENESS_CONTEXT
)
(
0x11
|
flags
)
,
"wrong context %p
\n
"
,
context
);
for
(
i
=
0
;
i
<
0x100
;
i
++
)
{
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
i
);
...
...
@@ -3698,6 +3700,18 @@ static void test_dpi_context(void)
ok
(
awareness
==
i
,
"%lx: wrong value %u
\n
"
,
~
i
,
awareness
);
ok
(
pIsValidDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
~
i
),
"%lx: not valid
\n
"
,
~
i
);
break
;
case
(
ULONG_PTR
)
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
:
if
(
pIsValidDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
~
i
))
ok
(
awareness
==
DPI_AWARENESS_PER_MONITOR_AWARE
,
"%lx: wrong value %u
\n
"
,
~
i
,
awareness
);
else
ok
(
awareness
==
DPI_AWARENESS_INVALID
,
"%lx: wrong value %u
\n
"
,
~
i
,
awareness
);
break
;
case
(
ULONG_PTR
)
DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED
:
if
(
pIsValidDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
~
i
))
ok
(
awareness
==
DPI_AWARENESS_UNAWARE
,
"%lx: wrong value %u
\n
"
,
~
i
,
awareness
);
else
ok
(
awareness
==
DPI_AWARENESS_INVALID
,
"%lx: wrong value %u
\n
"
,
~
i
,
awareness
);
break
;
default:
ok
(
awareness
==
DPI_AWARENESS_INVALID
,
"%lx: wrong value %u
\n
"
,
~
i
,
awareness
);
ok
(
!
pIsValidDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
~
i
),
"%lx: valid
\n
"
,
~
i
);
...
...
@@ -3805,10 +3819,11 @@ static void test_dpi_window(void)
ok
(
dpi
==
(
j
==
DPI_AWARENESS_UNAWARE
?
USER_DEFAULT_SCREEN_DPI
:
real_dpi
),
"%lu/%lu: got %u / %u
\n
"
,
i
,
j
,
dpi
,
real_dpi
);
ret
=
SetParent
(
child
,
hwnd
);
ok
(
ret
!=
0
,
"SetParent failed err %u
\n
"
,
GetLastError
()
);
ok
(
ret
!=
0
||
GetLastError
()
==
ERROR_INVALID_STATE
,
"SetParent failed err %u
\n
"
,
GetLastError
()
);
context
=
pGetWindowDpiAwarenessContext
(
child
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
i
,
"%lu/%lu: wrong awareness %u
\n
"
,
i
,
j
,
awareness
);
ok
(
awareness
==
(
ret
?
i
:
j
)
,
"%lu/%lu: wrong awareness %u
\n
"
,
i
,
j
,
awareness
);
dpi
=
pGetDpiForWindow
(
child
);
ok
(
dpi
==
(
i
==
DPI_AWARENESS_UNAWARE
?
USER_DEFAULT_SCREEN_DPI
:
real_dpi
),
"%lu/%lu: got %u / %u
\n
"
,
i
,
j
,
dpi
,
real_dpi
);
...
...
include/windef.h
View file @
ec94d0d5
...
...
@@ -450,6 +450,7 @@ typedef enum DPI_AWARENESS
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5)
#ifdef __cplusplus
}
...
...
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