From 68a5642d5c9fce440aa8679614771af93b62034f Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 2 Sep 2015 21:12:26 +1000 Subject: [PATCH] regsvr32: Use correct exit code when GetProcAddress fails. --- programs/regsvr32/regsvr32.c | 6 +++--- programs/regsvr32/regsvr32.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c index f75825b5e6d..68cb94918a8 100644 --- a/programs/regsvr32/regsvr32.c +++ b/programs/regsvr32/regsvr32.c @@ -127,7 +127,7 @@ static int RegisterDll(const WCHAR* strDll) pfRegister = LoadProc(strDll, "DllRegisterServer", &DllHandle); if (!pfRegister) - return 0; + return GETPROCADDRESS_FAILED; hr = pfRegister(); if(FAILED(hr)) @@ -150,7 +150,7 @@ static int UnregisterDll(const WCHAR* strDll) pfUnregister = LoadProc(strDll, "DllUnregisterServer", &DllHandle); if (!pfUnregister) - return 0; + return GETPROCADDRESS_FAILED; hr = pfUnregister(); if(FAILED(hr)) @@ -173,7 +173,7 @@ static int InstallDll(BOOL install, const WCHAR *strDll, const WCHAR *command_li pfInstall = LoadProc(strDll, "DllInstall", &DllHandle); if (!pfInstall) - return 0; + return GETPROCADDRESS_FAILED; hr = pfInstall(install, command_line); if(FAILED(hr)) diff --git a/programs/regsvr32/regsvr32.h b/programs/regsvr32/regsvr32.h index e3b50eb87b5..c021c5570a9 100644 --- a/programs/regsvr32/regsvr32.h +++ b/programs/regsvr32/regsvr32.h @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +/* Exit codes */ +#define GETPROCADDRESS_FAILED 4 + /* Resource strings */ #define STRING_HEADER 1000 #define STRING_USAGE 1001