From d4cd4aa8f4b04da45ece74725cc23f48ee132b35 Mon Sep 17 00:00:00 2001 From: Zeex Date: Tue, 29 Jul 2014 17:42:17 +0700 Subject: Call subhook_unprotect() only on first install --- subhook.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'subhook.h') diff --git a/subhook.h b/subhook.h index 3797a78..757218c 100644 --- a/subhook.h +++ b/subhook.h @@ -91,13 +91,15 @@ typedef struct subhook *subhook_t; SUBHOOK_EXPORT subhook_t SUBHOOK_API subhook_new(); SUBHOOK_EXPORT void SUBHOOK_API subhook_free(subhook_t hook); +/* Set hook source and destination. + * Do NOT call these functions after subhook_install() !! + */ SUBHOOK_EXPORT void SUBHOOK_API subhook_set_src(subhook_t hook, void *src); -SUBHOOK_EXPORT void *SUBHOOK_API subhook_get_src(subhook_t hook); - SUBHOOK_EXPORT void SUBHOOK_API subhook_set_dst(subhook_t hook, void *dst); + +SUBHOOK_EXPORT void *SUBHOOK_API subhook_get_src(subhook_t hook); SUBHOOK_EXPORT void *SUBHOOK_API subhook_get_dst(subhook_t hook); -/* These return 0 on failure and 1 on success. */ SUBHOOK_EXPORT int SUBHOOK_API subhook_install(subhook_t hook); SUBHOOK_EXPORT int SUBHOOK_API subhook_remove(subhook_t hook); -- cgit v1.1