Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ed12a3de
Commit
ed12a3de
authored
Jan 12, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Jan 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Use Interlocked* instead of ++/-- in AddRef/Release.
- Use only stored result of Interlocked* in AddRef/Release. - Expand TRACEs to display the ref count.
parent
79ecb0d7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
75 deletions
+103
-75
audio.c
dlls/winmm/winealsa/audio.c
+22
-11
audio.c
dlls/winmm/wineaudioio/audio.c
+10
-8
dscapture.c
dlls/winmm/wineoss/dscapture.c
+35
-28
dsrender.c
dlls/winmm/wineoss/dsrender.c
+36
-28
No files found.
dlls/winmm/winealsa/audio.c
View file @
ed12a3de
...
...
@@ -2374,16 +2374,22 @@ static HRESULT WINAPI IDsDriverBufferImpl_QueryInterface(PIDSDRIVERBUFFER iface,
static
ULONG
WINAPI
IDsDriverBufferImpl_AddRef
(
PIDSDRIVERBUFFER
iface
)
{
IDsDriverBufferImpl
*
This
=
(
IDsDriverBufferImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
iface
);
return
++
This
->
ref
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsDriverBufferImpl_Release
(
PIDSDRIVERBUFFER
iface
)
{
IDsDriverBufferImpl
*
This
=
(
IDsDriverBufferImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
--
This
->
ref
)
return
This
->
ref
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
+
1
);
if
(
refCount
)
return
refCount
;
if
(
This
==
This
->
drv
->
primary
)
This
->
drv
->
primary
=
NULL
;
DSDB_DestroyMMAP
(
This
);
...
...
@@ -2560,17 +2566,22 @@ static HRESULT WINAPI IDsDriverImpl_QueryInterface(PIDSDRIVER iface, REFIID riid
static
ULONG
WINAPI
IDsDriverImpl_AddRef
(
PIDSDRIVER
iface
)
{
IDsDriverImpl
*
This
=
(
IDsDriverImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
iface
);
This
->
ref
++
;
return
This
->
ref
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsDriverImpl_Release
(
PIDSDRIVER
iface
)
{
IDsDriverImpl
*
This
=
(
IDsDriverImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
--
This
->
ref
)
return
This
->
ref
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
+
1
);
if
(
refCount
)
return
refCount
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
...
...
dlls/winmm/wineaudioio/audio.c
View file @
ed12a3de
...
...
@@ -1320,15 +1320,16 @@ static HRESULT WINAPI IDsDriverBufferImpl_QueryInterface(PIDSDRIVERBUFFER iface,
static
ULONG
WINAPI
IDsDriverBufferImpl_AddRef
(
PIDSDRIVERBUFFER
iface
)
{
IDsDriverBufferImpl
*
This
=
(
IDsDriverBufferImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IDsDriverBufferImpl_Release
(
PIDSDRIVERBUFFER
iface
)
{
IDsDriverBufferImpl
*
This
=
(
IDsDriverBufferImpl
*
)
iface
;
if
(
--
This
->
ref
)
return
This
->
ref
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
refCount
)
return
refCount
;
if
(
This
==
This
->
drv
->
primary
)
This
->
drv
->
primary
=
NULL
;
DSDB_UnmapPrimary
(
This
);
...
...
@@ -1479,15 +1480,16 @@ static HRESULT WINAPI IDsDriverImpl_QueryInterface(PIDSDRIVER iface, REFIID riid
static
ULONG
WINAPI
IDsDriverImpl_AddRef
(
PIDSDRIVER
iface
)
{
IDsDriverImpl
*
This
=
(
IDsDriverImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IDsDriverImpl_Release
(
PIDSDRIVER
iface
)
{
IDsDriverImpl
*
This
=
(
IDsDriverImpl
*
)
iface
;
if
(
--
This
->
ref
)
return
This
->
ref
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
refCount
)
return
refCount
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
...
...
dlls/winmm/wineoss/dscapture.c
View file @
ed12a3de
...
...
@@ -172,26 +172,28 @@ static ULONG WINAPI IDsCaptureDriverPropertySetImpl_AddRef(
PIDSDRIVERPROPERTYSET
iface
)
{
IDsCaptureDriverPropertySetImpl
*
This
=
(
IDsCaptureDriverPropertySetImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsCaptureDriverPropertySetImpl_Release
(
PIDSDRIVERPROPERTYSET
iface
)
{
IDsCaptureDriverPropertySetImpl
*
This
=
(
IDsCaptureDriverPropertySetImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
IDsCaptureDriverBuffer_Release
((
PIDSCDRIVERBUFFER
)
This
->
capture_buffer
);
This
->
capture_buffer
->
property_set
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsCaptureDriverPropertySetImpl_Get
(
...
...
@@ -274,26 +276,28 @@ static ULONG WINAPI IDsCaptureDriverNotifyImpl_AddRef(
PIDSDRIVERNOTIFY
iface
)
{
IDsCaptureDriverNotifyImpl
*
This
=
(
IDsCaptureDriverNotifyImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsCaptureDriverNotifyImpl_Release
(
PIDSDRIVERNOTIFY
iface
)
{
IDsCaptureDriverNotifyImpl
*
This
=
(
IDsCaptureDriverNotifyImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
IDsCaptureDriverBuffer_Release
((
PIDSCDRIVERBUFFER
)
This
->
capture_buffer
);
This
->
capture_buffer
->
notify
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsCaptureDriverNotifyImpl_SetNotificationPositions
(
...
...
@@ -421,19 +425,20 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_QueryInterface(
static
ULONG
WINAPI
IDsCaptureDriverBufferImpl_AddRef
(
PIDSCDRIVERBUFFER
iface
)
{
IDsCaptureDriverBufferImpl
*
This
=
(
IDsCaptureDriverBufferImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsCaptureDriverBufferImpl_Release
(
PIDSCDRIVERBUFFER
iface
)
{
IDsCaptureDriverBufferImpl
*
This
=
(
IDsCaptureDriverBufferImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
)
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
WINE_WAVEIN
*
wwi
;
wwi
=
&
WInDev
[
This
->
drv
->
wDevID
];
...
...
@@ -463,7 +468,7 @@ static ULONG WINAPI IDsCaptureDriverBufferImpl_Release(PIDSCDRIVERBUFFER iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsCaptureDriverBufferImpl_Lock
(
...
...
@@ -727,23 +732,25 @@ static HRESULT WINAPI IDsCaptureDriverImpl_QueryInterface(
static
ULONG
WINAPI
IDsCaptureDriverImpl_AddRef
(
PIDSCDRIVER
iface
)
{
IDsCaptureDriverImpl
*
This
=
(
IDsCaptureDriverImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
InterlockedIncrement
(
&
(
This
->
ref
))
;
return
refCount
;
}
static
ULONG
WINAPI
IDsCaptureDriverImpl_Release
(
PIDSCDRIVER
iface
)
{
IDsCaptureDriverImpl
*
This
=
(
IDsCaptureDriverImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsCaptureDriverImpl_GetDriverDesc
(
...
...
dlls/winmm/wineoss/dsrender.c
View file @
ed12a3de
...
...
@@ -165,24 +165,26 @@ static HRESULT WINAPI IDsDriverPropertySetImpl_QueryInterface(
static
ULONG
WINAPI
IDsDriverPropertySetImpl_AddRef
(
PIDSDRIVERPROPERTYSET
iface
)
{
IDsDriverPropertySetImpl
*
This
=
(
IDsDriverPropertySetImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsDriverPropertySetImpl_Release
(
PIDSDRIVERPROPERTYSET
iface
)
{
IDsDriverPropertySetImpl
*
This
=
(
IDsDriverPropertySetImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
IDsDriverBuffer_Release
((
PIDSDRIVERBUFFER
)
This
->
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsDriverPropertySetImpl_Get
(
...
...
@@ -261,25 +263,27 @@ static HRESULT WINAPI IDsDriverNotifyImpl_QueryInterface(
static
ULONG
WINAPI
IDsDriverNotifyImpl_AddRef
(
PIDSDRIVERNOTIFY
iface
)
{
IDsDriverNotifyImpl
*
This
=
(
IDsDriverNotifyImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsDriverNotifyImpl_Release
(
PIDSDRIVERNOTIFY
iface
)
{
IDsDriverNotifyImpl
*
This
=
(
IDsDriverNotifyImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
IDsDriverBuffer_Release
((
PIDSDRIVERBUFFER
)
This
->
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
notifies
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsDriverNotifyImpl_SetNotificationPositions
(
...
...
@@ -435,20 +439,22 @@ static HRESULT WINAPI IDsDriverBufferImpl_QueryInterface(PIDSDRIVERBUFFER iface,
static
ULONG
WINAPI
IDsDriverBufferImpl_AddRef
(
PIDSDRIVERBUFFER
iface
)
{
IDsDriverBufferImpl
*
This
=
(
IDsDriverBufferImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsDriverBufferImpl_Release
(
PIDSDRIVERBUFFER
iface
)
{
IDsDriverBufferImpl
*
This
=
(
IDsDriverBufferImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
)
return
ref
;
if
(
refCount
)
return
refCount
;
if
(
This
==
This
->
drv
->
primary
)
This
->
drv
->
primary
=
NULL
;
...
...
@@ -674,23 +680,25 @@ static HRESULT WINAPI IDsDriverImpl_QueryInterface(PIDSDRIVER iface, REFIID riid
static
ULONG
WINAPI
IDsDriverImpl_AddRef
(
PIDSDRIVER
iface
)
{
IDsDriverImpl
*
This
=
(
IDsDriverImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
}
static
ULONG
WINAPI
IDsDriverImpl_Release
(
PIDSDRIVER
iface
)
{
IDsDriverImpl
*
This
=
(
IDsDriverImpl
*
)
iface
;
DWORD
ref
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
refCount
+
1
);
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
!
refCount
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
Count
;
}
static
HRESULT
WINAPI
IDsDriverImpl_GetDriverDesc
(
PIDSDRIVER
iface
,
...
...
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