xref: /reactos/dll/shellext/stobject/stobject.cpp (revision e15874b4)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * PROJECT:     ReactOS system libraries
3*c2c66affSColin Finck  * LICENSE:     GPL - See COPYING in the top level directory
4*c2c66affSColin Finck  * FILE:        dll/shellext/stobject/stobject.cpp
5*c2c66affSColin Finck  * PURPOSE:     COM registration services for STobject.dll
6*c2c66affSColin Finck  * PROGRAMMERS: Robert Naumann
7*c2c66affSColin Finck  *              David Quintana <gigaherz@gmail.com>
8*c2c66affSColin Finck  */
9*c2c66affSColin Finck 
10*c2c66affSColin Finck #include "precomp.h"
11*c2c66affSColin Finck 
12*c2c66affSColin Finck BEGIN_OBJECT_MAP(ObjectMap)
13*c2c66affSColin Finck     OBJECT_ENTRY(CLSID_SysTray, CSysTray)
14*c2c66affSColin Finck END_OBJECT_MAP()
15*c2c66affSColin Finck 
16*c2c66affSColin Finck HINSTANCE  g_hInstance;
17*c2c66affSColin Finck CComModule g_Module;
18*c2c66affSColin Finck 
19*c2c66affSColin Finck STDAPI_(BOOL)
DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID fImpLoad)20*c2c66affSColin Finck DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
21*c2c66affSColin Finck {
22*c2c66affSColin Finck     if (fdwReason == DLL_PROCESS_ATTACH)
23*c2c66affSColin Finck     {
24*c2c66affSColin Finck         g_hInstance = hinstDLL;
25*c2c66affSColin Finck         DisableThreadLibraryCalls(g_hInstance);
26*c2c66affSColin Finck 
27*c2c66affSColin Finck         g_Module.Init(ObjectMap, g_hInstance, NULL);
28*c2c66affSColin Finck     }
29*c2c66affSColin Finck     else if (fdwReason == DLL_PROCESS_DETACH)
30*c2c66affSColin Finck     {
31*c2c66affSColin Finck         g_hInstance = NULL;
32*c2c66affSColin Finck         g_Module.Term();
33*c2c66affSColin Finck     }
34*c2c66affSColin Finck     return TRUE;
35*c2c66affSColin Finck }
36*c2c66affSColin Finck 
37*c2c66affSColin Finck STDAPI
DllRegisterServer(void)38*c2c66affSColin Finck DllRegisterServer(void)
39*c2c66affSColin Finck {
40*c2c66affSColin Finck     return g_Module.DllRegisterServer(FALSE);
41*c2c66affSColin Finck }
42*c2c66affSColin Finck 
43*c2c66affSColin Finck STDAPI
DllUnregisterServer(void)44*c2c66affSColin Finck DllUnregisterServer(void)
45*c2c66affSColin Finck {
46*c2c66affSColin Finck     return g_Module.DllUnregisterServer(FALSE);
47*c2c66affSColin Finck }
48*c2c66affSColin Finck 
49*c2c66affSColin Finck STDAPI
DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID * ppv)50*c2c66affSColin Finck DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
51*c2c66affSColin Finck {
52*c2c66affSColin Finck     return g_Module.DllGetClassObject(rclsid, riid, ppv);
53*c2c66affSColin Finck }
54*c2c66affSColin Finck 
55*c2c66affSColin Finck STDAPI
DllCanUnloadNow(void)56*c2c66affSColin Finck DllCanUnloadNow(void)
57*c2c66affSColin Finck {
58*c2c66affSColin Finck     return g_Module.DllCanUnloadNow();
59*c2c66affSColin Finck }
60