- use Interlocked* functions in AddRef and Release.

- store the result of the Interlocked functions and use only this.
This commit is contained in:
Paul Vriens 2005-01-11 16:02:21 +00:00 committed by Alexandre Julliard
parent bef1336667
commit 3da8524bb4
17 changed files with 140 additions and 92 deletions

View File

@ -54,14 +54,17 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_IUnknown_QueryInterface (LPUNKNOWN ifac
ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
if (This->pDSBuffer) {
IDirectSoundBuffer8_Release(This->pDSBuffer);

View File

@ -40,13 +40,13 @@ static HRESULT WINAPI PerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID r
static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI PerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -82,13 +82,13 @@ static HRESULT WINAPI SegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,
static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI SegmentCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI SegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -124,13 +124,13 @@ static HRESULT WINAPI SegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID
static ULONG WINAPI SegmentStateCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI SegmentStateCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI SegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -166,13 +166,13 @@ static HRESULT WINAPI GraphCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LP
static ULONG WINAPI GraphCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI GraphCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI GraphCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -208,13 +208,13 @@ static HRESULT WINAPI TempoTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID ri
static ULONG WINAPI TempoTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI TempoTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI TempoTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -250,13 +250,13 @@ static HRESULT WINAPI SeqTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid
static ULONG WINAPI SeqTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI SeqTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI SeqTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -292,13 +292,13 @@ static HRESULT WINAPI SysExTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID ri
static ULONG WINAPI SysExTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI SysExTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI SysExTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -334,13 +334,13 @@ static HRESULT WINAPI TimeSigTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID
static ULONG WINAPI TimeSigTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI TimeSigTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI TimeSigTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -376,13 +376,13 @@ static HRESULT WINAPI ParamControlTrackCF_QueryInterface(LPCLASSFACTORY iface,RE
static ULONG WINAPI ParamControlTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI ParamControlTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI ParamControlTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -418,13 +418,13 @@ static HRESULT WINAPI MarkerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID r
static ULONG WINAPI MarkerTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI MarkerTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI MarkerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -460,13 +460,13 @@ static HRESULT WINAPI LyricsTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID r
static ULONG WINAPI LyricsTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI LyricsTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI LyricsTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -503,13 +503,13 @@ static HRESULT WINAPI SegTriggerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFI
static ULONG WINAPI SegTriggerTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI SegTriggerTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI SegTriggerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -545,13 +545,13 @@ static HRESULT WINAPI AudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID rii
static ULONG WINAPI AudioPathCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI AudioPathCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI AudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
@ -587,13 +587,13 @@ static HRESULT WINAPI WaveTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID rii
static ULONG WINAPI WaveTrackCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI WaveTrackCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
return --(This->ref);
return InterlockedDecrement(&This->ref);
}
static HRESULT WINAPI WaveTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {

View File

@ -54,14 +54,17 @@ HRESULT WINAPI IDirectMusicGraphImpl_IUnknown_QueryInterface (LPUNKNOWN iface, R
ULONG WINAPI IDirectMusicGraphImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicGraphImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicLyricsTrack_IUnknown_QueryInterface (LPUNKNOWN iface,
ULONG WINAPI IDirectMusicLyricsTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicLyricsTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicMarkerTrack_IUnknown_QueryInterface (LPUNKNOWN iface,
ULONG WINAPI IDirectMusicMarkerTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicMarkerTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicParamControlTrack_IUnknown_QueryInterface (LPUNKNOWN
ULONG WINAPI IDirectMusicParamControlTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicParamControlTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -39,14 +39,17 @@ HRESULT WINAPI IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERN
ULONG WINAPI IDirectMusicPatternTrackImpl_AddRef (LPDIRECTMUSICPATTERNTRACK iface) {
IDirectMusicPatternTrackImpl *This = (IDirectMusicPatternTrackImpl *)iface;
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK iface) {
IDirectMusicPatternTrackImpl *This = (IDirectMusicPatternTrackImpl *)iface;
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -182,14 +182,17 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORM
ULONG WINAPI IDirectMusicPerformance8Impl_AddRef (LPDIRECTMUSICPERFORMANCE8 iface) {
IDirectMusicPerformance8Impl *This = (IDirectMusicPerformance8Impl *)iface;
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 iface) {
IDirectMusicPerformance8Impl *This = (IDirectMusicPerformance8Impl *)iface;
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
DeleteCriticalSection(&This->safe);
HeapFree(GetProcessHeap(), 0, This);

View File

@ -57,14 +57,17 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IUnknown_QueryInterface (LPUNKNOWN iface
ULONG WINAPI IDirectMusicSegment8Impl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicSegment8Impl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -39,14 +39,17 @@ HRESULT WINAPI IDirectMusicSegmentState8Impl_QueryInterface (LPDIRECTMUSICSEGMEN
ULONG WINAPI IDirectMusicSegmentState8Impl_AddRef (LPDIRECTMUSICSEGMENTSTATE8 iface) {
IDirectMusicSegmentState8Impl *This = (IDirectMusicSegmentState8Impl *)iface;
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicSegmentState8Impl_Release (LPDIRECTMUSICSEGMENTSTATE8 iface) {
IDirectMusicSegmentState8Impl *This = (IDirectMusicSegmentState8Impl *)iface;
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -52,14 +52,17 @@ HRESULT WINAPI IDirectMusicSegTriggerTrack_IUnknown_QueryInterface (LPUNKNOWN if
ULONG WINAPI IDirectMusicSegTriggerTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicSegTriggerTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicSeqTrack_IUnknown_QueryInterface (LPUNKNOWN iface, RE
ULONG WINAPI IDirectMusicSeqTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicSeqTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicSysExTrack_IUnknown_QueryInterface (LPUNKNOWN iface,
ULONG WINAPI IDirectMusicSysExTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicSysExTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -52,14 +52,17 @@ HRESULT WINAPI IDirectMusicTempoTrack_IUnknown_QueryInterface (LPUNKNOWN iface,
ULONG WINAPI IDirectMusicTempoTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicTempoTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicTimeSigTrack_IUnknown_QueryInterface (LPUNKNOWN iface
ULONG WINAPI IDirectMusicTimeSigTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, UnknownVtbl, iface);
TRACE("(%p): AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicTimeSigTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -38,14 +38,17 @@ HRESULT WINAPI IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface, R
ULONG WINAPI IDirectMusicTool8Impl_AddRef (LPDIRECTMUSICTOOL8 iface) {
IDirectMusicTool8Impl *This = (IDirectMusicTool8Impl *)iface;
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) : AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface) {
IDirectMusicTool8Impl *This = (IDirectMusicTool8Impl *)iface;
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) : ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}

View File

@ -51,14 +51,17 @@ HRESULT WINAPI IDirectMusicWaveTrack_IUnknown_QueryInterface (LPUNKNOWN iface, R
ULONG WINAPI IDirectMusicWaveTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) : AddRef from %ld\n", This, ref - 1);
return ref;
}
ULONG WINAPI IDirectMusicWaveTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) : ReleaseRef to %ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}