windows-nt/Source/XPSP1/NT/admin/wmi/wbem/winmgmt/repdrvr/smrtptr.cpp

65 lines
754 B
C++
Raw Normal View History

2020-09-26 03:20:57 -05:00
/*++
Copyright (C) 1998-2001 Microsoft Corporation
Module Name:
Abstract:
History:
--*/
#include "precomp.h"
#include <comutil.h>
#include <smrtptr.h>
CReleaseMe::CReleaseMe ( IUnknown *pIn)
{
m_pIn = pIn;
}
CReleaseMe::~CReleaseMe ()
{
if (m_pIn)
m_pIn->Release();
}
CFreeMe::CFreeMe ( BSTR pIn)
{
m_pIn = pIn;
}
CFreeMe::~CFreeMe ()
{
if (m_pIn)
SysFreeString(m_pIn);
}
CClearMe::CClearMe ( VARIANT *pIn)
{
m_pIn = pIn;
VariantInit(m_pIn);
}
CClearMe::~CClearMe ()
{
if (m_pIn)
VariantClear(m_pIn);
}
CRepdrvrCritSec::CRepdrvrCritSec (CRITICAL_SECTION *pCS)
{
p_cs = pCS;
EnterCriticalSection(pCS);
}
CRepdrvrCritSec::~CRepdrvrCritSec()
{
LeaveCriticalSection(p_cs);
}