shell32: Fix getting a command string when root key default value doesn't point to a key.

This commit is contained in:
Nikolay Sivov 2013-09-10 08:58:53 +04:00 committed by Alexandre Julliard
parent 6b4f43e8e6
commit 8ae6b43bc8
1 changed files with 9 additions and 7 deletions

View File

@ -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)
{