diff cinst/nssstore_win.c @ 677:85c5aa9aba2b

Improve error handling and use unicode function for unload
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 30 Jun 2014 11:26:05 +0200
parents cb40af11ec3a
children a511c1f45c70
line wrap: on
line diff
--- 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);

http://wald.intevation.org/projects/trustbridge/