ReactOS  0.4.15-dev-494-g1d8c567
ntobjshex.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS shell extensions
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: dll/shellext/ntobjshex/ntobjshex.cpp
5  * PURPOSE: NT Object Namespace shell extension
6  * PROGRAMMERS: David Quintana <gigaherz@gmail.com>
7  */
8 
9 #include "precomp.h"
10 
11 #include <atlwin.h>
12 
13 BEGIN_OBJECT_MAP(ObjectMap)
17 
19 CComModule g_Module;
20 
22 DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
23 {
24  if (fdwReason == DLL_PROCESS_ATTACH)
25  {
26  g_hInstance = hinstDLL;
28 
29  g_Module.Init(ObjectMap, g_hInstance, NULL);
30  }
31  else if (fdwReason == DLL_PROCESS_DETACH)
32  {
33  g_hInstance = NULL;
34  g_Module.Term();
35  }
36  return TRUE;
37 }
38 
39 STDAPI
41 {
42  return g_Module.DllRegisterServer(FALSE);
43 }
44 
45 STDAPI
47 {
48  return g_Module.DllUnregisterServer(FALSE);
49 }
50 
51 STDAPI
53 {
54  return g_Module.DllGetClassObject(rclsid, riid, ppv);
55 }
56 
57 STDAPI
59 {
60  return g_Module.DllCanUnloadNow();
61 }
#define STDAPI
Definition: basetyps.h:41
HINSTANCE g_hInstance
Definition: ntobjshex.cpp:18
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
CComModule g_Module
Definition: ntobjshex.cpp:19
#define OBJECT_ENTRY(clsid, class)
Definition: atlcom.h:653
REFIID riid
Definition: precomp.h:44
#define REFCLSID
Definition: guiddef.h:117
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: ntobjshex.cpp:52
unsigned int BOOL
Definition: ntddk_ex.h:94
const GUID CLSID_NtObjectFolder
Definition: ntobjfolder.cpp:14
#define STDAPI_(t)
Definition: basetyps.h:42
smooth NULL
Definition: ftsmooth.c:416
const GUID CLSID_RegistryFolder
Definition: regfolder.cpp:12
#define DLL_PROCESS_DETACH
Definition: compat.h:119
STDAPI DllRegisterServer(void)
Definition: ntobjshex.cpp:40
unsigned long DWORD
Definition: ntddk_ex.h:95
STDAPI DllCanUnloadNow(void)
Definition: ntobjshex.cpp:58
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
#define BEGIN_OBJECT_MAP(x)
Definition: atlcom.h:649
STDAPI DllUnregisterServer(void)
Definition: ntobjshex.cpp:46
DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
Definition: ntobjshex.cpp:22
#define END_OBJECT_MAP()
Definition: atlcom.h:651