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
66c7b37a
Commit
66c7b37a
authored
May 16, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
May 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Test clipboard sequence number for delayed rendered data.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e9d40e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
2 deletions
+76
-2
clipboard.c
dlls/user32/tests/clipboard.c
+76
-2
No files found.
dlls/user32/tests/clipboard.c
View file @
66c7b37a
...
...
@@ -877,6 +877,13 @@ static void test_synthesized(void)
DestroyWindow
(
hwnd
);
}
static
DWORD
WINAPI
clipboard_render_data_thread
(
void
*
param
)
{
HANDLE
handle
=
SetClipboardData
(
CF_UNICODETEXT
,
create_textW
()
);
ok
(
handle
!=
0
,
"SetClipboardData failed: %d
\n
"
,
GetLastError
()
);
return
0
;
}
static
CRITICAL_SECTION
clipboard_cs
;
static
HWND
next_wnd
;
static
UINT
wm_drawclipboard
;
...
...
@@ -885,6 +892,7 @@ static UINT wm_destroyclipboard;
static
UINT
wm_renderformat
;
static
UINT
nb_formats
;
static
BOOL
cross_thread
;
static
BOOL
do_render_format
;
static
LRESULT
CALLBACK
clipboard_wnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
...
...
@@ -917,6 +925,27 @@ static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARA
case
WM_RENDERFORMAT
:
ok
(
!
wm_renderformat
,
"multiple WM_RENDERFORMAT %04x / %04lx
\n
"
,
wm_renderformat
,
wp
);
wm_renderformat
=
wp
;
if
(
do_render_format
)
{
UINT
seq
,
old_seq
;
HANDLE
handle
;
old_seq
=
GetClipboardSequenceNumber
();
handle
=
SetClipboardData
(
CF_TEXT
,
create_textA
()
);
ok
(
handle
!=
0
,
"SetClipboardData failed: %d
\n
"
,
GetLastError
()
);
seq
=
GetClipboardSequenceNumber
();
todo_wine
ok
(
seq
==
old_seq
,
"sequence changed
\n
"
);
old_seq
=
seq
;
handle
=
CreateThread
(
NULL
,
0
,
clipboard_render_data_thread
,
NULL
,
0
,
NULL
);
ok
(
handle
!=
NULL
,
"CreateThread failed: %d
\n
"
,
GetLastError
()
);
ok
(
WaitForSingleObject
(
handle
,
INFINITE
)
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed
\n
"
);
CloseHandle
(
handle
);
seq
=
GetClipboardSequenceNumber
();
todo_wine
ok
(
seq
==
old_seq
,
"sequence changed
\n
"
);
}
break
;
case
WM_CLIPBOARDUPDATE
:
ok
(
msg_flags
==
ISMEX_NOSEND
,
"WM_CLIPBOARDUPDATE wrong flags %x
\n
"
,
msg_flags
);
...
...
@@ -951,6 +980,19 @@ static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARA
return
DefWindowProcA
(
hwnd
,
msg
,
wp
,
lp
);
}
static
void
get_clipboard_data_process
(
void
)
{
HANDLE
data
;
BOOL
r
;
r
=
OpenClipboard
(
0
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
data
=
GetClipboardData
(
CF_UNICODETEXT
);
ok
(
data
!=
NULL
,
"GetClipboardData failed: %d
\n
"
,
GetLastError
());
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
}
static
DWORD
WINAPI
clipboard_thread
(
void
*
param
)
{
HWND
ret
,
win
=
param
;
...
...
@@ -1199,14 +1241,16 @@ static DWORD WINAPI clipboard_thread(void *param)
fmt
=
SendMessageA
(
win
,
WM_USER
+
4
,
0
,
0
);
ok
(
fmt
==
CF_UNICODETEXT
,
"WM_RENDERFORMAT received %04x
\n
"
,
fmt
);
do_render_format
=
TRUE
;
handle
=
GetClipboardData
(
CF_OEMTEXT
);
ok
(
!
handle
,
"go
t data for CF_OEMTEXT
\n
"
);
ok
(
handle
!=
NULL
,
"didn't ge
t data for CF_OEMTEXT
\n
"
);
fmt
=
SendMessageA
(
win
,
WM_USER
+
4
,
0
,
0
);
ok
(
fmt
==
CF_UNICODETEXT
,
"WM_RENDERFORMAT received %04x
\n
"
,
fmt
);
do_render_format
=
FALSE
;
SetClipboardData
(
CF_WAVE
,
0
);
seq
=
GetClipboardSequenceNumber
();
ok
(
(
int
)(
seq
-
old_seq
)
==
1
,
"sequence diff %d
\n
"
,
seq
-
old_seq
);
todo_wine
ok
(
(
int
)(
seq
-
old_seq
)
==
1
,
"sequence diff %d
\n
"
,
seq
-
old_seq
);
old_seq
=
seq
;
if
(
!
cross_thread
)
{
...
...
@@ -1463,6 +1507,31 @@ static DWORD WINAPI clipboard_thread(void *param)
fmt
=
SendMessageA
(
win
,
WM_USER
+
4
,
0
,
0
);
ok
(
!
fmt
,
"WM_RENDERFORMAT received
\n
"
);
if
(
cross_thread
)
{
r
=
OpenClipboard
(
win
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
r
=
EmptyClipboard
();
ok
(
r
,
"EmptyClipboard failed: %d
\n
"
,
GetLastError
());
SetClipboardData
(
CF_TEXT
,
0
);
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
do_render_format
=
TRUE
;
old_seq
=
GetClipboardSequenceNumber
();
run_process
(
"get_clipboard_data"
);
seq
=
GetClipboardSequenceNumber
();
todo_wine
ok
(
seq
==
old_seq
,
"sequence changed
\n
"
);
do_render_format
=
FALSE
;
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
todo_wine
ok
(
count
==
1
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
==
1
||
broken
(
!
pAddClipboardFormatListener
)
/* < Vista */
,
"WM_CLIPBOARDUPDATE not received
\n
"
);
fmt
=
SendMessageA
(
win
,
WM_USER
+
4
,
0
,
0
);
ok
(
fmt
==
CF_TEXT
,
"WM_RENDERFORMAT received
\n
"
);
}
r
=
PostMessageA
(
win
,
WM_USER
,
0
,
0
);
ok
(
r
,
"PostMessage failed: %d
\n
"
,
GetLastError
());
...
...
@@ -2391,6 +2460,11 @@ START_TEST(clipboard)
test_string_data_process
(
atoi
(
argv
[
3
]
));
return
;
}
if
(
argc
==
3
&&
!
strcmp
(
argv
[
2
],
"get_clipboard_data"
))
{
get_clipboard_data_process
(
);
return
;
}
test_RegisterClipboardFormatA
();
test_ClipboardOwner
();
...
...
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