From 6ade56370bf370289da0a43051a86aafb5650b8a Mon Sep 17 00:00:00 2001 From: anders_k Date: Sun, 21 Dec 2008 19:14:45 +0000 Subject: [PATCH] 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 --- Source/exehead/api.h | 2 +- Source/exehead/plugin.c | 8 ++++---- Source/exehead/plugin.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/exehead/api.h b/Source/exehead/api.h index 9a90278c..bd7a0465 100644 --- a/Source/exehead/api.h +++ b/Source/exehead/api.h @@ -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 diff --git a/Source/exehead/plugin.c b/Source/exehead/plugin.c index bf560f05..82e2fa80 100644 --- a/Source/exehead/plugin.c +++ b/Source/exehead/plugin.c @@ -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 */ diff --git a/Source/exehead/plugin.h b/Source/exehead/plugin.h index 1e605206..802c4d79 100644 --- a/Source/exehead/plugin.h +++ b/Source/exehead/plugin.h @@ -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();