Hugh McMaster : regsvr32: Return the most recent error code, even if later DLLs succeed.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 9 09:57:37 CDT 2015


Module: wine
Branch: master
Commit: e19a8fd706768aa2bcbeeec2f22ca991c4821ad3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e19a8fd706768aa2bcbeeec2f22ca991c4821ad3

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Wed Sep  9 20:43:52 2015 +1000

regsvr32: Return the most recent error code, even if later DLLs succeed.

---

 programs/regsvr32/regsvr32.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c
index a1b55a3..03d45fa 100644
--- a/programs/regsvr32/regsvr32.c
+++ b/programs/regsvr32/regsvr32.c
@@ -19,9 +19,6 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * This version deliberately differs in error handling compared to the
- * Windows version.
  */
 
 #define WIN32_LEAN_AND_MEAN
@@ -221,7 +218,7 @@ static WCHAR *parse_command_line(WCHAR *command_line)
 
 int wmain(int argc, WCHAR* argv[])
 {
-    int             i;
+    int             i, res, ret = 0;
     BOOL            CallRegister = TRUE;
     BOOL            CallInstall = FALSE;
     BOOL            Unregister = FALSE;
@@ -286,7 +283,7 @@ int wmain(int argc, WCHAR* argv[])
         if (argv[i])
         {
             WCHAR *DllName = argv[i];
-            int res = 0;
+            res = 0;
 
             DllFound = TRUE;
             if (CallInstall && Unregister)
@@ -294,7 +291,10 @@ int wmain(int argc, WCHAR* argv[])
 
             /* The Windows version stops processing the current file on the first error. */
             if (res)
+            {
+                ret = res;
                 continue;
+            }
 
             if (!CallInstall || (CallInstall && CallRegister))
             {
@@ -305,13 +305,19 @@ int wmain(int argc, WCHAR* argv[])
             }
 
             if (res)
+            {
+                ret = res;
                 continue;
+            }
 
             if (CallInstall && !Unregister)
                 res = InstallDll(!Unregister, DllName, wsCommandLine);
 
             if (res)
+            {
+                ret = res;
 		continue;
+            }
         }
     }
 
@@ -324,5 +330,6 @@ int wmain(int argc, WCHAR* argv[])
 
     OleUninitialize();
 
-    return 0;
+    /* return the most recent error code, even if later DLLs succeed */
+    return ret;
 }




More information about the wine-cvs mailing list