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.
 
 
 
 
 
 

109 lines
2.4 KiB

/*===================================================================
Microsoft Denali
Microsoft Confidential.
Copyright 1997 Microsoft Corporation. All Rights Reserved.
Component: Global Interface Pointer API support
File: Gip.cpp
Owner: DmitryR
This is the GIP source file.
===================================================================*/
#include "precomp.hxx"
#include <gip.h>
/*===================================================================
Globals
===================================================================*/
CGlobalInterfaceAPI g_GIPAPI;
/*===================================================================
C G l o b a l I n t e r f a c e A P I
===================================================================*/
/*===================================================================
CGlobalInterfaceAPI::CGlobalInterfaceAPI
CGlobalInterfaceAPI constructor
Parameters:
Returns:
===================================================================*/
CGlobalInterfaceAPI::CGlobalInterfaceAPI()
: m_fInited(FALSE), m_pGIT(NULL)
{
}
/*===================================================================
CGlobalInterfaceAPI::~CGlobalInterfaceAPI
CGlobalInterfaceAPI destructor
Parameters:
Returns:
===================================================================*/
CGlobalInterfaceAPI::~CGlobalInterfaceAPI()
{
UnInit();
}
/*===================================================================
CGlobalInterfaceAPI::Init
Creates instance of GlobalInterfaceTable
Parameters:
Returns:
HRESULT
===================================================================*/
HRESULT CGlobalInterfaceAPI::Init()
{
IRTLASSERT(!m_fInited); // don't init twice
HRESULT hr = CoCreateInstance
(
CLSID_StdGlobalInterfaceTable,
NULL,
CLSCTX_INPROC_SERVER,
IID_IGlobalInterfaceTable,
(void **)&m_pGIT
);
if (SUCCEEDED(hr))
m_fInited = TRUE;
else
m_pGIT = NULL;
return hr;
}
/*===================================================================
CGlobalInterfaceAPI::UnInit
Releases instance of GlobalInterfaceTable
Parameters:
Returns:
HRESULT (NOERROR)
===================================================================*/
HRESULT CGlobalInterfaceAPI::UnInit()
{
if (m_pGIT)
{
m_pGIT->Release();
m_pGIT = NULL;
}
m_fInited = FALSE;
return NOERROR;
}