Cleanup reference counting.

AddRef and Release return ULONG.
This commit is contained in:
Robert Reif 2004-09-17 18:10:59 +00:00 committed by Alexandre Julliard
parent 873e5bfe29
commit 8a8ee786ee
5 changed files with 23 additions and 50 deletions

View file

@ -68,17 +68,16 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface(
return IDirectSoundBuffer_QueryInterface((LPDIRECTSOUNDBUFFER)This->dsb, riid, ppobj);
}
static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY iface) {
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));
}
static ULONG WINAPI IDirectSoundNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface) {
IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface;
DWORD ref;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
@ -367,28 +366,23 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface)
return hres;
}
static DWORD WINAPI IDirectSoundBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface) {
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
DWORD ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedIncrement(&(This->ref));
if (!ref) {
FIXME("thread-safety alert! AddRef-ing with a zero refcount!\n");
}
return ref;
}
static DWORD WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
static ULONG WINAPI IDirectSoundBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
DWORD ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
return InterlockedIncrement(&(This->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;
if (ref)
return ref;
DSOUND_RemoveBuffer(This->dsound, This);
@ -1285,23 +1279,17 @@ static HRESULT WINAPI SecondaryBufferImpl_QueryInterface(
return IDirectSoundBufferImpl_QueryInterface((LPDIRECTSOUNDBUFFER8)This->dsb,riid,ppobj);
}
static DWORD WINAPI SecondaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface)
static ULONG WINAPI SecondaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
DWORD ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedIncrement(&(This->ref));
if (!ref) {
FIXME("thread-safety alert! AddRef-ing with a zero refcount!\n");
}
return ref;
return InterlockedIncrement(&(This->ref));
}
static DWORD WINAPI SecondaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
static ULONG WINAPI SecondaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
{
IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface;
DWORD ref;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedDecrement(&(This->ref));

View file

@ -780,7 +780,7 @@ static ULONG WINAPI IDirectSoundCaptureNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY ifa
static ULONG WINAPI IDirectSoundCaptureNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface)
{
IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface;
DWORD ref;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());

View file

@ -578,13 +578,13 @@ static HRESULT WINAPI PrimaryBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface)
return DS_OK;
}
static DWORD WINAPI PrimaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER8 iface) {
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 DWORD WINAPI PrimaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface) {
static ULONG WINAPI PrimaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface) {
PrimaryBufferImpl *This = (PrimaryBufferImpl *)iface;
DWORD ref;

View file

@ -246,7 +246,6 @@ 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));
}

View file

@ -379,14 +379,8 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_QueryInterface(
static ULONG WINAPI IDirectSound3DBufferImpl_AddRef(LPDIRECTSOUND3DBUFFER iface)
{
IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedIncrement(&(This->ref));
if (!ref) {
FIXME("thread-safety alert! AddRef-ing with a zero refcount!\n");
}
return ref;
return InterlockedIncrement(&(This->ref));
}
static ULONG WINAPI IDirectSound3DBufferImpl_Release(LPDIRECTSOUND3DBUFFER iface)
@ -822,16 +816,8 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface(
static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(LPDIRECTSOUND3DLISTENER iface)
{
IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface;
ULONG ref;
TRACE("(%p) ref was %ld, thread is %04lx\n",This, This->ref, GetCurrentThreadId());
ref = InterlockedIncrement(&(This->ref));
if (!ref) {
FIXME("thread-safety alert! AddRef-ing with a zero refcount!\n");
}
return ref;
return InterlockedIncrement(&(This->ref));
}
static ULONG WINAPI IDirectSound3DListenerImpl_Release(LPDIRECTSOUND3DLISTENER iface)