windows-nt/Source/XPSP1/NT/base/win32/fusion/xmlparser/_reference.cxx

34 lines
610 B
C++
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
/*
* @(#)_reference.cxx 1.0 6/3/97
*
* Copyright (c) 1997 - 1999 Microsoft Corporation. All rights reserved. *
*/
#include "stdinc.h"
#include "core.hxx"
#pragma hdrstop
void _assign(IUnknown ** ppref, IUnknown * pref)
{
IUnknown *punkRef = *ppref;
#ifdef FUSION_USE_OLD_XML_PARSER_SOURCE
if (pref) ((Object *)pref)->AddRef();
(*ppref) = (Object *)pref;
#else // fusion xml parser
if (pref) pref->AddRef();
(*ppref) = pref;
#endif
if (punkRef) punkRef->Release();
}
void _release(IUnknown ** ppref)
{
if (*ppref)
{
(*ppref)->Release();
*ppref = NULL;
}
}