wintrust: Create a dummy context to force creation of MachineGuid registry key.
This commit is contained in:
parent
f652283368
commit
e5e05b971b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue