changed RegisterPluginCallback return from BOOL to int to support a more detailed return value

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5879 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2008-12-21 19:14:45 +00:00
parent a821a3ee5e
commit 6ade56370b
3 changed files with 6 additions and 6 deletions

View file

@ -65,7 +65,7 @@ typedef struct {
exec_flags_t *exec_flags; exec_flags_t *exec_flags;
int (NSISCALL *ExecuteCodeSegment)(int, HWND); int (NSISCALL *ExecuteCodeSegment)(int, HWND);
void (NSISCALL *validate_filename)(char *); void (NSISCALL *validate_filename)(char *);
BOOL (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
} extra_parameters; } extra_parameters;
// Definitions for page showing plug-ins // Definitions for page showing plug-ins

View file

@ -69,14 +69,14 @@ BOOL NSISCALL Plugins_CanUnload(HANDLE pluginHandle)
return TRUE; return TRUE;
} }
BOOL NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc) int NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc)
{ {
loaded_plugin* p; loaded_plugin* p;
if (!Plugins_CanUnload(pluginHandle)) if (!Plugins_CanUnload(pluginHandle))
{ {
// already registered // already registered
return FALSE; return 1;
} }
p = (loaded_plugin*) GlobalAlloc(GPTR, sizeof(loaded_plugin)); p = (loaded_plugin*) GlobalAlloc(GPTR, sizeof(loaded_plugin));
@ -88,10 +88,10 @@ BOOL NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK pr
g_plugins = p; g_plugins = p;
return TRUE; return 0;
} }
return FALSE; return -1;
} }
#endif /* #ifdef NSIS_CONFIG_PLUGIN_SUPPORT */ #endif /* #ifdef NSIS_CONFIG_PLUGIN_SUPPORT */

View file

@ -23,7 +23,7 @@
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT #ifdef NSIS_CONFIG_PLUGIN_SUPPORT
extern BOOL NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc); extern int NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc);
extern void NSISCALL Plugins_SendMsgToAllPlugins(int msg); extern void NSISCALL Plugins_SendMsgToAllPlugins(int msg);
extern void NSISCALL Plugins_UnloadAll(); extern void NSISCALL Plugins_UnloadAll();