From 320b9eb47451eb8c167b211282f2ea49fcfbbab8 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 19 Oct 2020 11:24:12 +0200 Subject: [PATCH] dssenh: Implement CRYPT_DELETEKEYSET. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/dssenh/main.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/dssenh/main.c b/dlls/dssenh/main.c index 5ad0ef1505d..4867fef2f59 100644 --- a/dlls/dssenh/main.c +++ b/dlls/dssenh/main.c @@ -247,6 +247,23 @@ static struct container *read_key_container( const char *name, DWORD flags ) return ret; } +static void delete_key_container( const char *name, DWORD flags ) +{ + char path[sizeof(dss_path_fmt) + MAX_PATH]; + HKEY rootkey; + + sprintf( path, dss_path_fmt, name ); + + if (flags & CRYPT_MACHINE_KEYSET) + rootkey = HKEY_LOCAL_MACHINE; + else + rootkey = HKEY_CURRENT_USER; + + /* @@ Wine registry key: HKLM\Software\Wine\Crypto\DSS */ + /* @@ Wine registry key: HKCU\Software\Wine\Crypto\DSS */ + RegDeleteKeyExA( rootkey, path, 0, 0 ); +} + BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags, PVTableProvStruc vtable ) { struct container *ret; @@ -285,6 +302,11 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags ret = create_key_container( "", flags ); break; + case CRYPT_DELETEKEYSET: + delete_key_container( name, flags ); + *ret_prov = 0; + return TRUE; + default: FIXME( "unsupported flags %08x\n", flags ); return FALSE;