Windows2000/private/shell/ext/settings/comobj.cpp
2020-09-30 17:12:32 +02:00

39 lines
720 B
C++

#include "precomp.hxx"
#pragma hdrstop
STDMETHODIMP
ComObject::QueryInterface(
REFIID riid,
LPVOID *ppvOut
)
{
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG)
ComObject::AddRef(
VOID
)
{
ULONG ulReturn = m_cRef + 1;
DebugMsg(DM_OLE | DM_NOPREFIX, TEXT("::AddRef, 0x%08X %d -> %d"), this, ulReturn - 1, ulReturn);
InterlockedIncrement(&m_cRef);
return ulReturn;
}
STDMETHODIMP_(ULONG)
ComObject::Release(
VOID
)
{
ULONG ulReturn = m_cRef - 1;
DebugMsg(DM_OLE | DM_NOPREFIX, TEXT("::Release, 0x%08X %d -> %d"), this, ulReturn + 1, ulReturn);
if (InterlockedDecrement(&m_cRef) == 0)
{
delete this;
ulReturn = 0;
}
return ulReturn;
}