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
7b6b24d8
Commit
7b6b24d8
authored
Jan 21, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Use Interlocked* functions in AddRef and Release.
- Store the result of the Interlocked functions and use only this.
parent
eb23257b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
16 deletions
+31
-16
d3dxbuffer.c
dlls/d3dx8/d3dxbuffer.c
+9
-4
band.c
dlls/dmband/band.c
+9
-4
bandtrack.c
dlls/dmband/bandtrack.c
+9
-4
dmband_main.c
dlls/dmband/dmband_main.c
+4
-4
No files found.
dlls/d3dx8/d3dxbuffer.c
View file @
7b6b24d8
...
@@ -51,14 +51,19 @@ HRESULT WINAPI ID3DXBufferImpl_QueryInterface(LPD3DXBUFFER iface, REFIID riid, L
...
@@ -51,14 +51,19 @@ HRESULT WINAPI ID3DXBufferImpl_QueryInterface(LPD3DXBUFFER iface, REFIID riid, L
ULONG
WINAPI
ID3DXBufferImpl_AddRef
(
LPD3DXBUFFER
iface
)
{
ULONG
WINAPI
ID3DXBufferImpl_AddRef
(
LPD3DXBUFFER
iface
)
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
return
++
(
This
->
ref
);
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
}
ULONG
WINAPI
ID3DXBufferImpl_Release
(
LPD3DXBUFFER
iface
)
{
ULONG
WINAPI
ID3DXBufferImpl_Release
(
LPD3DXBUFFER
iface
)
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
dlls/dmband/band.c
View file @
7b6b24d8
...
@@ -56,14 +56,19 @@ HRESULT WINAPI IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface, RE
...
@@ -56,14 +56,19 @@ HRESULT WINAPI IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface, RE
ULONG
WINAPI
IDirectMusicBandImpl_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ULONG
WINAPI
IDirectMusicBandImpl_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicBandImpl
,
UnknownVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicBandImpl
,
UnknownVtbl
,
iface
);
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
return
++
(
This
->
ref
);
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
}
ULONG
WINAPI
IDirectMusicBandImpl_IUnknown_Release
(
LPUNKNOWN
iface
)
{
ULONG
WINAPI
IDirectMusicBandImpl_IUnknown_Release
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicBandImpl
,
UnknownVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicBandImpl
,
UnknownVtbl
,
iface
);
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
...
dlls/dmband/bandtrack.c
View file @
7b6b24d8
...
@@ -51,14 +51,19 @@ HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, R
...
@@ -51,14 +51,19 @@ HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, R
ULONG
WINAPI
IDirectMusicBandTrack_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ULONG
WINAPI
IDirectMusicBandTrack_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicBandTrack
,
UnknownVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicBandTrack
,
UnknownVtbl
,
iface
);
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
return
++
(
This
->
ref
);
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
}
ULONG
WINAPI
IDirectMusicBandTrack_IUnknown_Release
(
LPUNKNOWN
iface
)
{
ULONG
WINAPI
IDirectMusicBandTrack_IUnknown_Release
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicBandTrack
,
UnknownVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicBandTrack
,
UnknownVtbl
,
iface
);
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
...
dlls/dmband/dmband_main.c
View file @
7b6b24d8
...
@@ -39,13 +39,13 @@ static HRESULT WINAPI BandCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPV
...
@@ -39,13 +39,13 @@ static HRESULT WINAPI BandCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPV
static
ULONG
WINAPI
BandCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
BandCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
}
static
ULONG
WINAPI
BandCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
BandCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
}
static
HRESULT
WINAPI
BandCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
BandCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
...
@@ -84,13 +84,13 @@ static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID rii
...
@@ -84,13 +84,13 @@ static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID rii
static
ULONG
WINAPI
BandTrackCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
BandTrackCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
}
static
ULONG
WINAPI
BandTrackCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
BandTrackCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
}
static
HRESULT
WINAPI
BandTrackCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
BandTrackCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
...
...
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