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
0f4bc3b9
Commit
0f4bc3b9
authored
Aug 01, 2013
by
Jeff Klein
Committed by
Alexandre Julliard
Aug 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi/tests: Test in-proc marshal of IAudioClient.
parent
75bde26b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
133 additions
and
0 deletions
+133
-0
capture.c
dlls/mmdevapi/tests/capture.c
+65
-0
render.c
dlls/mmdevapi/tests/render.c
+68
-0
No files found.
dlls/mmdevapi/tests/capture.c
View file @
0f4bc3b9
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
static
IMMDevice
*
dev
=
NULL
;
static
IMMDevice
*
dev
=
NULL
;
static
const
LARGE_INTEGER
ullZero
;
static
void
test_uninitialized
(
IAudioClient
*
ac
)
static
void
test_uninitialized
(
IAudioClient
*
ac
)
{
{
...
@@ -1008,6 +1009,69 @@ static void test_volume_dependence(void)
...
@@ -1008,6 +1009,69 @@ static void test_volume_dependence(void)
IAudioClient_Release
(
ac
);
IAudioClient_Release
(
ac
);
}
}
static
void
test_marshal
(
void
)
{
IStream
*
pStream
;
IAudioClient
*
ac
,
*
acDest
;
IAudioCaptureClient
*
cc
,
*
ccDest
;
WAVEFORMATEX
*
pwfx
;
HRESULT
hr
;
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
ac
);
ok
(
hr
==
S_OK
,
"Activation failed with %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IAudioClient_GetMixFormat
(
ac
,
&
pwfx
);
ok
(
hr
==
S_OK
,
"GetMixFormat failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_Initialize
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
0
,
5000000
,
0
,
pwfx
,
NULL
);
ok
(
hr
==
S_OK
,
"Initialize failed: %08x
\n
"
,
hr
);
CoTaskMemFree
(
pwfx
);
hr
=
IAudioClient_GetService
(
ac
,
&
IID_IAudioCaptureClient
,
(
void
**
)
&
cc
);
ok
(
hr
==
S_OK
,
"GetService failed: %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
IAudioClient_Release
(
ac
);
return
;
}
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
pStream
);
ok
(
hr
==
S_OK
,
"CreateStreamOnHGlobal failed 0x%08x
\n
"
,
hr
);
/* marshal IAudioClient */
hr
=
CoMarshalInterface
(
pStream
,
&
IID_IAudioClient
,
(
IUnknown
*
)
ac
,
MSHCTX_INPROC
,
NULL
,
MSHLFLAGS_NORMAL
);
ok
(
hr
==
S_OK
,
"CoMarshalInterface IAudioClient failed 0x%08x
\n
"
,
hr
);
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
hr
=
CoUnmarshalInterface
(
pStream
,
&
IID_IAudioClient
,
(
void
**
)
&
acDest
);
ok
(
hr
==
S_OK
,
"CoUnmarshalInterface IAudioClient failed 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IAudioClient_Release
(
acDest
);
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
/* marshal IAudioCaptureClient */
hr
=
CoMarshalInterface
(
pStream
,
&
IID_IAudioCaptureClient
,
(
IUnknown
*
)
cc
,
MSHCTX_INPROC
,
NULL
,
MSHLFLAGS_NORMAL
);
ok
(
hr
==
S_OK
,
"CoMarshalInterface IAudioCaptureClient failed 0x%08x
\n
"
,
hr
);
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
hr
=
CoUnmarshalInterface
(
pStream
,
&
IID_IAudioCaptureClient
,
(
void
**
)
&
ccDest
);
ok
(
hr
==
S_OK
,
"CoUnmarshalInterface IAudioCaptureClient failed 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IAudioCaptureClient_Release
(
ccDest
);
IStream_Release
(
pStream
);
IAudioClient_Release
(
ac
);
IAudioCaptureClient_Release
(
cc
);
}
START_TEST
(
capture
)
START_TEST
(
capture
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -1037,6 +1101,7 @@ START_TEST(capture)
...
@@ -1037,6 +1101,7 @@ START_TEST(capture)
test_channelvolume
();
test_channelvolume
();
test_simplevolume
();
test_simplevolume
();
test_volume_dependence
();
test_volume_dependence
();
test_marshal
();
IMMDevice_Release
(
dev
);
IMMDevice_Release
(
dev
);
...
...
dlls/mmdevapi/tests/render.c
View file @
0f4bc3b9
...
@@ -57,6 +57,8 @@ static IMMDeviceEnumerator *mme = NULL;
...
@@ -57,6 +57,8 @@ static IMMDeviceEnumerator *mme = NULL;
static
IMMDevice
*
dev
=
NULL
;
static
IMMDevice
*
dev
=
NULL
;
static
HRESULT
hexcl
=
S_OK
;
/* or AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED */
static
HRESULT
hexcl
=
S_OK
;
/* or AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED */
static
const
LARGE_INTEGER
ullZero
;
static
inline
const
char
*
dbgstr_guid
(
const
GUID
*
id
)
static
inline
const
char
*
dbgstr_guid
(
const
GUID
*
id
)
{
{
static
char
ret
[
256
];
static
char
ret
[
256
];
...
@@ -2159,6 +2161,71 @@ static void test_worst_case(void)
...
@@ -2159,6 +2161,71 @@ static void test_worst_case(void)
IAudioRenderClient_Release
(
arc
);
IAudioRenderClient_Release
(
arc
);
}
}
static
void
test_marshal
(
void
)
{
IStream
*
pStream
;
IAudioClient
*
ac
,
*
acDest
;
IAudioRenderClient
*
rc
,
*
rcDest
;
WAVEFORMATEX
*
pwfx
;
HRESULT
hr
;
/* IAudioRenderClient */
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
ac
);
ok
(
hr
==
S_OK
,
"Activation failed with %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IAudioClient_GetMixFormat
(
ac
,
&
pwfx
);
ok
(
hr
==
S_OK
,
"GetMixFormat failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_Initialize
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
0
,
5000000
,
0
,
pwfx
,
NULL
);
ok
(
hr
==
S_OK
,
"Initialize failed: %08x
\n
"
,
hr
);
CoTaskMemFree
(
pwfx
);
hr
=
IAudioClient_GetService
(
ac
,
&
IID_IAudioRenderClient
,
(
void
**
)
&
rc
);
ok
(
hr
==
S_OK
,
"GetService failed: %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
IAudioClient_Release
(
ac
);
return
;
}
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
pStream
);
ok
(
hr
==
S_OK
,
"CreateStreamOnHGlobal failed 0x%08x
\n
"
,
hr
);
/* marshal IAudioClient */
hr
=
CoMarshalInterface
(
pStream
,
&
IID_IAudioClient
,
(
IUnknown
*
)
ac
,
MSHCTX_INPROC
,
NULL
,
MSHLFLAGS_NORMAL
);
ok
(
hr
==
S_OK
,
"CoMarshalInterface IAudioClient failed 0x%08x
\n
"
,
hr
);
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
hr
=
CoUnmarshalInterface
(
pStream
,
&
IID_IAudioClient
,
(
void
**
)
&
acDest
);
ok
(
hr
==
S_OK
,
"CoUnmarshalInterface IAudioClient failed 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IAudioClient_Release
(
acDest
);
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
/* marshal IAudioRenderClient */
hr
=
CoMarshalInterface
(
pStream
,
&
IID_IAudioRenderClient
,
(
IUnknown
*
)
rc
,
MSHCTX_INPROC
,
NULL
,
MSHLFLAGS_NORMAL
);
ok
(
hr
==
S_OK
,
"CoMarshalInterface IAudioRenderClient failed 0x%08x
\n
"
,
hr
);
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
hr
=
CoUnmarshalInterface
(
pStream
,
&
IID_IAudioRenderClient
,
(
void
**
)
&
rcDest
);
ok
(
hr
==
S_OK
,
"CoUnmarshalInterface IAudioRenderClient failed 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IAudioRenderClient_Release
(
rcDest
);
IStream_Release
(
pStream
);
IAudioClient_Release
(
ac
);
IAudioRenderClient_Release
(
rc
);
}
START_TEST
(
render
)
START_TEST
(
render
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -2186,6 +2253,7 @@ START_TEST(render)
...
@@ -2186,6 +2253,7 @@ START_TEST(render)
test_formats
(
AUDCLNT_SHAREMODE_EXCLUSIVE
);
test_formats
(
AUDCLNT_SHAREMODE_EXCLUSIVE
);
test_formats
(
AUDCLNT_SHAREMODE_SHARED
);
test_formats
(
AUDCLNT_SHAREMODE_SHARED
);
test_references
();
test_references
();
test_marshal
();
trace
(
"Output to a MS-DOS console is particularly slow and disturbs timing.
\n
"
);
trace
(
"Output to a MS-DOS console is particularly slow and disturbs timing.
\n
"
);
trace
(
"Please redirect output to a file.
\n
"
);
trace
(
"Please redirect output to a file.
\n
"
);
test_event
();
test_event
();
...
...
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