ReactOS 0.4.16-dev-401-g45b008d
ntobjshex.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: NT Object Namespace shell extension
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Shell extension entry point and exports
5 * COPYRIGHT: Copyright 2015-2017 David Quintana <gigaherz@gmail.com>
6 */
7
8#include "precomp.h"
9
10#include <atlwin.h>
11
12BEGIN_OBJECT_MAP(ObjectMap)
16
18CComModule g_Module;
19
21DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
22{
23 if (fdwReason == DLL_PROCESS_ATTACH)
24 {
25 g_hInstance = hinstDLL;
27
28 g_Module.Init(ObjectMap, g_hInstance, NULL);
29 }
30 else if (fdwReason == DLL_PROCESS_DETACH)
31 {
33 g_Module.Term();
34 }
35 return TRUE;
36}
37
40{
41 return g_Module.DllRegisterServer(FALSE);
42}
43
46{
47 return g_Module.DllUnregisterServer(FALSE);
48}
49
52{
53 return g_Module.DllGetClassObject(rclsid, riid, ppv);
54}
55
58{
59 return g_Module.DllCanUnloadNow();
60}
DWORD LPVOID fImpLoad
Definition: misc.cpp:142
#define STDAPI_(t)
Definition: basetyps.h:42
#define STDAPI
Definition: basetyps.h:41
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
const GUID CLSID_NtObjectFolder
Definition: ntobjfolder.cpp:13
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define END_OBJECT_MAP()
Definition: atlcom.h:691
#define OBJECT_ENTRY(clsid, class)
Definition: atlcom.h:693
#define BEGIN_OBJECT_MAP(x)
Definition: atlcom.h:689
STDAPI DllRegisterServer(void)
Definition: ntobjshex.cpp:39
DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
Definition: ntobjshex.cpp:21
STDAPI DllUnregisterServer(void)
Definition: ntobjshex.cpp:45
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: ntobjshex.cpp:51
CComModule g_Module
Definition: ntobjshex.cpp:18
HINSTANCE g_hInstance
Definition: ntobjshex.cpp:17
STDAPI DllCanUnloadNow(void)
Definition: ntobjshex.cpp:57
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
const GUID CLSID_RegistryFolder
Definition: regfolder.cpp:11