Mariusz Pluciński : shell32: Add support of registry-registered folders to IKnownFolderManager:: GetFolder.
Module: wine Branch: master Commit: ed29ff8c3b6a61192081bb4d88d6488435c71a6e URL: http://source.winehq.org/git/wine.git/?a=commit;h=ed29ff8c3b6a61192081bb4d88... Author: Mariusz Pluciński <vshader(a)gmail.com> Date: Wed Jun 22 15:10:15 2011 +0200 shell32: Add support of registry-registered folders to IKnownFolderManager::GetFolder. --- dlls/shell32/shellpath.c | 16 +++++++++++++++- dlls/shell32/tests/shellpath.c | 3 --- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 0514647..ffd1aed 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -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, ®istryPath); + 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( diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 104e7d7..1b575fe 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -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);
participants (1)
-
Alexandre Julliard