shell32: Also return ParentFolder ID in GetFolderDefinition.

This commit is contained in:
Andrew Eikum 2015-03-02 09:28:36 -06:00 committed by Alexandre Julliard
parent 0becff8244
commit 32a6ee3887
1 changed files with 12 additions and 0 deletions

View File

@ -3683,12 +3683,15 @@ static HRESULT WINAPI knownfolder_GetFolderDefinition(
{
struct knownfolder *knownfolder = impl_from_IKnownFolder( iface );
HRESULT hr;
DWORD dwSize;
WCHAR parentGuid[39];
TRACE("(%p, %p)\n", knownfolder, pKFD);
if(!pKFD) return E_INVALIDARG;
ZeroMemory(pKFD, sizeof(*pKFD));
/* required fields */
hr = get_known_folder_dword(knownfolder->registryPath, szCategory, &pKFD->category);
if(FAILED(hr))
return hr;
@ -3697,6 +3700,15 @@ static HRESULT WINAPI knownfolder_GetFolderDefinition(
if(FAILED(hr))
return hr;
/* optional fields */
dwSize = sizeof(parentGuid);
hr = HRESULT_FROM_WIN32(RegGetValueW(HKEY_LOCAL_MACHINE, knownfolder->registryPath, szParentFolder,
RRF_RT_REG_SZ, NULL, parentGuid, &dwSize));
if(SUCCEEDED(hr))
IIDFromString(parentGuid, &pKFD->fidParent);
get_known_folder_dword(knownfolder->registryPath, szAttributes, &pKFD->dwAttributes);
return S_OK;
}