[PATCH 2/3] regsvr32: Use correct exit code when LoadLibraryEx fails

Hugh McMaster hugh.mcmaster at outlook.com
Wed Sep 2 06:12:27 CDT 2015


Fixes 13 test failures.
---
 programs/regsvr32/regsvr32.c | 2 +-
 programs/regsvr32/regsvr32.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c
index 68cb949..c0a9e13 100644
--- a/programs/regsvr32/regsvr32.c
+++ b/programs/regsvr32/regsvr32.c
@@ -107,7 +107,7 @@ static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHan
     if(!*DllHandle)
     {
         output_write(STRING_DLL_LOAD_FAILED, strDll);
-        ExitProcess(1);
+        ExitProcess(LOADLIBRARY_FAILED);
     }
     proc = (VOID *) GetProcAddress(*DllHandle, procName);
     if(!proc)
diff --git a/programs/regsvr32/regsvr32.h b/programs/regsvr32/regsvr32.h
index c021c55..85b4a72 100644
--- a/programs/regsvr32/regsvr32.h
+++ b/programs/regsvr32/regsvr32.h
@@ -19,6 +19,7 @@
  */
 
 /* Exit codes */
+#define LOADLIBRARY_FAILED                    3
 #define GETPROCADDRESS_FAILED                 4
 
 /* Resource strings */
-- 
1.9.1




More information about the wine-patches mailing list