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
923af67f
Commit
923af67f
authored
Apr 21, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.media.devices: Link directly to combase.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
862684fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
45 deletions
+17
-45
Makefile.in
dlls/windows.media.devices/tests/Makefile.in
+1
-1
devices.c
dlls/windows.media.devices/tests/devices.c
+16
-44
No files found.
dlls/windows.media.devices/tests/Makefile.in
View file @
923af67f
TESTDLL
=
windows.media.devices.dll
TESTDLL
=
windows.media.devices.dll
IMPORTS
=
ole32
IMPORTS
=
combase
C_SRCS
=
\
C_SRCS
=
\
devices.c
devices.c
dlls/windows.media.devices/tests/devices.c
View file @
923af67f
...
@@ -37,13 +37,6 @@
...
@@ -37,13 +37,6 @@
#include "wine/test.h"
#include "wine/test.h"
static
HRESULT
(
WINAPI
*
pRoGetActivationFactory
)(
HSTRING
,
REFIID
,
void
**
);
static
HRESULT
(
WINAPI
*
pRoInitialize
)(
RO_INIT_TYPE
);
static
void
(
WINAPI
*
pRoUninitialize
)(
void
);
static
HRESULT
(
WINAPI
*
pWindowsCreateString
)(
LPCWSTR
,
UINT32
,
HSTRING
*
);
static
HRESULT
(
WINAPI
*
pWindowsDeleteString
)(
HSTRING
);
static
WCHAR
*
(
WINAPI
*
pWindowsGetStringRawBuffer
)(
HSTRING
,
UINT32
*
);
static
HRESULT
(
WINAPI
*
pActivateAudioInterfaceAsync
)(
const
WCHAR
*
path
,
static
HRESULT
(
WINAPI
*
pActivateAudioInterfaceAsync
)(
const
WCHAR
*
path
,
REFIID
riid
,
PROPVARIANT
*
params
,
REFIID
riid
,
PROPVARIANT
*
params
,
IActivateAudioInterfaceCompletionHandler
*
done_handler
,
IActivateAudioInterfaceCompletionHandler
*
done_handler
,
...
@@ -141,12 +134,12 @@ static void test_MediaDeviceStatics(void)
...
@@ -141,12 +134,12 @@ static void test_MediaDeviceStatics(void)
HRESULT
hr
;
HRESULT
hr
;
DWORD
dr
;
DWORD
dr
;
hr
=
p
WindowsCreateString
(
media_device_statics_name
,
wcslen
(
media_device_statics_name
),
&
str
);
hr
=
WindowsCreateString
(
media_device_statics_name
,
wcslen
(
media_device_statics_name
),
&
str
);
ok
(
hr
==
S_OK
,
"WindowsCreateString failed, hr %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"WindowsCreateString failed, hr %#x
\n
"
,
hr
);
hr
=
p
RoGetActivationFactory
(
str
,
&
IID_IActivationFactory
,
(
void
**
)
&
factory
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IActivationFactory
,
(
void
**
)
&
factory
);
ok
(
hr
==
S_OK
,
"RoGetActivationFactory failed, hr %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"RoGetActivationFactory failed, hr %#x
\n
"
,
hr
);
p
WindowsDeleteString
(
str
);
WindowsDeleteString
(
str
);
/* interface tests */
/* interface tests */
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IInspectable
,
(
void
**
)
&
inspectable
);
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IInspectable
,
(
void
**
)
&
inspectable
);
...
@@ -182,12 +175,12 @@ static void test_MediaDeviceStatics(void)
...
@@ -182,12 +175,12 @@ static void test_MediaDeviceStatics(void)
if
(
g_default_capture_id
)
if
(
g_default_capture_id
)
{
{
ok
(
wcsstr
(
p
WindowsGetStringRawBuffer
(
str
,
NULL
),
g_default_capture_id
)
!=
NULL
,
ok
(
wcsstr
(
WindowsGetStringRawBuffer
(
str
,
NULL
),
g_default_capture_id
)
!=
NULL
,
"Expected to find substring of default capture id in %s
\n
"
,
"Expected to find substring of default capture id in %s
\n
"
,
wine_dbgstr_w
(
p
WindowsGetStringRawBuffer
(
str
,
NULL
)));
wine_dbgstr_w
(
WindowsGetStringRawBuffer
(
str
,
NULL
)));
/* returned id does not work in GetDevice... */
/* returned id does not work in GetDevice... */
hr
=
IMMDeviceEnumerator_GetDevice
(
g_mmdevenum
,
p
WindowsGetStringRawBuffer
(
str
,
NULL
),
&
mmdev
);
hr
=
IMMDeviceEnumerator_GetDevice
(
g_mmdevenum
,
WindowsGetStringRawBuffer
(
str
,
NULL
),
&
mmdev
);
ok
(
hr
==
E_INVALIDARG
,
"GetDevice gave wrong error: %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"GetDevice gave wrong error: %08x
\n
"
,
hr
);
/* ...but does work in ActivateAudioInterfaceAsync */
/* ...but does work in ActivateAudioInterfaceAsync */
...
@@ -199,7 +192,7 @@ static void test_MediaDeviceStatics(void)
...
@@ -199,7 +192,7 @@ static void test_MediaDeviceStatics(void)
strcpy
(
async_activate_test
.
msg_pfx
,
"capture_activate"
);
strcpy
(
async_activate_test
.
msg_pfx
,
"capture_activate"
);
EnterCriticalSection
(
&
async_activate_test
.
lock
);
EnterCriticalSection
(
&
async_activate_test
.
lock
);
hr
=
pActivateAudioInterfaceAsync
(
p
WindowsGetStringRawBuffer
(
str
,
NULL
),
hr
=
pActivateAudioInterfaceAsync
(
WindowsGetStringRawBuffer
(
str
,
NULL
),
&
IID_IAudioClient2
,
NULL
,
&
async_activate_done
,
&
async_activate_test
.
op
);
&
IID_IAudioClient2
,
NULL
,
&
async_activate_done
,
&
async_activate_test
.
op
);
ok
(
hr
==
S_OK
,
"ActivateAudioInterfaceAsync failed: %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ActivateAudioInterfaceAsync failed: %08x
\n
"
,
hr
);
LeaveCriticalSection
(
&
async_activate_test
.
lock
);
LeaveCriticalSection
(
&
async_activate_test
.
lock
);
...
@@ -212,7 +205,7 @@ static void test_MediaDeviceStatics(void)
...
@@ -212,7 +205,7 @@ static void test_MediaDeviceStatics(void)
ok
(
async_activate_test
.
result_iface
!=
NULL
,
"Expected to get WASAPI interface, but got NULL
\n
"
);
ok
(
async_activate_test
.
result_iface
!=
NULL
,
"Expected to get WASAPI interface, but got NULL
\n
"
);
IUnknown_Release
(
async_activate_test
.
result_iface
);
IUnknown_Release
(
async_activate_test
.
result_iface
);
p
WindowsDeleteString
(
str
);
WindowsDeleteString
(
str
);
}
}
/* test default render device creation */
/* test default render device creation */
...
@@ -223,12 +216,12 @@ static void test_MediaDeviceStatics(void)
...
@@ -223,12 +216,12 @@ static void test_MediaDeviceStatics(void)
if
(
g_default_render_id
)
if
(
g_default_render_id
)
{
{
ok
(
wcsstr
(
p
WindowsGetStringRawBuffer
(
str
,
NULL
),
g_default_render_id
)
!=
NULL
,
ok
(
wcsstr
(
WindowsGetStringRawBuffer
(
str
,
NULL
),
g_default_render_id
)
!=
NULL
,
"Expected to find substring of default render id in %s
\n
"
,
"Expected to find substring of default render id in %s
\n
"
,
wine_dbgstr_w
(
p
WindowsGetStringRawBuffer
(
str
,
NULL
)));
wine_dbgstr_w
(
WindowsGetStringRawBuffer
(
str
,
NULL
)));
/* returned id does not work in GetDevice... */
/* returned id does not work in GetDevice... */
hr
=
IMMDeviceEnumerator_GetDevice
(
g_mmdevenum
,
p
WindowsGetStringRawBuffer
(
str
,
NULL
),
&
mmdev
);
hr
=
IMMDeviceEnumerator_GetDevice
(
g_mmdevenum
,
WindowsGetStringRawBuffer
(
str
,
NULL
),
&
mmdev
);
ok
(
hr
==
E_INVALIDARG
,
"GetDevice gave wrong error: %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"GetDevice gave wrong error: %08x
\n
"
,
hr
);
/* ...but does work in ActivateAudioInterfaceAsync */
/* ...but does work in ActivateAudioInterfaceAsync */
...
@@ -240,7 +233,7 @@ static void test_MediaDeviceStatics(void)
...
@@ -240,7 +233,7 @@ static void test_MediaDeviceStatics(void)
strcpy
(
async_activate_test
.
msg_pfx
,
"render_activate"
);
strcpy
(
async_activate_test
.
msg_pfx
,
"render_activate"
);
EnterCriticalSection
(
&
async_activate_test
.
lock
);
EnterCriticalSection
(
&
async_activate_test
.
lock
);
hr
=
pActivateAudioInterfaceAsync
(
p
WindowsGetStringRawBuffer
(
str
,
NULL
),
hr
=
pActivateAudioInterfaceAsync
(
WindowsGetStringRawBuffer
(
str
,
NULL
),
&
IID_IAudioClient2
,
NULL
,
&
async_activate_done
,
&
async_activate_test
.
op
);
&
IID_IAudioClient2
,
NULL
,
&
async_activate_done
,
&
async_activate_test
.
op
);
ok
(
hr
==
S_OK
,
"ActivateAudioInterfaceAsync failed: %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ActivateAudioInterfaceAsync failed: %08x
\n
"
,
hr
);
LeaveCriticalSection
(
&
async_activate_test
.
lock
);
LeaveCriticalSection
(
&
async_activate_test
.
lock
);
...
@@ -253,7 +246,7 @@ static void test_MediaDeviceStatics(void)
...
@@ -253,7 +246,7 @@ static void test_MediaDeviceStatics(void)
ok
(
async_activate_test
.
result_iface
!=
NULL
,
"Expected to get WASAPI interface, but got NULL
\n
"
);
ok
(
async_activate_test
.
result_iface
!=
NULL
,
"Expected to get WASAPI interface, but got NULL
\n
"
);
IUnknown_Release
(
async_activate_test
.
result_iface
);
IUnknown_Release
(
async_activate_test
.
result_iface
);
p
WindowsDeleteString
(
str
);
WindowsDeleteString
(
str
);
}
}
/* cleanup */
/* cleanup */
...
@@ -264,31 +257,10 @@ static void test_MediaDeviceStatics(void)
...
@@ -264,31 +257,10 @@ static void test_MediaDeviceStatics(void)
START_TEST
(
devices
)
START_TEST
(
devices
)
{
{
HMODULE
combase
,
mmdevapi
;
HMODULE
mmdevapi
;
IMMDevice
*
mmdev
;
IMMDevice
*
mmdev
;
HRESULT
hr
;
HRESULT
hr
;
if
(
!
(
combase
=
LoadLibraryW
(
L"combase.dll"
)))
{
win_skip
(
"Failed to load combase.dll, skipping tests
\n
"
);
return
;
}
#define LOAD_FUNCPTR(x) \
if (!(p##x = (void*)GetProcAddress(combase, #x))) \
{ \
win_skip("Failed to find %s in combase.dll, skipping tests.\n", #x); \
return; \
}
LOAD_FUNCPTR
(
RoGetActivationFactory
);
LOAD_FUNCPTR
(
RoInitialize
);
LOAD_FUNCPTR
(
RoUninitialize
);
LOAD_FUNCPTR
(
WindowsCreateString
);
LOAD_FUNCPTR
(
WindowsDeleteString
);
LOAD_FUNCPTR
(
WindowsGetStringRawBuffer
);
#undef LOAD_FUNCPTR
if
(
!
(
mmdevapi
=
LoadLibraryW
(
L"mmdevapi.dll"
)))
if
(
!
(
mmdevapi
=
LoadLibraryW
(
L"mmdevapi.dll"
)))
{
{
win_skip
(
"Failed to load mmdevapi.dll, skipping tests
\n
"
);
win_skip
(
"Failed to load mmdevapi.dll, skipping tests
\n
"
);
...
@@ -305,7 +277,7 @@ START_TEST(devices)
...
@@ -305,7 +277,7 @@ START_TEST(devices)
LOAD_FUNCPTR
(
ActivateAudioInterfaceAsync
);
LOAD_FUNCPTR
(
ActivateAudioInterfaceAsync
);
#undef LOAD_FUNCPTR
#undef LOAD_FUNCPTR
hr
=
p
RoInitialize
(
RO_INIT_MULTITHREADED
);
hr
=
RoInitialize
(
RO_INIT_MULTITHREADED
);
ok
(
hr
==
S_OK
,
"RoInitialize failed, hr %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"RoInitialize failed, hr %#x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_MMDeviceEnumerator
,
NULL
,
hr
=
CoCreateInstance
(
&
CLSID_MMDeviceEnumerator
,
NULL
,
...
@@ -340,5 +312,5 @@ START_TEST(devices)
...
@@ -340,5 +312,5 @@ START_TEST(devices)
CoTaskMemFree
(
g_default_render_id
);
CoTaskMemFree
(
g_default_render_id
);
IMMDeviceEnumerator_Release
(
g_mmdevenum
);
IMMDeviceEnumerator_Release
(
g_mmdevenum
);
p
RoUninitialize
();
RoUninitialize
();
}
}
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