Module: wine Branch: master Commit: e5e05b971b64496d3967fc3f8b9cdf8d608d14a1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e5e05b971b64496d3967fc3f8b...
Author: Sebastian Lackner sebastian@fds-team.de Date: Fri Jul 31 08:07:33 2015 +0200
wintrust: Create a dummy context to force creation of MachineGuid registry key.
---
dlls/wintrust/register.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c index 9981fbc..303426c 100644 --- a/dlls/wintrust/register.c +++ b/dlls/wintrust/register.c @@ -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;