windows-nt/Source/XPSP1/NT/shell/shdocvw/atl.cpp
2020-09-26 16:20:57 +08:00

57 lines
1.1 KiB
C++

#include "priv.h"
#include "atl.h"
#include "nsc.h"
#include "srchasst.h"
//ATL support
CComModule _Module; // ATL module object
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ShellNameSpace, CNscTree)
OBJECT_ENTRY(CLSID_SearchAssistantOC, CSearchAssistantOC)
END_OBJECT_MAP()
STDAPI_(void) AtlInit(HINSTANCE hinst)
{
_Module.Init(ObjectMap, hinst);
}
STDAPI_(void) AtlTerm()
{
_Module.Term();
}
STDAPI AtlGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
{
*ppv = NULL;
HRESULT hr = _Module.GetClassObject(rclsid, riid, ppv);
#ifdef DEBUG
//this object gets freed on DLL_PROCESS_DETACH, which happens AFTER the
// mem leak check happens on exit.
if (SUCCEEDED(hr))
{
_ASSERTE(_Module.m_pObjMap != NULL);
_ATL_OBJMAP_ENTRY* pEntry = _Module.m_pObjMap;
while (pEntry->pclsid != NULL)
{
if (InlineIsEqualGUID(rclsid, *pEntry->pclsid))
{
ASSERT(pEntry->pCF);
break;
}
pEntry++;
}
}
#endif
return hr;
}
STDAPI_(LONG) AtlGetLockCount()
{
return _Module.GetLockCount();
}