version 1.28 | | version 1.29 |
---|
| | |
/* | | /* |
* static char *rcsid_plugins_c = | | * static char *rcsid_plugins_c = |
* "$Id: plugins.c,v 1.28 2004/10/16 21:43:47 akirschbaum Exp $"; | | * "$Id: plugins.c,v 1.29 2004/10/18 06:10:12 akirschbaum Exp $"; |
*/ | | */ |
| | |
/*****************************************************************************/ | | /*****************************************************************************/ |
| | |
int i=0; | | int i=0; |
HMODULE DLLInstance; | | HMODULE DLLInstance; |
void *ptr = NULL; | | void *ptr = NULL; |
CFParm* HookParm; | | CFParm HookParm; |
| | |
if ((DLLInstance = LoadLibrary(pluginfile))==NULL) | | if ((DLLInstance = LoadLibrary(pluginfile))==NULL) |
{ | | { |
| | |
{ | | { |
int j; | | int j; |
i = 0; | | i = 0; |
HookParm = (CFParm *)(malloc(sizeof(CFParm))); | | |
HookParm->Value[0]=(int *)(malloc(sizeof(int))); | | |
| | |
for(j=1; j<NR_OF_HOOKS;j++) | | for(j=1; j<NR_OF_HOOKS;j++) |
{ | | { |
memcpy(HookParm->Value[0], &j, sizeof(int)); | | int tmp = j; |
HookParm->Value[1] = HookList[j]; | | HookParm.Value[0] = &tmp; |
| | HookParm.Value[1] = HookList[j]; |
/*switch(j) | | /*switch(j) |
{ | | { |
case HOOK_NONE: | | case HOOK_NONE: |
| | |
| | |
/* Serious bug, fix this in all local copies */ | | /* Serious bug, fix this in all local copies */ |
/* HookParm->dparm = 2044; */ | | /* HookParm->dparm = 2044; */ |
PlugList[PlugNR].hookfunc(HookParm); | | PlugList[PlugNR].hookfunc(&HookParm); |
}; | | }; |
free(HookParm->Value[0]); | | |
free(HookParm); | | |
}; | | }; |
if (PlugList[PlugNR].eventfunc==NULL) | | if (PlugList[PlugNR].eventfunc==NULL) |
{ | | { |
| | |
{ | | { |
int i=0; | | int i=0; |
void *ptr = NULL; | | void *ptr = NULL; |
CFParm* HookParm; | | CFParm HookParm; |
if ((ptr=dlopen(pluginfile,RTLD_NOW|RTLD_GLOBAL))==NULL) | | if ((ptr=dlopen(pluginfile,RTLD_NOW|RTLD_GLOBAL))==NULL) |
{ | | { |
LOG(llevInfo,"Plugin error: %s\n", dlerror()); | | LOG(llevInfo,"Plugin error: %s\n", dlerror()); |
| | |
{ | | { |
int j; | | int j; |
i = 0; | | i = 0; |
HookParm = (CFParm *)(malloc(sizeof(CFParm))); | | |
HookParm->Value[0]=(int *)(malloc(sizeof(int))); | | |
| | |
for(j=1; j<NR_OF_HOOKS;j++) | | for(j=1; j<NR_OF_HOOKS;j++) |
{ | | { |
memcpy(HookParm->Value[0], &j, sizeof(int)); | | int tmp = j; |
HookParm->Value[1] = HookList[j]; | | HookParm.Value[0] = &tmp; |
| | HookParm.Value[1] = HookList[j]; |
/*switch(j) | | /*switch(j) |
{ | | { |
case HOOK_NONE: | | case HOOK_NONE: |
| | |
HookParm->Value[1] = &CFWSendCustomCommand; | | HookParm->Value[1] = &CFWSendCustomCommand; |
break; | | break; |
};*/ | | };*/ |
PlugList[PlugNR].hookfunc(HookParm); | | PlugList[PlugNR].hookfunc(&HookParm); |
}; | | }; |
free(HookParm->Value[0]); | | |
free(HookParm); | | |
}; | | }; |
if (PlugList[PlugNR].eventfunc==NULL) | | if (PlugList[PlugNR].eventfunc==NULL) |
{ | | { |