From 7c915af47ec6b153cf29da36986b41bbf9402a32 Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Sun, 5 Jun 2016 09:35:39 -0700 Subject: [PATCH] shell32: Avoid closing the caller's key. Signed-off-by: Theodore Dubois Signed-off-by: Alexandre Julliard --- dlls/shell32/assoc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index a3d21b9ae02..1ccf0e2d544 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -259,7 +259,9 @@ static HRESULT WINAPI IQueryAssociations_fnInit( } else if (hkeyProgid != NULL) { - This->hkeySource = This->hkeyProgID = hkeyProgid; + /* reopen the key so we don't end up closing a key owned by the caller */ + RegOpenKeyExW(hkeyProgid, NULL, 0, KEY_READ, &This->hkeyProgID); + This->hkeySource = This->hkeyProgID; return S_OK; } else