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:
parent
a821a3ee5e
commit
6ade56370b
3 changed files with 6 additions and 6 deletions
|
@ -65,7 +65,7 @@ typedef struct {
|
|||
exec_flags_t *exec_flags;
|
||||
int (NSISCALL *ExecuteCodeSegment)(int, HWND);
|
||||
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;
|
||||
|
||||
// Definitions for page showing plug-ins
|
||||
|
|
|
@ -69,14 +69,14 @@ BOOL NSISCALL Plugins_CanUnload(HANDLE pluginHandle)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc)
|
||||
int NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc)
|
||||
{
|
||||
loaded_plugin* p;
|
||||
|
||||
if (!Plugins_CanUnload(pluginHandle))
|
||||
{
|
||||
// already registered
|
||||
return FALSE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
p = (loaded_plugin*) GlobalAlloc(GPTR, sizeof(loaded_plugin));
|
||||
|
@ -88,10 +88,10 @@ BOOL NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK pr
|
|||
|
||||
g_plugins = p;
|
||||
|
||||
return TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* #ifdef NSIS_CONFIG_PLUGIN_SUPPORT */
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#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_UnloadAll();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue