Commit e5e05b97 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

wintrust: Create a dummy context to force creation of MachineGuid registry key.

parent f6522833
......@@ -960,6 +960,8 @@ HRESULT WINAPI DllRegisterServer(void)
HRESULT CryptRegisterRes = S_OK;
HRESULT TrustProviderRes = S_OK;
HRESULT SIPAddProviderRes = S_OK;
HCRYPTPROV crypt_provider;
BOOL ret;
TRACE("\n");
......@@ -1077,6 +1079,11 @@ add_trust_providers:
* a trust provider without a diagnostic policy).
*/
/* Create a dummy context to force creation of the MachineGuid registry key. */
ret = CryptAcquireContextW(&crypt_provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
if (ret) CryptReleaseContext(crypt_provider, 0);
else ERR("Failed to acquire cryptographic context: %u\n", GetLastError());
/* If CryptRegisterRes is not S_OK it will always overrule the return value. */
if (CryptRegisterRes != S_OK)
return CryptRegisterRes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment