From 955e8047a7e312f93fb2b0611df017ac8acb59ab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 24 Nov 2023 19:03:52 +0300 Subject: this return value is needed --- include/m_protoint.h | 6 +++--- src/mir_app/src/proto_utils.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/m_protoint.h b/include/m_protoint.h index 8c169b8192..283a830c2c 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -50,7 +50,7 @@ EXTERN_C MIR_APP_DLL(void) ProtoWindowAdd(PROTO_INTERFACE *pThis, HWND hwnd); EXTERN_C MIR_APP_DLL(void) ProtoWindowRemove(PROTO_INTERFACE *pThis, HWND hwnd); typedef int (MIR_CDECL PROTO_INTERFACE::*ProtoEventFunc)(WPARAM, LPARAM); -EXTERN_C MIR_APP_DLL(void) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szName, ProtoEventFunc pFunc); +EXTERN_C MIR_APP_DLL(HANDLE) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szName, ProtoEventFunc pFunc); EXTERN_C MIR_APP_DLL(HANDLE) ProtoCreateHookableEvent(PROTO_INTERFACE *pThis, const char* szService); typedef INT_PTR (MIR_CDECL PROTO_INTERFACE::*ProtoServiceFunc)(WPARAM, LPARAM); @@ -309,8 +309,8 @@ template struct PROTO : public PROTO_INTERFACE return ::ProtoCreateHookableEvent(this, name); } typedef int(MIR_CDECL T::*MyEventFunc)(WPARAM, LPARAM); - __forceinline void HookProtoEvent(const char *name, MyEventFunc pFunc) { - ::ProtoHookEvent(this, name, (ProtoEventFunc)pFunc); } + __forceinline HANDLE HookProtoEvent(const char *name, MyEventFunc pFunc) { + return ::ProtoHookEvent(this, name, (ProtoEventFunc)pFunc); } typedef void(MIR_CDECL T::*MyThreadFunc)(void*); __forceinline void ForkThread(MyThreadFunc pFunc, void *param = nullptr) { diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index dcb3d051fa..6a43e8736d 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -165,9 +165,9 @@ MIR_APP_DLL(void) ProtoCreateServiceParam(PROTO_INTERFACE *pThis, const char* sz ///////////////////////////////////////////////////////////////////////////////////////// // protocol events -MIR_APP_DLL(void) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szEvent, ProtoEventFunc handler) +MIR_APP_DLL(HANDLE) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szEvent, ProtoEventFunc handler) { - ::HookEventObj(szEvent, (MIRANDAHOOKOBJ)*(void**)&handler, pThis); + return ::HookEventObj(szEvent, (MIRANDAHOOKOBJ)*(void**)&handler, pThis); } MIR_APP_DLL(HANDLE) ProtoCreateHookableEvent(PROTO_INTERFACE *pThis, const char* szName) -- cgit v1.2.3