aboutsummaryrefslogtreecommitdiff
path: root/subhook.h
diff options
context:
space:
mode:
authorZeex <zeex@rocketmail.com>2017-03-31 22:31:59 +0600
committerGitHub <noreply@github.com>2017-03-31 22:31:59 +0600
commit2f9d0c1f1cfb3366c189b8bd52a5e8c266d96e8a (patch)
tree90ebf047474501cd235d5539ad136ff565145b6c /subhook.h
parent50a8d0ca24c514fb0b6946626e7856d85988f5a8 (diff)
parent46ebdb5e154dbee031c44c187402949b1291ba8a (diff)
downloadsubhook-2f9d0c1f1cfb3366c189b8bd52a5e8c266d96e8a.zip
subhook-2f9d0c1f1cfb3366c189b8bd52a5e8c266d96e8a.tar.gz
subhook-2f9d0c1f1cfb3366c189b8bd52a5e8c266d96e8a.tar.bz2
Merge pull request #24 from gocha/scoped-install-with-new-handler
Add new ScopedHookInstall constructor which can set/override the new hook destination
Diffstat (limited to 'subhook.h')
-rw-r--r--subhook.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/subhook.h b/subhook.h
index c74e5d1..3fd0dc8 100644
--- a/subhook.h
+++ b/subhook.h
@@ -217,6 +217,15 @@ class ScopedHookInstall {
{
}
+ ScopedHookInstall(Hook *hook,
+ void *src,
+ void *dst,
+ HookOptions options = HookOptionsNone)
+ : hook_(hook)
+ , installed_(hook_->Install(src, dst, options))
+ {
+ }
+
~ScopedHookInstall() {
if (installed_) {
hook_->Remove();