mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
shell32: Add support of registry-registered folders to IKnownFolderManager::GetFolder.
This commit is contained in:
parent
c5bf1977f2
commit
ed29ff8c3b
2 changed files with 15 additions and 4 deletions
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue