summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-30 19:36:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-30 19:36:55 +0000
commitb741619e220a230f2b7d07318eb68f412c93e43a (patch)
tree1591f742be2e7d531fb9b798b222e3babc490e09
parent7f2774b273be8f12622f80738860f04aa3166cde (diff)
compatibility fix for core
git-svn-id: http://svn.miranda-ng.org/main/trunk@706 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Mir_core/modules.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/Mir_core/modules.cpp b/plugins/Mir_core/modules.cpp
index 61e7344676..6c023891a8 100644
--- a/plugins/Mir_core/modules.cpp
+++ b/plugins/Mir_core/modules.cpp
@@ -227,7 +227,7 @@ MIR_CORE_DLL(int) CallHookSubscribers(HANDLE hEvent, WPARAM wParam, LPARAM lPara
return returnVal;
}
-static bool checkHook(HANDLE hHook)
+__forceinline bool checkHook(HANDLE hHook, bool& bIsValid)
{
THook* p = (THook*)hHook;
if (p == NULL)
@@ -237,15 +237,15 @@ static bool checkHook(HANDLE hHook)
__try
{
if (p->secretSignature != HOOK_SECRET_SIGNATURE)
- ret = false;
+ bIsValid = ret = false;
else if (p->subscriberCount == 0 && p->pfnHook == NULL)
- ret = false;
+ bIsValid = true, ret = false;
else
ret = true;
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
- ret = false;
+ bIsValid = ret = false;
}
return ret;
@@ -260,8 +260,9 @@ static void CALLBACK HookToMainAPCFunc(ULONG_PTR dwParam)
MIR_CORE_DLL(int) NotifyEventHooks(HANDLE hEvent, WPARAM wParam, LPARAM lParam)
{
- if ( !checkHook(hEvent))
- return -1;
+ bool bIsValid;
+ if ( !checkHook(hEvent, bIsValid))
+ return (bIsValid) ? 0 : -1;
if ( GetCurrentThreadId() == mainThreadId)
return CallHookSubscribers(hEvent, wParam, lParam);