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
a93efd53
Commit
a93efd53
authored
Jun 20, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Jun 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Fix refcounts in IAudioClient::GetService.
parent
f50829c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
16 deletions
+42
-16
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+12
-4
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+18
-8
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+12
-4
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
a93efd53
...
...
@@ -1666,16 +1666,20 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
}
IAudioRenderClient_AddRef
(
&
This
->
IAudioRenderClient_iface
);
*
ppv
=
&
This
->
IAudioRenderClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
)){
if
(
This
->
dataflow
!=
eCapture
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
}
IAudioCaptureClient_AddRef
(
&
This
->
IAudioCaptureClient_iface
);
*
ppv
=
&
This
->
IAudioCaptureClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClock
)){
IAudioClock_AddRef
(
&
This
->
IAudioClock_iface
);
*
ppv
=
&
This
->
IAudioClock_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioStreamVolume
)){
IAudioStreamVolume_AddRef
(
&
This
->
IAudioStreamVolume_iface
);
*
ppv
=
&
This
->
IAudioStreamVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
)){
if
(
!
This
->
session_wrapper
){
...
...
@@ -1684,7 +1688,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
IAudioSessionControl2_AddRef
(
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
);
*
ppv
=
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
)){
...
...
@@ -1694,7 +1699,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
IChannelAudioVolume_AddRef
(
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
);
*
ppv
=
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
)){
...
...
@@ -1704,13 +1710,13 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
ISimpleAudioVolume_AddRef
(
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
);
*
ppv
=
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
;
}
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
LeaveCriticalSection
(
&
This
->
lock
);
return
S_OK
;
}
...
...
@@ -2245,6 +2251,8 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret
->
ISimpleAudioVolume_iface
.
lpVtbl
=
&
SimpleAudioVolume_Vtbl
;
ret
->
IChannelAudioVolume_iface
.
lpVtbl
=
&
ChannelAudioVolume_Vtbl
;
ret
->
ref
=
1
;
ret
->
client
=
client
;
if
(
client
){
ret
->
session
=
client
->
session
;
...
...
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
a93efd53
...
...
@@ -1459,16 +1459,20 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
OSSpinLockUnlock
(
&
This
->
lock
);
return
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
}
IAudioRenderClient_AddRef
(
&
This
->
IAudioRenderClient_iface
);
*
ppv
=
&
This
->
IAudioRenderClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
)){
if
(
This
->
dataflow
!=
eCapture
){
OSSpinLockUnlock
(
&
This
->
lock
);
return
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
}
IAudioCaptureClient_AddRef
(
&
This
->
IAudioCaptureClient_iface
);
*
ppv
=
&
This
->
IAudioCaptureClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClock
)){
IAudioClock_AddRef
(
&
This
->
IAudioClock_iface
);
*
ppv
=
&
This
->
IAudioClock_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioStreamVolume
)){
IAudioStreamVolume_AddRef
(
&
This
->
IAudioStreamVolume_iface
);
*
ppv
=
&
This
->
IAudioStreamVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
)){
if
(
!
This
->
session_wrapper
){
...
...
@@ -1477,7 +1481,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
OSSpinLockUnlock
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
IAudioSessionControl2_AddRef
(
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
);
*
ppv
=
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
)){
...
...
@@ -1487,7 +1492,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
OSSpinLockUnlock
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
IChannelAudioVolume_AddRef
(
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
);
*
ppv
=
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
)){
...
...
@@ -1497,13 +1503,13 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
OSSpinLockUnlock
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
ISimpleAudioVolume_AddRef
(
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
);
*
ppv
=
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
;
}
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
OSSpinLockUnlock
(
&
This
->
lock
);
return
S_OK
;
}
...
...
@@ -2035,6 +2041,8 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret
->
ISimpleAudioVolume_iface
.
lpVtbl
=
&
SimpleAudioVolume_Vtbl
;
ret
->
IChannelAudioVolume_iface
.
lpVtbl
=
&
ChannelAudioVolume_Vtbl
;
ret
->
ref
=
1
;
ret
->
client
=
client
;
if
(
client
){
ret
->
session
=
client
->
session
;
...
...
@@ -2082,10 +2090,12 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) Refcount now %u
\n
"
,
This
,
ref
);
if
(
!
ref
){
OSSpinLockLock
(
&
This
->
client
->
lock
);
This
->
client
->
session_wrapper
=
NULL
;
OSSpinLockUnlock
(
&
This
->
client
->
lock
);
AudioClient_Release
(
&
This
->
client
->
IAudioClient_iface
);
if
(
This
->
client
){
OSSpinLockLock
(
&
This
->
client
->
lock
);
This
->
client
->
session_wrapper
=
NULL
;
OSSpinLockUnlock
(
&
This
->
client
->
lock
);
AudioClient_Release
(
&
This
->
client
->
IAudioClient_iface
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
...
...
dlls/wineoss.drv/mmdevdrv.c
View file @
a93efd53
...
...
@@ -1381,16 +1381,20 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
}
IAudioRenderClient_AddRef
(
&
This
->
IAudioRenderClient_iface
);
*
ppv
=
&
This
->
IAudioRenderClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
)){
if
(
This
->
dataflow
!=
eCapture
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
}
IAudioCaptureClient_AddRef
(
&
This
->
IAudioCaptureClient_iface
);
*
ppv
=
&
This
->
IAudioCaptureClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClock
)){
IAudioClock_AddRef
(
&
This
->
IAudioClock_iface
);
*
ppv
=
&
This
->
IAudioClock_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioStreamVolume
)){
IAudioStreamVolume_AddRef
(
&
This
->
IAudioStreamVolume_iface
);
*
ppv
=
&
This
->
IAudioStreamVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
)){
if
(
!
This
->
session_wrapper
){
...
...
@@ -1399,7 +1403,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
IAudioSessionControl2_AddRef
(
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
);
*
ppv
=
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
)){
...
...
@@ -1409,7 +1414,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
IChannelAudioVolume_AddRef
(
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
);
*
ppv
=
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
)){
...
...
@@ -1419,13 +1425,13 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
LeaveCriticalSection
(
&
This
->
lock
);
return
E_OUTOFMEMORY
;
}
}
}
else
ISimpleAudioVolume_AddRef
(
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
);
*
ppv
=
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
;
}
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
LeaveCriticalSection
(
&
This
->
lock
);
return
S_OK
;
}
...
...
@@ -1951,6 +1957,8 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret
->
ISimpleAudioVolume_iface
.
lpVtbl
=
&
SimpleAudioVolume_Vtbl
;
ret
->
IChannelAudioVolume_iface
.
lpVtbl
=
&
ChannelAudioVolume_Vtbl
;
ret
->
ref
=
1
;
ret
->
client
=
client
;
if
(
client
){
ret
->
session
=
client
->
session
;
...
...
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