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