summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-05-06 00:57:52 +0200
committerGitHub <noreply@github.com>2019-05-06 00:57:52 +0200
commitd6fecbcb87db2a32bf189627b9b1dd7230265458 (patch)
treebfca349739ff534a6d22d5eded1a75ec4b3c34ee /src/plugins/HPMHooking.h
parent17652f0c3cf821263976361424e4fd56fce61c8a (diff)
parent4779a6137745f9ccad897b767ecfc9ff3bf5082e (diff)
downloadhercules-d6fecbcb87db2a32bf189627b9b1dd7230265458.tar.gz
hercules-d6fecbcb87db2a32bf189627b9b1dd7230265458.tar.bz2
hercules-d6fecbcb87db2a32bf189627b9b1dd7230265458.tar.xz
hercules-d6fecbcb87db2a32bf189627b9b1dd7230265458.zip
Merge pull request #2447 from hemagx/hpm_private_hooks
Restore the ability for HPM Hooks to hook to private interfaces
Diffstat (limited to 'src/plugins/HPMHooking.h')
-rw-r--r--src/plugins/HPMHooking.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking.h b/src/plugins/HPMHooking.h
index 44970863c..f94dccac4 100644
--- a/src/plugins/HPMHooking.h
+++ b/src/plugins/HPMHooking.h
@@ -50,11 +50,21 @@ HPExport struct HPMHooking_interface HPMHooking_s;
HPMi->hooking->AddHook(HOOK_TYPE_PRE, #ifname "->" #funcname, (hook), HPMi->pid) \
)
+#define addHookPrePriv(ifname, funcname, hook) ( \
+ (void)((HPMHOOK_pre_PRIV__ ## ifname ## _ ## funcname)0 == (hook)), \
+ HPMi->hooking->AddHook(HOOK_TYPE_PRE, #ifname "->p->" #funcname, (hook), HPMi->pid) \
+ )
+
#define addHookPost(ifname, funcname, hook) ( \
(void)((HPMHOOK_post_ ## ifname ## _ ## funcname)0 == (hook)), \
HPMi->hooking->AddHook(HOOK_TYPE_POST, #ifname "->" #funcname, (hook), HPMi->pid) \
)
+#define addHookPostPriv(ifname, funcname, hook) ( \
+ (void)((HPMHOOK_post_PRIV__ ## ifname ## _ ## funcname)0 == (hook)), \
+ HPMi->hooking->AddHook(HOOK_TYPE_POST, #ifname "->p->" #funcname, (hook), HPMi->pid) \
+ )
+
/* need better names ;/ */
/* will not run the original function after pre-hook processing is complete (other hooks will run) */
#define hookStop() (HPMi->hooking->HookStop(__func__,HPMi->pid))