shell32: Add support of registry-registered folders to IKnownFolderManager::GetFolder.

This commit is contained in:
Mariusz Pluciński 2011-06-22 15:10:15 +02:00 committed by Alexandre Julliard
parent c5bf1977f2
commit ed29ff8c3b
2 changed files with 15 additions and 4 deletions

View file

@ -3400,11 +3400,25 @@ static HRESULT WINAPI foldermanager_GetFolderIds(
static BOOL is_knownfolder( struct foldermanager *fm, const KNOWNFOLDERID *id )
{
UINT i;
HRESULT hr;
LPWSTR registryPath = NULL;
HKEY hKey;
/* TODO: move all entries from "CSIDL_Data" static array to registry known folder descriptions */
for (i = 0; i < fm->num_ids; i++)
if (IsEqualGUID( &fm->ids[i], id )) return TRUE;
return FALSE;
hr = get_known_folder_registry_path(id, &registryPath);
if(SUCCEEDED(hr))
hr = HRESULT_FROM_WIN32(RegOpenKeyExW(HKEY_LOCAL_MACHINE, registryPath, 0, 0, &hKey));
if(SUCCEEDED(hr))
{
hr = S_OK;
RegCloseKey(hKey);
}
return hr == S_OK;
}
static HRESULT WINAPI foldermanager_GetFolder(

View file

@ -1172,14 +1172,11 @@ static void test_knownFolders(void)
if(SUCCEEDED(hr))
{
hr = IKnownFolderManager_GetFolder(mgr, &newFolderId, &folder);
todo_wine
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
hr = IKnownFolder_GetId(folder, &folderId);
todo_wine
ok(hr == S_OK, "failed to get folder id: 0x%08x\n", hr);
todo_wine
ok(IsEqualGUID(&folderId, &newFolderId)==TRUE, "invalid KNOWNFOLDERID returned\n");
hr = IKnownFolder_GetPath(folder, 0, &folderPath);