-
Notifications
You must be signed in to change notification settings - Fork 2
/
osgi_bundle.cpp
57 lines (49 loc) · 1.7 KB
/
osgi_bundle.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// osgi_bundle.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "osgi_bundle.h"
// Export entry points without the use of an external DEF file
#if defined (_M_IX86)
#pragma comment (linker, "/EXPORT:DllMain=_DllMain@12,PRIVATE")
#pragma comment (linker, \
"/EXPORT:DllRegisterServer=_DllRegisterServer@0,PRIVATE")
#pragma comment (linker, \
"/EXPORT:DllUnregisterServer=_DllUnregisterServer@0,PRIVATE")
#pragma comment (linker, \
"/EXPORT:DllGetClassObject=_DllGetClassObject@12,PRIVATE")
#pragma comment (linker, \
"/EXPORT:DllCanUnloadNow=_DllCanUnloadNow@0,PRIVATE")
#elif defined (_M_IA64)
#pragma comment (linker, "/EXPORT:DllMain,PRIVATE")
#pragma comment (linker, "/EXPORT:DllRegisterServer,PRIVATE")
#pragma comment (linker, "/EXPORT:DllUnregisterServer,PRIVATE")
#pragma comment (linker, "/EXPORT:DllGetClassObject,PRIVATE")
#pragma comment (linker, "/EXPORT:DllCanUnloadNow,PRIVATE")
#endif
class Module : public ATL::CAtlDllModuleT<Module> {
public :
Module() {
//ATL::AtlEnableMemoryTracking(true);
}
~Module() {
#ifdef _DEBUG
ATL::AtlDumpMemoryLeaks();
#endif
}
}_AtlModule;
// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD dwReason, LPVOID lpReserved) {
return _AtlModule.DllMain(dwReason, lpReserved);
}
STDAPI DllCanUnloadNow(void) {
return _AtlModule.DllCanUnloadNow();
}
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) {
return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
}
STDAPI DllRegisterServer(void) {
return _AtlModule.DllRegisterServer(false);
}
STDAPI DllUnregisterServer(void) {
return _AtlModule.DllUnregisterServer(false);
}