Module: wine Branch: master Commit: 7c915af47ec6b153cf29da36986b41bbf9402a32 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c915af47ec6b153cf29da3698...
Author: Theodore Dubois tblodt@icloud.com Date: Sun Jun 5 09:35:39 2016 -0700
shell32: Avoid closing the caller's key.
Signed-off-by: Theodore Dubois tblodt@icloud.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 a3d21b9..1ccf0e2 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