Paul Vriens : wintrust: Only register actions when HKLM\Software\Microsoft\Cryptography\Providers\Trust can be opened .

Alexandre Julliard julliard at wine.codeweavers.com
Thu Sep 7 07:12:13 CDT 2006


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

Author: Paul Vriens <Paul.Vriens at xs4all.nl>
Date:   Wed Sep  6 10:04:27 2006 +0200

wintrust: Only register actions when HKLM\Software\Microsoft\Cryptography\Providers\Trust can be opened.

---

 dlls/wintrust/register.c |   44 ++++++++++++++++++++++++++------------------
 1 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c
index 48d04d8..bc40020 100644
--- a/dlls/wintrust/register.c
+++ b/dlls/wintrust/register.c
@@ -708,9 +708,6 @@ HRESULT WINAPI DllRegisterServer(void)
 
     TRACE("\n");
 
-    /* Create the necessary action registry structures */
-    WINTRUST_InitRegStructs();
-
     /* FIXME:
      * 
      * A short list of stuff that should be done here:
@@ -731,22 +728,33 @@ HRESULT WINAPI DllRegisterServer(void)
 
     /* 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;
-    RegCloseKey(Key);
-
-    /* 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();
+    }
+    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;
 }




More information about the wine-cvs mailing list