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

This commit is contained in:
Paul Vriens 2006-09-06 10:04:27 +02:00 committed by Alexandre Julliard
parent 609b7af8ce
commit 9132cac93c
1 changed files with 24 additions and 16 deletions

View File

@ -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,9 +728,19 @@ 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;
}
else
{
RegCloseKey(Key);
/* Create the necessary action registry structures */
WINTRUST_InitRegStructs();
/* Register several Trust Provider actions */
WINTRUST_RegisterGenVerifyV2();
WINTRUST_RegisterPublishedSoftware();
@ -747,6 +754,7 @@ HRESULT WINAPI DllRegisterServer(void)
/* Free the registry structures */
WINTRUST_FreeRegStructs();
}
return Res;
}