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
fd79a285
Commit
fd79a285
authored
Jun 19, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/filesource: Add a test for cross-thread asynchronous read requests.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0523f759
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
filesource.c
dlls/quartz/tests/filesource.c
+27
-0
No files found.
dlls/quartz/tests/filesource.c
View file @
fd79a285
...
...
@@ -808,12 +808,28 @@ static void test_sync_read_aligned(IAsyncReader *reader, IMemAllocator *allocato
IMediaSample_Release
(
sample
);
}
struct
request_thread_params
{
IAsyncReader
*
reader
;
IMediaSample
*
sample
;
};
static
DWORD
CALLBACK
request_thread
(
void
*
arg
)
{
struct
request_thread_params
*
params
=
arg
;
HRESULT
hr
=
IAsyncReader_Request
(
params
->
reader
,
params
->
sample
,
123
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
return
0
;
}
static
void
test_request
(
IAsyncReader
*
reader
,
IMemAllocator
*
allocator
)
{
IMediaSample
*
sample
,
*
sample2
,
*
ret_sample
;
struct
request_thread_params
params
;
REFERENCE_TIME
start_time
,
end_time
;
BYTE
*
data
,
*
data2
;
DWORD_PTR
cookie
;
HANDLE
thread
;
HRESULT
hr
;
LONG
len
;
int
i
;
...
...
@@ -897,6 +913,17 @@ static void test_request(IAsyncReader *reader, IMemAllocator *allocator)
for
(
i
=
0
;
i
<
88
;
i
++
)
ok
(
data2
[
i
]
==
(
512
+
i
)
%
111
,
"Got wrong byte %02x at %u.
\n
"
,
data2
[
i
],
i
);
params
.
reader
=
reader
;
params
.
sample
=
sample
;
thread
=
CreateThread
(
NULL
,
0
,
request_thread
,
&
params
,
0
,
NULL
);
ok
(
!
WaitForSingleObject
(
thread
,
1000
),
"Wait timed out.
\n
"
);
CloseHandle
(
thread
);
hr
=
IAsyncReader_WaitForNext
(
reader
,
1000
,
&
ret_sample
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
ret_sample
==
sample
,
"Samples didn't match.
\n
"
);
ok
(
cookie
==
123
,
"Got cookie %lu.
\n
"
,
cookie
);
IMediaSample_Release
(
sample
);
IMediaSample_Release
(
sample2
);
}
...
...
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