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
a565c0fa
Commit
a565c0fa
authored
Jul 19, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Rename the DirectSound object refcount to "numIfaces".
parent
4992e6a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
35 deletions
+17
-35
dsound.c
dlls/dsound/dsound.c
+17
-35
No files found.
dlls/dsound/dsound.c
View file @
a565c0fa
...
...
@@ -77,9 +77,8 @@ static ULONG WINAPI IDirectSound8_IDirectSound8_AddRef(LPDIRECTSOUND8 iface);
*/
struct
IDirectSoundImpl
{
LONG
ref
;
DirectSoundDevice
*
device
;
LONG
numIfaces
;
DirectSoundDevice
*
device
;
BOOL
has_ds8
;
LPUNKNOWN
pUnknown
;
LPDIRECTSOUND
pDS
;
...
...
@@ -217,29 +216,12 @@ static HRESULT DSOUND_QueryInterface(
return
E_NOINTERFACE
;
}
static
ULONG
IDirectSoundImpl_AddRef
(
LPDIRECTSOUND8
iface
)
{
IDirectSoundImpl
*
This
=
(
IDirectSoundImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
static
ULONG
IDirectSoundImpl_Release
(
LPDIRECTSOUND8
iface
)
static
void
directsound_destroy
(
IDirectSoundImpl
*
This
)
{
IDirectSoundImpl
*
This
=
(
IDirectSoundImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
if
(
This
->
device
)
DirectSoundDevice_Release
(
This
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
if
(
This
->
device
)
DirectSoundDevice_Release
(
This
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
static
HRESULT
IDirectSoundImpl_Create
(
IDirectSound8
**
ppDS
,
BOOL
has_ds8
)
...
...
@@ -255,7 +237,7 @@ static HRESULT IDirectSoundImpl_Create(IDirectSound8 **ppDS, BOOL has_ds8)
return
DSERR_OUTOFMEMORY
;
}
pDS
->
ref
=
0
;
pDS
->
numIfaces
=
0
;
pDS
->
device
=
NULL
;
pDS
->
has_ds8
=
has_ds8
;
...
...
@@ -292,9 +274,9 @@ static ULONG WINAPI IDirectSound_IUnknown_Release(
IDirectSound_IUnknown
*
This
=
(
IDirectSound_IUnknown
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
if
(
!
ref
&&
!
InterlockedDecrement
(
&
((
IDirectSoundImpl
*
)
This
->
pds
)
->
numIfaces
)
)
{
((
IDirectSoundImpl
*
)
This
->
pds
)
->
pUnknown
=
NULL
;
IDirectSoundImpl_Release
(
This
->
pds
);
directsound_destroy
((
IDirectSoundImpl
*
)
This
->
pds
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
...
...
@@ -337,7 +319,7 @@ static HRESULT IDirectSound_IUnknown_Create(
pdsunk
->
ref
=
0
;
pdsunk
->
pds
=
pds
;
I
DirectSoundImpl_AddRef
(
pd
s
);
I
nterlockedIncrement
(
&
((
IDirectSoundImpl
*
)
pds
)
->
numIface
s
);
*
ppunk
=
(
LPUNKNOWN
)
pdsunk
;
return
DS_OK
;
...
...
@@ -371,9 +353,9 @@ static ULONG WINAPI IDirectSound_IDirectSound_Release(
IDirectSound_IDirectSound
*
This
=
(
IDirectSound_IDirectSound
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
if
(
!
ref
&&
!
InterlockedDecrement
(
&
((
IDirectSoundImpl
*
)
This
->
pds
)
->
numIfaces
)
)
{
((
IDirectSoundImpl
*
)
This
->
pds
)
->
pDS
=
NULL
;
IDirectSoundImpl_Release
(
This
->
pds
);
directsound_destroy
((
IDirectSoundImpl
*
)
This
->
pds
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
...
...
@@ -499,7 +481,7 @@ static HRESULT IDirectSound_IDirectSound_Create(
pdsds
->
ref
=
0
;
pdsds
->
pds
=
pds
;
I
DirectSoundImpl_AddRef
(
pd
s
);
I
nterlockedIncrement
(
&
((
IDirectSoundImpl
*
)
pds
)
->
numIface
s
);
*
ppds
=
(
LPDIRECTSOUND
)
pdsds
;
return
DS_OK
;
...
...
@@ -533,9 +515,9 @@ static ULONG WINAPI IDirectSound8_IDirectSound8_Release(
IDirectSound8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
if
(
!
ref
&&
!
InterlockedDecrement
(
&
((
IDirectSoundImpl
*
)
This
->
pds
)
->
numIfaces
)
)
{
((
IDirectSoundImpl
*
)
This
->
pds
)
->
pDS8
=
NULL
;
IDirectSoundImpl_Release
(
This
->
pds
);
directsound_destroy
((
IDirectSoundImpl
*
)
This
->
pds
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
...
...
@@ -671,7 +653,7 @@ static HRESULT IDirectSound8_IDirectSound8_Create(
pdsds
->
ref
=
0
;
pdsds
->
pds
=
pds
;
I
DirectSoundImpl_AddRef
(
pd
s
);
I
nterlockedIncrement
(
&
((
IDirectSoundImpl
*
)
pds
)
->
numIface
s
);
*
ppds
=
(
LPDIRECTSOUND8
)
pdsds
;
return
DS_OK
;
...
...
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