[PATCH 2 of 2] Improve error handling and use unicode function for unload

Wald Commits scm-commit at wald.intevation.org
Mon Jun 30 11:26:09 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1404120365 -7200
# Node ID 85c5aa9aba2b51892729b8dd1c7f777b0101d05f
# Parent  cb40af11ec3a9471e1208aae2a3ecca7424d3dd4
Improve error handling and use unicode function for unload

diff -r cb40af11ec3a -r 85c5aa9aba2b cinst/nssstore_win.c
--- a/cinst/nssstore_win.c	Mon Jun 30 11:25:40 2014 +0200
+++ b/cinst/nssstore_win.c	Mon Jun 30 11:26:05 2014 +0200
@@ -583,6 +583,7 @@
         {
           /* This is somewhat expected if the registry is not located
              in the standard location. Failure is accepted in that case. */
+          SetLastError((DWORD)ret);
           PRINTLASTERROR ("Failed to load hive.");
           continue;
         }
@@ -609,7 +610,12 @@
         }
 
       RegCloseKey (key_handle);
-      RegUnLoadKey (HKEY_LOCAL_MACHINE, APPNAME L"_tmphive");
+      ret = RegUnLoadKeyW (HKEY_LOCAL_MACHINE, APPNAME L"_tmphive");
+      if (ret != ERROR_SUCCESS)
+        {
+          SetLastError ((DWORD)ret);
+          PRINTLASTERROR ("Failed to unload hive.");
+        }
     }
 
   xfree (run_command);


More information about the Trustbridge-commits mailing list