From 22e4f01fda1d9f61b0e663eb9e4edf8bd73b6e91 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Mon, 22 Aug 2016 03:34:24 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 2 ++ .../HPMHooking/HPMHooking_char.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_char.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 27 ++++++++++++++++++++++ 4 files changed, 34 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 4061bd4d4..9968d1d18 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2876,6 +2876,8 @@ typedef void (*HPMHOOK_pre_inter_final) (void); typedef void (*HPMHOOK_post_inter_final) (void); typedef bool (*HPMHOOK_pre_inter_config_read) (const char **filename, bool *imported); typedef bool (*HPMHOOK_post_inter_config_read) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_inter_config_read_log) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_inter_config_read_log) (bool retVal___, const char *filename, const struct config_t *config, bool imported); typedef bool (*HPMHOOK_pre_inter_config_read_connection) (const char **filename, const struct config_t **config, bool *imported); typedef bool (*HPMHOOK_post_inter_config_read_connection) (bool retVal___, const char *filename, const struct config_t *config, bool imported); #endif // CHAR_INTER_H diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 44b56143f..836e51f3f 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -552,6 +552,8 @@ struct { struct HPMHookPoint *HP_inter_final_post; struct HPMHookPoint *HP_inter_config_read_pre; struct HPMHookPoint *HP_inter_config_read_post; + struct HPMHookPoint *HP_inter_config_read_log_pre; + struct HPMHookPoint *HP_inter_config_read_log_post; struct HPMHookPoint *HP_inter_config_read_connection_pre; struct HPMHookPoint *HP_inter_config_read_connection_post; struct HPMHookPoint *HP_inter_mail_sql_init_pre; @@ -2055,6 +2057,8 @@ struct { int HP_inter_final_post; int HP_inter_config_read_pre; int HP_inter_config_read_post; + int HP_inter_config_read_log_pre; + int HP_inter_config_read_log_post; int HP_inter_config_read_connection_pre; int HP_inter_config_read_connection_post; int HP_inter_mail_sql_init_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 35f9044d5..047373f77 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -302,6 +302,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->parse_frommap, HP_inter_parse_frommap) }, { HP_POP(inter->final, HP_inter_final) }, { HP_POP(inter->config_read, HP_inter_config_read) }, + { HP_POP(inter->config_read_log, HP_inter_config_read_log) }, { HP_POP(inter->config_read_connection, HP_inter_config_read_connection) }, /* inter_mail_interface */ { HP_POP(inter_mail->sql_init, HP_inter_mail_sql_init) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 3669b2da8..63afcab3c 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -7060,6 +7060,33 @@ bool HP_inter_config_read(const char *filename, bool imported) { } return retVal___; } +bool HP_inter_config_read_log(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_inter_config_read_log_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_log_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_inter_config_read_log_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter.config_read_log(filename, config, imported); + } + if( HPMHooks.count.HP_inter_config_read_log_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_log_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_inter_config_read_log_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} bool HP_inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) { int hIndex = 0; bool retVal___ = false; -- cgit v1.2.3-60-g2f50