comparison 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
comparison
equal deleted inserted replaced
676:cb40af11ec3a 677:85c5aa9aba2b
581 581
582 if (ret != ERROR_SUCCESS) 582 if (ret != ERROR_SUCCESS)
583 { 583 {
584 /* This is somewhat expected if the registry is not located 584 /* This is somewhat expected if the registry is not located
585 in the standard location. Failure is accepted in that case. */ 585 in the standard location. Failure is accepted in that case. */
586 SetLastError((DWORD)ret);
586 PRINTLASTERROR ("Failed to load hive."); 587 PRINTLASTERROR ("Failed to load hive.");
587 continue; 588 continue;
588 } 589 }
589 590
590 ret = RegOpenKeyExW (HKEY_LOCAL_MACHINE, 591 ret = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
607 { 608 {
608 ERRORPRINTF ("Failed to write RunOnce key."); 609 ERRORPRINTF ("Failed to write RunOnce key.");
609 } 610 }
610 611
611 RegCloseKey (key_handle); 612 RegCloseKey (key_handle);
612 RegUnLoadKey (HKEY_LOCAL_MACHINE, APPNAME L"_tmphive"); 613 ret = RegUnLoadKeyW (HKEY_LOCAL_MACHINE, APPNAME L"_tmphive");
614 if (ret != ERROR_SUCCESS)
615 {
616 SetLastError ((DWORD)ret);
617 PRINTLASTERROR ("Failed to unload hive.");
618 }
613 } 619 }
614 620
615 xfree (run_command); 621 xfree (run_command);
616 strv_free (hives); 622 strv_free (hives);
617 } 623 }

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