Rev 433 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 433 | Rev 489 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | 19 | ||
20 | #include <windows.h> |
20 | #include <windows.h> |
21 | 21 | ||
22 | HINSTANCE hDllInstance = NULL; /* DLL instance handle */ |
22 | HINSTANCE hDllInstance = NULL; /* DLL instance handle */ |
23 | 23 | ||
24 | BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpReserved); |
24 | BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); |
25 | 25 | ||
26 | BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpReserved) |
26 | BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) |
27 | { |
27 | { |
28 | UNREFERENCED_PARAMETER(lpReserved); |
28 | UNREFERENCED_PARAMETER(lpvReserved); |
29 | 29 | ||
- | 30 | #ifdef NEEDS_CRT_INIT |
|
30 | if (fdwReason == DLL_PROCESS_ATTACH) |
31 | if (fdwReason == DLL_PROCESS_ATTACH || fdwReason == DLL_THREAD_ATTACH) |
- | 32 | { |
|
- | 33 | __security_init_cookie(); |
|
- | 34 | __crt_dll_initialize(); |
|
- | 35 | } |
|
- | 36 | #endif |
|
- | 37 | ||
- | 38 | #ifdef __cplusplus |
|
- | 39 | if (fdwReason == DLL_PROCESS_ATTACH || fdwReason == DLL_THREAD_ATTACH) |
|
- | 40 | hDllInstance = static_cast<HINSTANCE>(hinstDLL); |
|
- | 41 | #else |
|
- | 42 | if (fdwReason == DLL_PROCESS_ATTACH || fdwReason == DLL_THREAD_ATTACH) |
|
31 | hDllInstance = hInstance; |
43 | hDllInstance = (HINSTANCE)hinstDLL; |
- | 44 | #endif |
|
32 | 45 | ||
33 | return TRUE; // Indicate that the DLL was initialized successfully. |
46 | return TRUE; // Indicate that the DLL was initialized successfully. |
34 | } |
47 | } |