// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"


#include "CBaseGloabl.h"


//////////////////////////////////////////////////////////////////////////
CBaseGloabl* g_pBaseGloabl = NULL;
HMODULE g_hDllModule = NULL;

//#pragma comment(linker, "/EXPORT:DllRegisterServer=_DllRegisterServer@0,PRIVATE")
//#pragma comment(linker, "/EXPORT:DllUnregisterServer=_DllUnregisterServer@0,PRIVATE")
//
//
//
//STDAPI DllRegisterServer(void)
//{
//	HRESULT hr = S_OK;
//
//
//	return hr;
//}
//
//
//STDAPI DllUnregisterServer(void)
//{
//	HRESULT hr = S_OK;
//
//
//	return hr;
//}




SYSMODULE IBaseGloablModule* WINAPI GetBaseGlobalInstance()
{


	
	if (!g_pBaseGloabl)
		g_pBaseGloabl = new CBaseGloabl;

	g_pBaseGloabl->AddRef();
	return g_pBaseGloabl;
}

SYSMODULE BOOL WINAPI ReleaseBaseGlobalInstance()
{
	if (!g_pBaseGloabl)
		return FALSE;

	if (g_pBaseGloabl->Release() == 0)
	{
		g_pBaseGloabl = NULL;
	}
	return TRUE;
}


BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
	{
		g_hDllModule = (HMODULE)hModule;
	}
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

