Module: wine
Branch: master
Commit: 0b0fc5593d88e3f42ae47e2e0b4ec2f68f5d9611
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=0b0fc5593d88e3f42ae47e2…
Author: Paul Vriens <Paul.Vriens(a)xs4all.nl>
Date: Tue Sep 12 19:53:53 2006 +0200
wintrust: Use the return values of the registration functions.
---
dlls/wintrust/register.c | 80 +++++++++++++++++++++++-----------------------
1 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c
index 061dfaf..7a55e88 100644
--- a/dlls/wintrust/register.c
+++ b/dlls/wintrust/register.c
@@ -797,8 +797,8 @@ HRESULT WINAPI DllRegisterServer(void)
static const CHAR CatMemberInfoDecode[] = "WVTAsn1CatMemberInfoDecode";
static const CHAR SpcSpOpusInfoEncode[] = "WVTAsn1SpcSpOpusInfoEncode";
static const CHAR SpcSpOpusInfoDecode[] = "WVTAsn1SpcSpOpusInfoDecode";
- HRESULT Res = S_OK;
- HKEY Key;
+ HRESULT CryptRegisterRes = S_OK;
+ HRESULT TrustProviderRes = S_OK;
TRACE("\n");
@@ -822,12 +822,12 @@ #define WINTRUST_REGISTEROID( oid, encod
do { \
if (!CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, encode_funcname)) \
{ \
- Res = HRESULT_FROM_WIN32(GetLastError()); \
+ CryptRegisterRes = HRESULT_FROM_WIN32(GetLastError()); \
goto add_trust_providers; \
} \
if (!CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, decode_funcname)) \
{ \
- Res = HRESULT_FROM_WIN32(GetLastError()); \
+ CryptRegisterRes = HRESULT_FROM_WIN32(GetLastError()); \
goto add_trust_providers; \
} \
} while (0)
@@ -864,44 +864,44 @@ #undef WINTRUST_REGISTEROID
add_trust_providers:
/* Testing on W2K3 shows:
- * If we cannot open HKLM\Software\Microsoft\Cryptography\Providers\Trust
- * for writing, DllRegisterServer returns S_FALSE. If the key can be opened
- * there is no check whether the actions can be written in the registry.
- * As the previous list shows, there are several calls after these registrations.
- * If they fail they will overwrite the returnvalue of DllRegisterServer.
+ * All registry writes are tried. If one fails this part will return S_FALSE
+ * but only if the first (CryptRegisterOIDFunction calls) and the third
+ * (CryptSIPAddProvider calls) part succeed.
+ *
+ * Last error is set to the last error encountered, regardless if the first
+ * part failed or not.
*/
- /* Check if we can open/create HKLM\Software\Microsoft\Cryptography\Providers\Trust */
- if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, Trust, 0, NULL, 0, KEY_WRITE, NULL, &Key, NULL) != ERROR_SUCCESS)
- {
- /* If the opening/creation of the key fails, there is no need to do the action registrations as they
- * will fail as well.
- */
- Res = S_FALSE;
- }
- else
- {
- RegCloseKey(Key);
-
- /* Create the necessary action registry structures */
- WINTRUST_InitRegStructs();
-
- /* Register several Trust Provider actions */
- WINTRUST_RegisterGenVerifyV2();
- WINTRUST_RegisterPublishedSoftware();
- WINTRUST_RegisterPublishedSoftwareNoBadUi();
- WINTRUST_RegisterGenCertVerify();
- WINTRUST_RegisterTrustProviderTest();
- WINTRUST_RegisterHttpsProv();
- WINTRUST_RegisterOfficeSignVerify();
- WINTRUST_RegisterDriverVerify();
- WINTRUST_RegisterGenChainVerify();
-
- /* Free the registry structures */
- WINTRUST_FreeRegStructs();
- }
-
- return Res;
+ /* Create the necessary action registry structures */
+ WINTRUST_InitRegStructs();
+
+ /* Register several Trust Provider actions */
+ if (!WINTRUST_RegisterGenVerifyV2())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterPublishedSoftware())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterPublishedSoftwareNoBadUi())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterGenCertVerify())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterTrustProviderTest())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterHttpsProv())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterOfficeSignVerify())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterDriverVerify())
+ TrustProviderRes = S_FALSE;
+ if (!WINTRUST_RegisterGenChainVerify())
+ TrustProviderRes = S_FALSE;
+
+ /* Free the registry structures */
+ WINTRUST_FreeRegStructs();
+
+ if (CryptRegisterRes == S_OK)
+ return TrustProviderRes;
+
+ return CryptRegisterRes;
}
/***********************************************************************
Module: tools
Branch: master
Commit: e87d936f2129488aa8ba20508c4611e1c87b3cfb
URL: http://source.winehq.org/git/?p=tools.git;a=commit;h=e87d936f2129488aa8ba20…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Tue Sep 12 20:07:06 2006 +0200
git-notify: Always exec the main git binary instead of the specific commands.
---
git-notify | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/git-notify b/git-notify
index 8301824..228d7a4 100755
--- a/git-notify
+++ b/git-notify
@@ -153,7 +153,7 @@ sub mail_notification($$$@)
# get the default repository name
sub get_repos_name()
{
- my $dir = `git-rev-parse --git-dir`;
+ my $dir = `git rev-parse --git-dir`;
chomp $dir;
my $repos = realpath($dir);
$repos =~ s/(.*?)((\.git\/)?\.git)$/\1/;
@@ -169,10 +169,12 @@ sub get_object_info($)
my @log = ();
my $do_log = 0;
- my $type = `git-cat-file -t $obj`;
+ open TYPE, "-|" or exec "git", "cat-file", "-t", $obj or die "cannot run git-cat-file";
+ my $type = <TYPE>;
chomp $type;
+ close TYPE;
- open OBJ, "git-cat-file $type $obj |" or die "cannot run git-cat-file";
+ open OBJ, "-|" or exec "git", "cat-file", $type, $obj or die "cannot run git-cat-file";
while (<OBJ>)
{
chomp;
@@ -325,7 +327,7 @@ sub send_global_notice($$$)
my ($ref, $old_sha1, $new_sha1) = @_;
my @notice = ();
- open LIST, "-|" or exec "git-rev-list", "--pretty", "^$old_sha1", "$new_sha1", @exclude_list or die "cannot exec git-rev-list";
+ open LIST, "-|" or exec "git", "rev-list", "--pretty", "^$old_sha1", "$new_sha1", @exclude_list or die "cannot exec git-rev-list";
while (<LIST>)
{
chomp;
@@ -351,7 +353,7 @@ if ($ARGV[1] eq '0' x 40) # new ref
my @commits = ();
-open LIST, "-|" or exec "git-rev-list", "^$ARGV[1]", "$ARGV[2]", @exclude_list or die "cannot exec git-rev-list";
+open LIST, "-|" or exec "git", "rev-list", "^$ARGV[1]", "$ARGV[2]", @exclude_list or die "cannot exec git-rev-list";
while (<LIST>)
{
chomp;