Removed printing of thread id for AddRef and Release because

WINEDEBUG=+tid gives the same result.
General consistency cleanup.
This commit is contained in:
Robert Reif 2005-02-11 11:49:05 +00:00 committed by Alexandre Julliard
parent 14f9b844ce
commit f8833daef1
7 changed files with 219 additions and 225 deletions

View file

@ -54,25 +54,25 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface(
static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY iface)
{
IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSoundNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface) {
IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface;
ULONG ref;
static ULONG WINAPI IDirectSoundNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface)
{
IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedDecrement(&(This->ref));
if (ref == 0) {
IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER)This->dsb);
This->dsb->notify = NULL;
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
}
return ref;
if (!ref) {
IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER)This->dsb);
This->dsb->notify = NULL;
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ref;
}
static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(
@ -350,22 +350,19 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface)
static ULONG WINAPI IDirectSoundBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedDecrement(&(This->ref));
if (ref)
return ref;
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
if (!ref) {
DSOUND_RemoveBuffer(This->dsound, This);
This->lock.DebugInfo->Spare[1] = 0;
@ -390,10 +387,11 @@ static ULONG WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
HeapFree(GetProcessHeap(), 0, This->notifies);
HeapFree(GetProcessHeap(), 0, This->pwfx);
HeapFree(GetProcessHeap(),0,This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n",This);
return 0;
TRACE("(%p) released\n", This);
}
return ref;
}
DWORD DSOUND_CalcPlayPosition(IDirectSoundBufferImpl *This,
@ -1246,25 +1244,25 @@ static HRESULT WINAPI SecondaryBufferImpl_QueryInterface(
static ULONG WINAPI SecondaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI SecondaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
ref = InterlockedDecrement(&(This->ref));
if (!ref) {
This->dsb->dsb = NULL;
IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER8)This->dsb);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
}
return ref;
if (!ref) {
This->dsb->dsb = NULL;
IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER8)This->dsb);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ref;
}
static HRESULT WINAPI SecondaryBufferImpl_GetCaps(

View file

@ -363,19 +363,19 @@ static ULONG WINAPI
IDirectSoundCaptureImpl_AddRef( LPDIRECTSOUNDCAPTURE iface )
{
IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI
IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface )
{
ULONG uRef;
IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
uRef = InterlockedDecrement(&(This->ref));
if ( uRef == 0 ) {
if (!ref) {
TRACE("deleting object\n");
if (This->capture_buffer)
IDirectSoundCaptureBufferImpl_Release(
@ -391,10 +391,9 @@ IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface )
DeleteCriticalSection( &(This->lock) );
HeapFree( GetProcessHeap(), 0, This );
dsound_capture = NULL;
TRACE("(%p) released\n",This);
TRACE("(%p) released\n", This);
}
return uRef;
return ref;
}
static HRESULT WINAPI
@ -788,25 +787,24 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_QueryInterface(
static ULONG WINAPI IDirectSoundCaptureNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY iface)
{
IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSoundCaptureNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface)
{
IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface;
ULONG ref;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedDecrement(&(This->ref));
if (ref == 0) {
if (!ref) {
if (This->dscb->hwnotify)
IDsDriverNotify_Release(This->dscb->hwnotify);
This->dscb->notify=NULL;
IDirectSoundCaptureBuffer_Release((LPDIRECTSOUNDCAPTUREBUFFER)This->dscb);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
TRACE("(%p) released\n", This);
}
return ref;
}
@ -952,19 +950,19 @@ static ULONG WINAPI
IDirectSoundCaptureBufferImpl_AddRef( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
{
IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI
IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
{
ULONG uRef;
IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
uRef = InterlockedDecrement(&(This->ref));
if ( uRef == 0 ) {
if (!ref) {
TRACE("deleting object\n");
if (This->dsound->state == STATE_CAPTURING)
This->dsound->state = STATE_STOPPING;
@ -993,10 +991,9 @@ IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
HeapFree(GetProcessHeap(), 0, This->notifies);
HeapFree( GetProcessHeap(), 0, This );
TRACE("(%p) released\n",This);
TRACE("(%p) released\n", This);
}
return uRef;
return ref;
}
static HRESULT WINAPI
@ -1578,17 +1575,19 @@ static ULONG WINAPI
DSCCF_AddRef(LPCLASSFACTORY iface)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI
DSCCF_Release(LPCLASSFACTORY iface)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
/* static class, won't be freed */
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedDecrement(&(This->ref));
return ref;
}
static HRESULT WINAPI
@ -1729,26 +1728,25 @@ static ULONG WINAPI
IDirectSoundFullDuplexImpl_AddRef( LPDIRECTSOUNDFULLDUPLEX iface )
{
IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI
IDirectSoundFullDuplexImpl_Release( LPDIRECTSOUNDFULLDUPLEX iface )
{
ULONG uRef;
IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
uRef = InterlockedDecrement(&(This->ref));
if ( uRef == 0 ) {
if (!ref) {
This->lock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection( &(This->lock) );
HeapFree( GetProcessHeap(), 0, This );
TRACE("(%p) released\n",This);
TRACE("(%p) released\n", This);
}
return uRef;
return ref;
}
static HRESULT WINAPI

View file

@ -230,21 +230,19 @@ static ULONG WINAPI IDirectSoundImpl_AddRef(
LPDIRECTSOUND8 iface)
{
IDirectSoundImpl *This = (IDirectSoundImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSoundImpl_Release(
LPDIRECTSOUND8 iface)
{
IDirectSoundImpl *This = (IDirectSoundImpl *)iface;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",
This, This->ref, GetCurrentThreadId());
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
ref = InterlockedDecrement(&(This->ref));
if (ref == 0) {
if (!ref) {
HRESULT hres;
INT i;
@ -291,9 +289,8 @@ static ULONG WINAPI IDirectSoundImpl_Release(
DeleteCriticalSection(&This->mixlock);
HeapFree(GetProcessHeap(),0,This);
dsound = NULL;
TRACE("(%p) released\n",This);
TRACE("(%p) released\n", This);
}
return ref;
}
@ -971,23 +968,23 @@ static ULONG WINAPI IDirectSound_IUnknown_AddRef(
LPUNKNOWN iface)
{
IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound_IUnknown_Release(
LPUNKNOWN iface)
{
IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface;
ULONG ulReturn;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&(This->ref));
if (ulReturn == 0) {
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
if (!ref) {
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static IUnknownVtbl DirectSound_Unknown_Vtbl =
@ -1049,23 +1046,23 @@ static ULONG WINAPI IDirectSound_IDirectSound_AddRef(
LPDIRECTSOUND iface)
{
IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound_IDirectSound_Release(
LPDIRECTSOUND iface)
{
IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface;
ULONG ulReturn;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&This->ref);
if (ulReturn == 0) {
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
if (!ref) {
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static HRESULT WINAPI IDirectSound_IDirectSound_CreateSoundBuffer(
@ -1210,23 +1207,23 @@ static ULONG WINAPI IDirectSound8_IUnknown_AddRef(
LPUNKNOWN iface)
{
IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound8_IUnknown_Release(
LPUNKNOWN iface)
{
IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface;
ULONG ulReturn;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&(This->ref));
if (ulReturn == 0) {
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
if (!ref) {
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static IUnknownVtbl DirectSound8_Unknown_Vtbl =
@ -1288,23 +1285,23 @@ static ULONG WINAPI IDirectSound8_IDirectSound_AddRef(
LPDIRECTSOUND iface)
{
IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound8_IDirectSound_Release(
LPDIRECTSOUND iface)
{
IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface;
ULONG ulReturn;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&(This->ref));
if (ulReturn == 0) {
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
if (!ref) {
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static HRESULT WINAPI IDirectSound8_IDirectSound_CreateSoundBuffer(
@ -1449,23 +1446,23 @@ static ULONG WINAPI IDirectSound8_IDirectSound8_AddRef(
LPDIRECTSOUND8 iface)
{
IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound8_IDirectSound8_Release(
LPDIRECTSOUND8 iface)
{
IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface;
ULONG ulReturn;
TRACE("(%p) ref was %ld, thread is %04lx\n", This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&(This->ref));
if (ulReturn == 0) {
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
if (!ref) {
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static HRESULT WINAPI IDirectSound8_IDirectSound8_CreateSoundBuffer(

View file

@ -427,18 +427,21 @@ DSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
return E_NOINTERFACE;
}
static ULONG WINAPI
DSCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedIncrement(&(This->ref));
static ULONG WINAPI DSCF_AddRef(LPCLASSFACTORY iface)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedDecrement(&(This->ref));
static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
/* static class, won't be freed */
return ref;
}
static HRESULT WINAPI DSCF_CreateInstance(
@ -495,19 +498,21 @@ DSPCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
return E_NOINTERFACE;
}
static ULONG WINAPI
DSPCF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedIncrement(&(This->ref));
static ULONG WINAPI DSPCF_AddRef(LPCLASSFACTORY iface)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI
DSPCF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedDecrement(&(This->ref));
static ULONG WINAPI DSPCF_Release(LPCLASSFACTORY iface)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
/* static class, won't be freed */
return ref;
}
static HRESULT WINAPI

View file

@ -562,26 +562,26 @@ static HRESULT WINAPI PrimaryBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface)
return DS_OK;
}
static ULONG WINAPI PrimaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface) {
PrimaryBufferImpl *This = (PrimaryBufferImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
static ULONG WINAPI PrimaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface)
{
PrimaryBufferImpl *This = (PrimaryBufferImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI PrimaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface) {
PrimaryBufferImpl *This = (PrimaryBufferImpl *)iface;
DWORD ref;
static ULONG WINAPI PrimaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
{
PrimaryBufferImpl *This = (PrimaryBufferImpl *)iface;
DWORD ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedDecrement(&(This->ref));
if (ref == 0) {
This->dsound->primary = NULL;
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
}
return ref;
if (!ref) {
This->dsound->primary = NULL;
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ref;
}
static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(

View file

@ -64,24 +64,24 @@ static HRESULT WINAPI IKsBufferPropertySetImpl_QueryInterface(
static ULONG WINAPI IKsBufferPropertySetImpl_AddRef(LPKSPROPERTYSET iface)
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IKsBufferPropertySetImpl_Release(LPKSPROPERTYSET iface)
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
ULONG ulReturn;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld\n", This, This->ref);
ulReturn = InterlockedDecrement(&(This->ref));
if (!ulReturn) {
if (!ref) {
This->dsb->iks = 0;
IDirectSoundBuffer_Release((LPDIRECTSOUND3DBUFFER)This->dsb);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static HRESULT WINAPI IKsBufferPropertySetImpl_Get(
@ -248,22 +248,22 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface(
static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
TRACE("(%p) ref was %ld\n", This, This->ref);
return InterlockedIncrement(&(This->ref));
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
ULONG ulReturn;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld\n", This, This->ref);
ulReturn = InterlockedDecrement(&(This->ref));
if (ulReturn == 0) {
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ulReturn;
return ref;
}
static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingA(

View file

@ -364,26 +364,25 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_QueryInterface(
static ULONG WINAPI IDirectSound3DBufferImpl_AddRef(LPDIRECTSOUND3DBUFFER iface)
{
IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound3DBufferImpl_Release(LPDIRECTSOUND3DBUFFER iface)
{
IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface;
ULONG ulReturn;
IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&(This->ref));
if (!ulReturn) {
This->dsb->ds3db = NULL;
IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER8)This->dsb);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
}
return ulReturn;
if (!ref) {
This->dsb->ds3db = NULL;
IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER8)This->dsb);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ref;
}
/* IDirectSound3DBuffer methods */
@ -801,27 +800,24 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface(
static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(LPDIRECTSOUND3DLISTENER iface)
{
IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->ref));
IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IDirectSound3DListenerImpl_Release(LPDIRECTSOUND3DLISTENER iface)
{
IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface;
ULONG ulReturn;
IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %ld\n", This, ref + 1);
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ulReturn = InterlockedDecrement(&(This->ref));
/* Free all resources */
if( ulReturn == 0 ) {
This->dsound->listener = 0;
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n",This);
}
return ulReturn;
if (!ref) {
This->dsound->listener = 0;
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
}
return ref;
}
/* IDirectSound3DListener methods */