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 --- include/m_protocols.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'include/m_protocols.h') diff --git a/include/m_protocols.h b/include/m_protocols.h index 3c8a70a444..db32e1f94a 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -151,20 +151,17 @@ typedef struct PROTO_INTERFACE* (*pfnInitProto)(const char* szModuleName, const // deallocates an account instance typedef int (*pfnUninitProto)(PROTO_INTERFACE*); -// removes an account from the database -typedef int (*pfnDestroyProto)(PROTO_INTERFACE*); - -typedef struct { +struct PROTOCOLDESCRIPTOR +{ size_t cbSize; char *szName; // unique name of the module int type; // module type, see PROTOTYPE_ constants - // 0.8.0+ additions - pfnInitProto fnInit; // initializes an empty account - pfnUninitProto fnUninit; // deallocates an account instance - pfnDestroyProto fnDestroy; // removes an account -} - PROTOCOLDESCRIPTOR; + // these fields should be filled only for protos with accounts + pfnInitProto fnInit; // initializes an empty account + pfnUninitProto fnUninit; // deallocates an account instance + HINSTANCE hInst; // module to which that proto belongs to +}; ///////////////////////////////////////////////////////////////////////////////////////// // Enumerate the currently running protocols -- cgit v1.2.3