You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Use alternative approach to create MachineGuid registry key during wineprefix startup.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
From 8c028847d81f5dbd4ffc7f56e21b9a4141eef89e Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 31 Jul 2015 05:43:45 +0200
|
||||
Subject: wintrust: Create a dummy context to force creation of MachineGuid
|
||||
registry key.
|
||||
|
||||
---
|
||||
dlls/wintrust/register.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c
|
||||
index 9981fbc..0dbb99c 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,12 @@ add_trust_providers:
|
||||
* a trust provider without a diagnostic policy).
|
||||
*/
|
||||
|
||||
+ /* Acquire a dummy context to ensure that the MachineGuid registry key
|
||||
+ * is created immediately after the creation of a new Wineprefix. */
|
||||
+ 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;
|
||||
--
|
||||
2.5.0
|
||||
|
||||
1
patches/wintrust-MachineGuid/definition
Normal file
1
patches/wintrust-MachineGuid/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [38508] Create HKLM\Software\Microsoft\Cryptography\MachineGuid registry key
|
||||
Reference in New Issue
Block a user