-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdllmain.cpp
61 lines (52 loc) · 1.33 KB
/
dllmain.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
58
59
60
61
#include "Authorize.h"
// Dynamic library process attach
void ios_auth_runtime_dynamic_library_process_attach()
{
}
// Dynamic library process detach
void ios_auth_runtime_dynamic_library_process_detach()
{
}
// Dynamic library thread attach
void ios_auth_runtime_dynamic_library_thread_attach()
{
}
// Dynamic library thread detach
void ios_auth_runtime_dynamic_library_thread_detach()
{
}
// Dynamic library entry
#if defined(_WIN32)
extern "C" BOOL WINAPI DllMain(HANDLE _DllHandle, DWORD _Reason, LPVOID _Reserved)
{
UNREFERENCED_PARAMETER(_DllHandle);
UNREFERENCED_PARAMETER(_Reserved);
switch(_Reason)
{
case DLL_PROCESS_ATTACH:
ios_auth_runtime_dynamic_library_process_attach();
break;
case DLL_THREAD_ATTACH:
ios_auth_runtime_dynamic_library_thread_attach();
break;
case DLL_THREAD_DETACH:
ios_auth_runtime_dynamic_library_thread_detach();
break;
case DLL_PROCESS_DETACH:
ios_auth_runtime_dynamic_library_process_detach();
break;
default:
break;
}
return TRUE;
}
#else
__attribute((constructor)) void ios_auth_runtime_dynamic_library_init(void)
{
ios_auth_runtime_dynamic_library_process_attach();
}
__attribute((destructor)) void ios_auth_runtime_dynamic_library_fini(void)
{
ios_auth_runtime_dynamic_library_process_detach();
}
#endif