From: Dmitry Timoshkov <dmitry(a)baikal.ru> CSP is loaded for each imported certificate, and if CSP accesses Root store it deadlocks. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/crypt32/rootstore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c index cfddcc143ac..5c055193d4a 100644 --- a/dlls/crypt32/rootstore.c +++ b/dlls/crypt32/rootstore.c @@ -748,6 +748,8 @@ void CRYPT_ImportSystemRootCertsToReg(void) if (root_certs_imported) return; + root_certs_imported = TRUE; + hsem = CreateSemaphoreW( NULL, 0, 1, L"crypt32_root_semaphore"); if (!hsem) { @@ -787,7 +789,6 @@ done: RegCloseKey(key); CertCloseStore(store, 0); CertCloseStore(reg, 0); - root_certs_imported = TRUE; ReleaseSemaphore(hsem, 1, NULL); CloseHandle(hsem); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6138