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
d0cd105d
Commit
d0cd105d
authored
Jan 10, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Use device context layout functions directly.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
904a238b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
86 deletions
+68
-86
dce.c
dlls/user32/tests/dce.c
+13
-24
win.c
dlls/user32/tests/win.c
+55
-62
No files found.
dlls/user32/tests/dce.c
View file @
d0cd105d
...
...
@@ -550,24 +550,13 @@ static void test_invisible_create(void)
static
void
test_dc_layout
(
void
)
{
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
DWORD
(
WINAPI
*
pGetLayout
)(
HDC
hdc
);
HWND
hwnd_cache_rtl
,
hwnd_owndc_rtl
,
hwnd_classdc_rtl
,
hwnd_classdc2_rtl
;
HDC
hdc
;
DWORD
layout
;
HMODULE
mod
=
GetModuleHandleA
(
"gdi32.dll"
);
pGetLayout
=
(
void
*
)
GetProcAddress
(
mod
,
"GetLayout"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
mod
,
"SetLayout"
);
if
(
!
pGetLayout
||
!
pSetLayout
)
{
win_skip
(
"Don't have SetLayout
\n
"
);
return
;
}
hdc
=
GetDC
(
hwnd_cache
);
p
SetLayout
(
hdc
,
LAYOUT_RTL
);
layout
=
p
GetLayout
(
hdc
);
SetLayout
(
hdc
,
LAYOUT_RTL
);
layout
=
GetLayout
(
hdc
);
ReleaseDC
(
hwnd_cache
,
hdc
);
if
(
!
layout
)
{
...
...
@@ -584,42 +573,42 @@ static void test_dc_layout(void)
hwnd_classdc2_rtl
=
CreateWindowExA
(
WS_EX_LAYOUTRTL
,
"classdc_class"
,
NULL
,
WS_OVERLAPPED
|
WS_VISIBLE
,
200
,
200
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
hdc
=
GetDC
(
hwnd_cache_rtl
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
p
SetLayout
(
hdc
,
0
);
SetLayout
(
hdc
,
0
);
ReleaseDC
(
hwnd_cache_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_owndc_rtl
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_cache_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_cache
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
0
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_cache
,
hdc
);
hdc
=
GetDC
(
hwnd_owndc_rtl
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
p
SetLayout
(
hdc
,
0
);
SetLayout
(
hdc
,
0
);
ReleaseDC
(
hwnd_owndc_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_owndc_rtl
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_owndc_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_classdc_rtl
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
p
SetLayout
(
hdc
,
0
);
SetLayout
(
hdc
,
0
);
ReleaseDC
(
hwnd_classdc_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_classdc2_rtl
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_classdc2_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_classdc
);
layout
=
p
GetLayout
(
hdc
);
layout
=
GetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_classdc_rtl
,
hdc
);
...
...
dlls/user32/tests/win.c
View file @
d0cd105d
...
...
@@ -62,8 +62,6 @@ static BOOL (WINAPI *pGetProcessDefaultLayout)( DWORD *layout );
static
BOOL
(
WINAPI
*
pSetProcessDefaultLayout
)(
DWORD
layout
);
static
BOOL
(
WINAPI
*
pFlashWindow
)(
HWND
hwnd
,
BOOL
bInvert
);
static
BOOL
(
WINAPI
*
pFlashWindowEx
)(
PFLASHWINFO
pfwi
);
static
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
static
DWORD
(
WINAPI
*
pGetLayout
)(
HDC
hdc
);
static
BOOL
(
WINAPI
*
pMirrorRgn
)(
HWND
hwnd
,
HRGN
hrgn
);
static
BOOL
(
WINAPI
*
pGetWindowDisplayAffinity
)(
HWND
hwnd
,
DWORD
*
affinity
);
static
BOOL
(
WINAPI
*
pSetWindowDisplayAffinity
)(
HWND
hwnd
,
DWORD
affinity
);
...
...
@@ -5908,6 +5906,7 @@ static void test_CreateWindow(void)
RECT
rc
,
rc_minmax
;
MINMAXINFO
minmax
;
BOOL
res
;
HDC
hdc
;
#define expect_menu(window, menu) \
SetLastError(0xdeadbeef); \
...
...
@@ -6248,73 +6247,69 @@ static void test_CreateWindow(void)
"invalid error %u
\n
"
,
GetLastError
());
DestroyWindow
(
hwnd
);
if
(
pGetLayout
&&
pSetLayout
)
hdc
=
GetDC
(
parent
);
SetLayout
(
hdc
,
LAYOUT_RTL
);
if
(
GetLayout
(
hdc
))
{
HDC
hdc
=
GetDC
(
parent
);
pSetLayout
(
hdc
,
LAYOUT_RTL
);
if
(
pGetLayout
(
hdc
))
ReleaseDC
(
parent
,
hdc
);
DestroyWindow
(
parent
);
SetLastError
(
0xdeadbeef
);
parent
=
CreateWindowExA
(
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
parent
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
parent
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
);
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
,
0
,
0
,
20
,
20
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
WS_EX_LAYOUTRTL
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
20
,
20
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
0
);
DestroyWindow
(
hwnd
);
SetWindowLongW
(
parent
,
GWL_EXSTYLE
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
|
WS_EX_NOINHERITLAYOUT
);
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
,
0
,
0
,
20
,
20
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
0
);
DestroyWindow
(
hwnd
);
if
(
pGetProcessDefaultLayout
&&
pSetProcessDefaultLayout
)
{
ReleaseDC
(
parent
,
hdc
)
;
DestroyWindow
(
parent
);
DWORD
layout
;
SetLastError
(
0xdeadbeef
);
parent
=
CreateWindowExA
(
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
parent
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
parent
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
);
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
,
0
,
0
,
20
,
20
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
WS_EX_LAYOUTRTL
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
20
,
20
,
parent
,
0
,
0
,
NULL
);
ok
(
!
pGetProcessDefaultLayout
(
NULL
),
"GetProcessDefaultLayout succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
res
=
pGetProcessDefaultLayout
(
&
layout
);
ok
(
res
,
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
0
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
SetLastError
(
0xdeadbeef
);
res
=
pSetProcessDefaultLayout
(
7
);
ok
(
res
,
"SetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
res
=
pGetProcessDefaultLayout
(
&
layout
);
ok
(
res
,
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
7
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
SetLastError
(
0xdeadbeef
);
res
=
pSetProcessDefaultLayout
(
LAYOUT_RTL
);
ok
(
res
,
"SetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
res
=
pGetProcessDefaultLayout
(
&
layout
);
ok
(
res
,
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
LAYOUT_RTL
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
hwnd
=
CreateWindowExA
(
WS_EX_APPWINDOW
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
0
);
expect_ex_style
(
hwnd
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
);
DestroyWindow
(
hwnd
);
SetWindowLongW
(
parent
,
GWL_EXSTYLE
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
|
WS_EX_NOINHERITLAYOUT
);
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
,
0
,
0
,
20
,
2
0
,
parent
,
0
,
0
,
NULL
);
hwnd
=
CreateWindowExA
(
WS_EX_APPWINDOW
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
10
0
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
0
);
expect_ex_style
(
hwnd
,
WS_EX_APPWINDOW
);
DestroyWindow
(
hwnd
);
if
(
pGetProcessDefaultLayout
&&
pSetProcessDefaultLayout
)
{
DWORD
layout
;
SetLastError
(
0xdeadbeef
);
ok
(
!
pGetProcessDefaultLayout
(
NULL
),
"GetProcessDefaultLayout succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
res
=
pGetProcessDefaultLayout
(
&
layout
);
ok
(
res
,
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
0
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
SetLastError
(
0xdeadbeef
);
res
=
pSetProcessDefaultLayout
(
7
);
ok
(
res
,
"SetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
res
=
pGetProcessDefaultLayout
(
&
layout
);
ok
(
res
,
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
7
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
SetLastError
(
0xdeadbeef
);
res
=
pSetProcessDefaultLayout
(
LAYOUT_RTL
);
ok
(
res
,
"SetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
res
=
pGetProcessDefaultLayout
(
&
layout
);
ok
(
res
,
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
LAYOUT_RTL
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
hwnd
=
CreateWindowExA
(
WS_EX_APPWINDOW
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
WS_EX_APPWINDOW
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
WS_EX_APPWINDOW
);
DestroyWindow
(
hwnd
);
pSetProcessDefaultLayout
(
0
);
}
else
win_skip
(
"SetProcessDefaultLayout not supported
\n
"
);
pSetProcessDefaultLayout
(
0
);
}
else
win_skip
(
"SetLayout not supported
\n
"
);
else
win_skip
(
"Set
ProcessDefault
Layout not supported
\n
"
);
}
else
win_skip
(
"SetLayout not
available
\n
"
);
else
win_skip
(
"SetLayout not
supported
\n
"
);
DestroyWindow
(
parent
);
...
...
@@ -11856,8 +11851,6 @@ START_TEST(win)
pSetProcessDefaultLayout
=
(
void
*
)
GetProcAddress
(
user32
,
"SetProcessDefaultLayout"
);
pFlashWindow
=
(
void
*
)
GetProcAddress
(
user32
,
"FlashWindow"
);
pFlashWindowEx
=
(
void
*
)
GetProcAddress
(
user32
,
"FlashWindowEx"
);
pGetLayout
=
(
void
*
)
GetProcAddress
(
gdi32
,
"GetLayout"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
gdi32
,
"SetLayout"
);
pMirrorRgn
=
(
void
*
)
GetProcAddress
(
gdi32
,
"MirrorRgn"
);
pGetWindowDisplayAffinity
=
(
void
*
)
GetProcAddress
(
user32
,
"GetWindowDisplayAffinity"
);
pSetWindowDisplayAffinity
=
(
void
*
)
GetProcAddress
(
user32
,
"SetWindowDisplayAffinity"
);
...
...
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