rpcrt4: Tidy up CStdStubBuffer_AddRef,Release.

This commit is contained in:
Huw Davies 2006-08-30 15:16:29 +01:00 committed by Alexandre Julliard
parent 7a120c99ea
commit dffd3e5034
1 changed files with 7 additions and 4 deletions

View File

@ -105,23 +105,26 @@ ULONG WINAPI CStdStubBuffer_AddRef(LPRPCSTUBBUFFER iface)
{
CStdStubBuffer *This = (CStdStubBuffer *)iface;
TRACE("(%p)->AddRef()\n",This);
return ++(This->RefCount);
return InterlockedIncrement(&This->RefCount);
}
ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface,
LPPSFACTORYBUFFER pPSF)
{
CStdStubBuffer *This = (CStdStubBuffer *)iface;
ULONG refs;
TRACE("(%p)->Release()\n",This);
if (!--(This->RefCount)) {
refs = InterlockedDecrement(&This->RefCount);
if (!refs)
{
IRpcStubBuffer_Disconnect(iface);
if(This->pPSFactory)
IPSFactoryBuffer_Release(This->pPSFactory);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->RefCount;
return refs;
}
ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface,