From b172c4bbc75cdad0e8ccd22292aa671ba43cac45 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 Apr 2018 18:14:33 +0300 Subject: PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside --- protocols/Gadu-Gadu/src/gg.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'protocols/Gadu-Gadu/src/gg.cpp') 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; -} -- cgit v1.2.3