aboutsummaryrefslogtreecommitdiff
path: root/lib/substitute.h
diff options
context:
space:
mode:
authorYifan Lu2016-10-26 19:12:21 -0700
committerYifan Lu2016-10-26 19:12:21 -0700
commite895cdc598997a83a7999b558fba745ebc2a815d (patch)
treeb9e6c0b4b05c9ddc60482acdeb6b3be7da62421c /lib/substitute.h
parentVita: Added logging and changed cache flush name (diff)
downloadsubstitute-e895cdc598997a83a7999b558fba745ebc2a815d.tar.gz
Added passing of the opt data to records
Diffstat (limited to 'lib/substitute.h')
-rw-r--r--lib/substitute.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/substitute.h b/lib/substitute.h
index becf4b0..8cc2a4d 100644
--- a/lib/substitute.h
+++ b/lib/substitute.h
@@ -98,13 +98,16 @@ struct substitute_function_hook {
/* Currently unused; pass 0. (Protip: When using C {} struct initializer
* syntax, you can just omit this.) */
int options;
- /* Any platform specific auxiliary data */
+ /* Any platform specific auxiliary data. The data pointed to must remain
+ * valid until after the hook is freed! */
void *opt;
};
struct substitute_function_hook_record {
/* Function that was originally hooked. */
void *function;
+ /* Any platform specific auxiliary data copied from the hook */
+ void *opt;
/** Should at least be MAX_JUMP_PATCH_SIZE for your platform */
size_t buffer_size;
/** Store the original code. Must be large enough to hold MAX_JUMP_PATCH_SIZE