2014-07-23 18:00:36 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2015-09-27 18:40:24 +00:00
|
|
|
* FILE: dll/shellext/stobject/stobject.cpp
|
2014-07-30 22:08:05 +00:00
|
|
|
* PURPOSE: COM registration services for STobject.dll
|
2014-07-28 13:18:57 +00:00
|
|
|
* PROGRAMMERS: Robert Naumann
|
2017-08-18 14:49:11 +00:00
|
|
|
* David Quintana <gigaherz@gmail.com>
|
2014-07-23 18:00:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
BEGIN_OBJECT_MAP(ObjectMap)
|
|
|
|
OBJECT_ENTRY(CLSID_SysTray, CSysTray)
|
|
|
|
END_OBJECT_MAP()
|
2014-07-28 13:18:57 +00:00
|
|
|
|
2014-07-31 12:36:40 +00:00
|
|
|
HINSTANCE g_hInstance;
|
|
|
|
CComModule g_Module;
|
2014-07-23 18:00:36 +00:00
|
|
|
|
2014-07-31 12:36:40 +00:00
|
|
|
STDAPI_(BOOL)
|
2014-07-30 22:08:05 +00:00
|
|
|
DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
2014-07-28 13:18:57 +00:00
|
|
|
{
|
2014-07-30 22:08:05 +00:00
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
2014-07-23 18:00:36 +00:00
|
|
|
{
|
2014-07-30 22:08:05 +00:00
|
|
|
g_hInstance = hinstDLL;
|
|
|
|
DisableThreadLibraryCalls(g_hInstance);
|
2014-07-23 18:00:36 +00:00
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
g_Module.Init(ObjectMap, g_hInstance, NULL);
|
2014-07-28 13:18:57 +00:00
|
|
|
}
|
2014-07-30 22:08:05 +00:00
|
|
|
else if (fdwReason == DLL_PROCESS_DETACH)
|
2014-07-28 13:18:57 +00:00
|
|
|
{
|
2014-07-30 22:08:05 +00:00
|
|
|
g_hInstance = NULL;
|
|
|
|
g_Module.Term();
|
2014-07-28 13:18:57 +00:00
|
|
|
}
|
2014-07-30 22:08:05 +00:00
|
|
|
return TRUE;
|
2014-07-28 13:18:57 +00:00
|
|
|
}
|
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
STDAPI
|
|
|
|
DllRegisterServer(void)
|
2014-07-23 18:00:36 +00:00
|
|
|
{
|
2014-07-31 12:36:40 +00:00
|
|
|
return g_Module.DllRegisterServer(FALSE);
|
2014-07-23 18:00:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
STDAPI
|
2014-07-30 22:08:05 +00:00
|
|
|
DllUnregisterServer(void)
|
2014-07-23 18:00:36 +00:00
|
|
|
{
|
2014-07-31 12:36:40 +00:00
|
|
|
return g_Module.DllUnregisterServer(FALSE);
|
2014-07-23 18:00:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
STDAPI
|
2014-07-30 22:08:05 +00:00
|
|
|
DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
2014-07-23 18:00:36 +00:00
|
|
|
{
|
2014-07-31 12:36:40 +00:00
|
|
|
return g_Module.DllGetClassObject(rclsid, riid, ppv);
|
2014-07-23 18:00:36 +00:00
|
|
|
}
|
|
|
|
|
2014-07-31 12:36:40 +00:00
|
|
|
STDAPI
|
2014-07-30 22:08:05 +00:00
|
|
|
DllCanUnloadNow(void)
|
2014-07-23 18:00:36 +00:00
|
|
|
{
|
2014-07-30 22:08:05 +00:00
|
|
|
return g_Module.DllCanUnloadNow();
|
2014-07-23 18:00:36 +00:00
|
|
|
}
|