Module: wine Branch: master Commit: 8ae6b43bc89b80ef6e5019dccefd451bc5ff903c URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ae6b43bc89b80ef6e5019dcce...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Sep 10 08:58:53 2013 +0400
shell32: Fix getting a command string when root key default value doesn't point to a key.
---
dlls/shell32/assoc.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index d28fa20..b0d815a 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -263,17 +263,19 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra
ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, KEY_READ, &hkeyFile); HeapFree(GetProcessHeap(), 0, filetype); - if (ret) return HRESULT_FROM_WIN32(ret);
- ret = RegOpenKeyExW(hkeyFile, shellW, 0, KEY_READ, &hkeyShell); - RegCloseKey(hkeyFile); - if (ret) return HRESULT_FROM_WIN32(ret); + if (ret == ERROR_SUCCESS) + { + ret = RegOpenKeyExW(hkeyFile, shellW, 0, KEY_READ, &hkeyShell); + RegCloseKey(hkeyFile); + } + else + ret = RegOpenKeyExW(This->hkeySource, shellW, 0, KEY_READ, &hkeyShell); } else - { ret = RegOpenKeyExW(This->hkeySource, shellW, 0, KEY_READ, &hkeyShell); - if (ret) return HRESULT_FROM_WIN32(ret); - } + + if (ret) return HRESULT_FROM_WIN32(ret);
if (!extra) {