diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-18 18:14:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-18 18:14:33 +0300 |
commit | b172c4bbc75cdad0e8ccd22292aa671ba43cac45 (patch) | |
tree | 4677a04a47f3987c88f3fb44c6b70d2642b1f8a3 /protocols/Gadu-Gadu/src/gg.cpp | |
parent | 524d1c7186eca3f0a4da08548eeb919785227101 (diff) |
PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside
Diffstat (limited to 'protocols/Gadu-Gadu/src/gg.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 8aeffc1391..bec809277c 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -39,7 +39,7 @@ PLUGININFOEX pluginInfo = { // Other variables
CMPlugin g_plugin;
-HINSTANCE hInstance;
+HINSTANCE g_hInstance;
SSL_API sslApi;
CLIST_INTERFACE *pcli;
@@ -47,6 +47,8 @@ int hLangpack; static unsigned long crc_table[256];
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
+
//////////////////////////////////////////////////////////
// Extra winsock function for error description
//
@@ -407,17 +409,3 @@ void gg_debughandler(int level, const char *format, va_list ap) free(szFormat);
}
#endif
-
-//////////////////////////////////////////////////////////
-// main DLL function
-//
-BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD, LPVOID)
-{
- crc_gentable();
- hInstance = hInst;
-#ifdef DEBUGMODE
- gg_debug_level = GG_DEBUG_FUNCTION;
- gg_debug_handler = gg_debughandler;
-#endif
- return TRUE;
-}
|