aboutsummaryrefslogtreecommitdiff
path: root/subhook.h
diff options
context:
space:
mode:
authorgocha <gochaism@gmail.com>2017-03-31 15:42:52 +0900
committergocha <gochaism@gmail.com>2017-03-31 15:42:52 +0900
commit46ebdb5e154dbee031c44c187402949b1291ba8a (patch)
tree90ebf047474501cd235d5539ad136ff565145b6c /subhook.h
parent50a8d0ca24c514fb0b6946626e7856d85988f5a8 (diff)
downloadsubhook-46ebdb5e154dbee031c44c187402949b1291ba8a.zip
subhook-46ebdb5e154dbee031c44c187402949b1291ba8a.tar.gz
subhook-46ebdb5e154dbee031c44c187402949b1291ba8a.tar.bz2
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();