File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
#include " ../ze_lib.h"
10
+ #ifndef DYNAMIC_LOAD_LOADER
11
+ #include " ../loader/ze_loader.h"
12
+ #endif
10
13
11
14
namespace ze_lib
12
15
{
13
- BOOL APIENTRY DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
16
+ #ifdef DYNAMIC_LOAD_LOADER
17
+ export " C" BOOL APIENTRY DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
14
18
if (fdwReason == DLL_PROCESS_DETACH) {
15
19
delete context;
16
20
} else if (fdwReason == DLL_PROCESS_ATTACH) {
17
21
context = new context_t ;
18
22
}
19
23
return TRUE ;
20
24
}
25
+ #else
26
+ extern " C" BOOL APIENTRY DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
27
+ if (fdwReason == DLL_PROCESS_DETACH) {
28
+ delete context;
29
+ delete loader::context;
30
+ } else if (fdwReason == DLL_PROCESS_ATTACH) {
31
+ context = new context_t ;
32
+ loader::context = new loader::context_t ;
33
+ }
34
+ return TRUE ;
35
+ }
36
+
37
+ #endif
21
38
}
Original file line number Diff line number Diff line change 10
10
11
11
namespace loader
12
12
{
13
- BOOL APIENTRY DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
13
+ #ifdef DYNAMIC_LOAD_LOADER
14
+ extern " C" BOOL APIENTRY DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
14
15
if (fdwReason == DLL_PROCESS_DETACH) {
15
16
delete context;
16
17
} else if (fdwReason == DLL_PROCESS_ATTACH) {
17
18
context = new context_t ;
18
19
}
19
20
return TRUE ;
20
21
}
22
+ #endif
21
23
}
You can’t perform that action at this time.
0 commit comments