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
223105b9
Commit
223105b9
authored
Aug 15, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Use proper helpers for iface calls.
parent
ee40973b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
51 deletions
+51
-51
devenum.c
dlls/mmdevapi/devenum.c
+1
-1
main.c
dlls/mmdevapi/main.c
+3
-3
capture.c
dlls/mmdevapi/tests/capture.c
+1
-1
dependency.c
dlls/mmdevapi/tests/dependency.c
+4
-4
mmdevenum.c
dlls/mmdevapi/tests/mmdevenum.c
+20
-20
propstore.c
dlls/mmdevapi/tests/propstore.c
+1
-1
render.c
dlls/mmdevapi/tests/render.c
+21
-21
No files found.
dlls/mmdevapi/devenum.c
View file @
223105b9
...
...
@@ -1024,7 +1024,7 @@ static HRESULT WINAPI MMDevEnum_GetDevice(IMMDeviceEnumerator *iface, const WCHA
if
(
str
&&
!
lstrcmpW
(
str
,
name
))
{
CoTaskMemFree
(
str
);
I
Unknown
_AddRef
(
dev
);
I
MMDevice
_AddRef
(
dev
);
*
device
=
dev
;
return
S_OK
;
}
...
...
dlls/mmdevapi/main.c
View file @
223105b9
...
...
@@ -203,7 +203,7 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
}
static
HRESULT
WINAPI
MMCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
MMCF_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
*
*
ppobj
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
...
...
@@ -213,7 +213,7 @@ MMCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
IsEqualIID
(
riid
,
&
IID_IClassFactory
))
{
*
ppobj
=
iface
;
I
Unknown
_AddRef
(
iface
);
I
ClassFactory
_AddRef
(
iface
);
return
S_OK
;
}
*
ppobj
=
NULL
;
...
...
@@ -296,7 +296,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
for
(
i
=
0
;
i
<
sizeof
(
MMDEVAPI_CF
)
/
sizeof
(
MMDEVAPI_CF
[
0
]);
++
i
)
{
if
(
IsEqualGUID
(
rclsid
,
MMDEVAPI_CF
[
i
].
rclsid
))
{
I
Unknown
_AddRef
(
&
MMDEVAPI_CF
[
i
].
IClassFactory_iface
);
I
ClassFactory
_AddRef
(
&
MMDEVAPI_CF
[
i
].
IClassFactory_iface
);
*
ppv
=
&
MMDEVAPI_CF
[
i
];
return
S_OK
;
}
...
...
dlls/mmdevapi/tests/capture.c
View file @
223105b9
...
...
@@ -442,7 +442,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
I
Unknown
_Release
(
acc
);
I
AudioCaptureClient
_Release
(
acc
);
}
static
void
test_audioclient
(
void
)
...
...
dlls/mmdevapi/tests/dependency.c
View file @
223105b9
...
...
@@ -78,7 +78,7 @@ START_TEST(dependency)
ok
(
ds8
!=
NULL
,
"ds8 pointer is null
\n
"
);
}
if
(
ds8
)
I
Unknown
_Release
(
ds8
);
I
DirectSound8
_Release
(
ds8
);
ok
(
!
GetModuleHandle
(
"quartz.dll"
),
"quartz.dll was already loaded!
\n
"
);
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IBaseFilter
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
bf
);
...
...
@@ -99,11 +99,11 @@ START_TEST(dependency)
cleanup
:
if
(
bf
)
I
Unknown
_Release
(
bf
);
I
BaseFilter
_Release
(
bf
);
if
(
dev
)
I
Unknown
_Release
(
dev
);
I
MMDevice
_Release
(
dev
);
if
(
mme
)
I
Unknown
_Release
(
mme
);
I
MMDeviceEnumerator
_Release
(
mme
);
CoUninitialize
();
}
dlls/mmdevapi/tests/mmdevenum.c
View file @
223105b9
...
...
@@ -44,34 +44,34 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col)
IMMDevice
*
dev
;
/* collection doesn't keep a ref on parent */
I
Unknown
_AddRef
(
mme
);
ref
=
I
Unknown
_Release
(
mme
);
I
MMDeviceEnumerator
_AddRef
(
mme
);
ref
=
I
MMDeviceEnumerator
_Release
(
mme
);
ok
(
ref
==
2
,
"Reference count on parent is %u
\n
"
,
ref
);
ref
=
I
Unknow
n_AddRef
(
col
);
I
Unknow
n_Release
(
col
);
ref
=
I
MMDeviceCollectio
n_AddRef
(
col
);
I
MMDeviceCollectio
n_Release
(
col
);
ok
(
ref
==
2
,
"Invalid reference count %u on collection
\n
"
,
ref
);
hr
=
I
Unknow
n_QueryInterface
(
col
,
&
IID_IUnknown
,
NULL
);
hr
=
I
MMDeviceCollectio
n_QueryInterface
(
col
,
&
IID_IUnknown
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Null ppv returns %08x
\n
"
,
hr
);
hr
=
I
Unknow
n_QueryInterface
(
col
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
hr
=
I
MMDeviceCollectio
n_QueryInterface
(
col
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Cannot query for IID_IUnknown: 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
((
LONG_PTR
)
col
==
(
LONG_PTR
)
unk
,
"Pointers are not identical %p/%p/%p
\n
"
,
col
,
unk
,
mme
);
ok
((
IUnknown
*
)
col
==
unk
,
"Pointers are not identical %p/%p/%p
\n
"
,
col
,
unk
,
mme
);
IUnknown_Release
(
unk
);
}
hr
=
I
Unknow
n_QueryInterface
(
col
,
&
IID_IMMDeviceCollection
,
(
void
**
)
&
col2
);
hr
=
I
MMDeviceCollectio
n_QueryInterface
(
col
,
&
IID_IMMDeviceCollection
,
(
void
**
)
&
col2
);
ok
(
hr
==
S_OK
,
"Cannot query for IID_IMMDeviceCollection: 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
I
Unknow
n_Release
(
col2
);
I
MMDeviceCollectio
n_Release
(
col2
);
hr
=
I
Unknow
n_QueryInterface
(
col
,
&
IID_IMMDeviceEnumerator
,
(
void
**
)
&
mme2
);
hr
=
I
MMDeviceCollectio
n_QueryInterface
(
col
,
&
IID_IMMDeviceEnumerator
,
(
void
**
)
&
mme2
);
ok
(
hr
==
E_NOINTERFACE
,
"Query for IID_IMMDeviceEnumerator returned: 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
I
Unknown
_Release
(
mme2
);
I
MMDeviceEnumerator
_Release
(
mme2
);
hr
=
IMMDeviceCollection_GetCount
(
col
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetCount returned 0x%08x
\n
"
,
hr
);
...
...
@@ -113,9 +113,9 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col)
}
}
if
(
dev
)
I
Unknown
_Release
(
dev
);
I
MMDevice
_Release
(
dev
);
}
I
Unknow
n_Release
(
col
);
I
MMDeviceCollectio
n_Release
(
col
);
}
/* Only do parameter tests here, the actual MMDevice testing should be a separate test */
...
...
@@ -139,11 +139,11 @@ START_TEST(mmdevenum)
}
/* Odd behavior.. bug? */
ref
=
I
Unknown
_AddRef
(
mme
);
ref
=
I
MMDeviceEnumerator
_AddRef
(
mme
);
ok
(
ref
==
3
,
"Invalid reference count after incrementing: %u
\n
"
,
ref
);
I
Unknown
_Release
(
mme
);
I
MMDeviceEnumerator
_Release
(
mme
);
hr
=
I
Unknown
_QueryInterface
(
mme
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
hr
=
I
MMDeviceEnumerator
_QueryInterface
(
mme
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"returned 0x%08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
...
...
@@ -153,13 +153,13 @@ START_TEST(mmdevenum)
/* Proving that it is static.. */
hr
=
CoCreateInstance
(
&
CLSID_MMDeviceEnumerator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMMDeviceEnumerator
,
(
void
**
)
&
mme2
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed: 0x%08x
\n
"
,
hr
);
I
Unknown
_Release
(
mme2
);
I
MMDeviceEnumerator
_Release
(
mme2
);
ok
(
mme
==
mme2
,
"Pointers are not equal!
\n
"
);
hr
=
I
Unknown
_QueryInterface
(
mme
,
&
IID_IUnknown
,
NULL
);
hr
=
I
MMDeviceEnumerator
_QueryInterface
(
mme
,
&
IID_IUnknown
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Null pointer on QueryInterface returned %08x
\n
"
,
hr
);
hr
=
I
Unknown
_QueryInterface
(
mme
,
&
GUID_NULL
,
(
void
**
)
&
unk
);
hr
=
I
MMDeviceEnumerator
_QueryInterface
(
mme
,
&
GUID_NULL
,
(
void
**
)
&
unk
);
ok
(
!
unk
,
"Unk not reset to null after invalid QI
\n
"
);
ok
(
hr
==
E_NOINTERFACE
,
"Invalid hr %08x returned on IID_NULL
\n
"
,
hr
);
...
...
@@ -192,5 +192,5 @@ START_TEST(mmdevenum)
test_collection
(
mme
,
col
);
}
I
Unknown
_Release
(
mme
);
I
MMDeviceEnumerator
_Release
(
mme
);
}
dlls/mmdevapi/tests/propstore.c
View file @
223105b9
...
...
@@ -132,6 +132,6 @@ START_TEST(propstore)
IMMDevice_Release
(
dev
);
cleanup
:
if
(
mme
)
I
Unknown
_Release
(
mme
);
I
MMDeviceEnumerator
_Release
(
mme
);
CoUninitialize
();
}
dlls/mmdevapi/tests/render.c
View file @
223105b9
...
...
@@ -1378,25 +1378,25 @@ static void test_session(void)
hr
=
IAudioClient_GetService
(
ses1_ac1
,
&
IID_IAudioSessionControl
,
(
void
**
)
&
ses1_ctl2
);
ok
(
hr
==
S_OK
,
"GetService failed: %08x
\n
"
,
hr
);
ok
(
ses1_ctl
==
ses1_ctl2
,
"Got different controls: %p %p
\n
"
,
ses1_ctl
,
ses1_ctl2
);
ref
=
IAudioSessionControl_Release
(
ses1_ctl2
);
ref
=
IAudioSessionControl
2
_Release
(
ses1_ctl2
);
ok
(
ref
!=
0
,
"AudioSessionControl was destroyed
\n
"
);
hr
=
IAudioClient_GetService
(
ses1_ac2
,
&
IID_IAudioSessionControl
,
(
void
**
)
&
ses1_ctl2
);
ok
(
hr
==
S_OK
,
"GetService failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl
,
NULL
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl
,
NULL
);
ok
(
hr
==
NULL_PTR_ERR
,
"GetState gave wrong error: %08x
\n
"
,
hr
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl2
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl2
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
if
(
cap_ctl
){
hr
=
IAudioSessionControl_GetState
(
cap_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
cap_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
}
...
...
@@ -1404,16 +1404,16 @@ static void test_session(void)
hr
=
IAudioClient_Start
(
ses1_ac1
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateActive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl2
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl2
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateActive
,
"Got wrong state: %d
\n
"
,
state
);
if
(
cap_ctl
){
hr
=
IAudioSessionControl_GetState
(
cap_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
cap_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
}
...
...
@@ -1421,57 +1421,57 @@ static void test_session(void)
hr
=
IAudioClient_Stop
(
ses1_ac1
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl2
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl2
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
if
(
cap_ctl
){
hr
=
IAudioSessionControl_GetState
(
cap_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
cap_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioClient_Start
(
cap_ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl2
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl2
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
cap_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
cap_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateActive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioClient_Stop
(
cap_ac
);
ok
(
hr
==
S_OK
,
"Stop failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
ses1_ctl2
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl2
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
hr
=
IAudioSessionControl_GetState
(
cap_ctl
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
cap_ctl
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
ref
=
IAudioSessionControl_Release
(
cap_ctl
);
ref
=
IAudioSessionControl
2
_Release
(
cap_ctl
);
ok
(
ref
==
0
,
"AudioSessionControl wasn't released: %u
\n
"
,
ref
);
ref
=
IAudioClient_Release
(
cap_ac
);
ok
(
ref
==
0
,
"AudioClient wasn't released: %u
\n
"
,
ref
);
}
ref
=
IAudioSessionControl_Release
(
ses1_ctl
);
ref
=
IAudioSessionControl
2
_Release
(
ses1_ctl
);
ok
(
ref
==
0
,
"AudioSessionControl wasn't released: %u
\n
"
,
ref
);
ref
=
IAudioClient_Release
(
ses1_ac1
);
...
...
@@ -1481,11 +1481,11 @@ static void test_session(void)
ok
(
ref
==
1
,
"AudioClient had wrong refcount: %u
\n
"
,
ref
);
/* we've released all of our IAudioClient references, so check GetState */
hr
=
IAudioSessionControl_GetState
(
ses1_ctl2
,
&
state
);
hr
=
IAudioSessionControl
2
_GetState
(
ses1_ctl2
,
&
state
);
ok
(
hr
==
S_OK
,
"GetState failed: %08x
\n
"
,
hr
);
ok
(
state
==
AudioSessionStateInactive
,
"Got wrong state: %d
\n
"
,
state
);
ref
=
IAudioSessionControl_Release
(
ses1_ctl2
);
ref
=
IAudioSessionControl
2
_Release
(
ses1_ctl2
);
ok
(
ref
==
0
,
"AudioSessionControl wasn't released: %u
\n
"
,
ref
);
CoTaskMemFree
(
pwfx
);
...
...
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