[NTOS:PS] Use KD routine to safely read memory from thread stack
[reactos.git] / dll / shellext / ntobjshex / ntobjshex.cpp
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)
14 OBJECT_ENTRY(CLSID_NtObjectFolder, CNtObjectFolder)
15 OBJECT_ENTRY(CLSID_RegistryFolder, CRegistryFolder)
16 END_OBJECT_MAP()
17
18 HINSTANCE g_hInstance;
19 CComModule g_Module;
20
21 STDAPI_(BOOL)
22 DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
23 {
24 if (fdwReason == DLL_PROCESS_ATTACH)
25 {
26 g_hInstance = hinstDLL;
27 DisableThreadLibraryCalls(g_hInstance);
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
40 DllRegisterServer(void)
41 {
42 return g_Module.DllRegisterServer(FALSE);
43 }
44
45 STDAPI
46 DllUnregisterServer(void)
47 {
48 return g_Module.DllUnregisterServer(FALSE);
49 }
50
51 STDAPI
52 DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
53 {
54 return g_Module.DllGetClassObject(rclsid, riid, ppv);
55 }
56
57 STDAPI
58 DllCanUnloadNow(void)
59 {
60 return g_Module.DllCanUnloadNow();
61 }