Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

66 lines
2.2 KiB

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Microsoft WMIOLE DB Provider
// (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
//
//
// This module contains the base object for CDatasource, CDBSession, CCommand,
// and CRowset. It contains routines such as globally registering the object
// for the cleanup routine and typing the object so persist an other internal
// implementation can know what object they are talking to.
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "headers.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Constructor for this class
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
CBaseObj::CBaseObj( EBaseObjectType botVal, // IN Base Object Type
LPUNKNOWN pUnkOuter // IN Outer Unknown Pointer
) : m_cs(TRUE)
{
m_BaseObjectType = botVal;
m_cRef = 0;
m_pUnkOuter = pUnkOuter? pUnkOuter : LPUNKNOWN(this);
InterlockedIncrement(&g_cObj);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Destructor for this class
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
CBaseObj::~CBaseObj()
{
InterlockedDecrement(&g_cObj);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Return Base Object type name.
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
WCHAR * CBaseObj::GetBaseObjectTypeName()
{
#ifdef DEBUG
static WCHAR * s_wszName[] = {
L"Unknown",
L"DataSource",
L"Session",
L"Command",
L"Rowset",
L"Error",
L"ClassFactory",
L"Enumerator",
L"TransactionOptions",
};
assert(m_BaseObjectType >= BOT_DATASOURCE && m_BaseObjectType <= BOT_MULTIPLERESULTS);
return s_wszName[m_BaseObjectType];
#else
return L"";
#endif
}