Mariusz Pluciński : shell32: Add implementation of IKnownFolder::GetCategory.
Alexandre Julliard
julliard at winehq.org
Fri Jun 24 13:54:02 CDT 2011
Module: wine
Branch: master
Commit: 5e90301bc21d1d36a9b7f19724abde4a166cac4c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5e90301bc21d1d36a9b7f19724abde4a166cac4c
Author: Mariusz Pluciński <vshader at gmail.com>
Date: Thu Jun 23 18:49:55 2011 +0200
shell32: Add implementation of IKnownFolder::GetCategory.
---
dlls/shell32/shellpath.c | 16 ++++++++++++++--
dlls/shell32/tests/shellpath.c | 2 --
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c
index 6779e61..bd77031 100644
--- a/dlls/shell32/shellpath.c
+++ b/dlls/shell32/shellpath.c
@@ -3222,8 +3222,20 @@ static HRESULT WINAPI knownfolder_GetCategory(
IKnownFolder *iface,
KF_CATEGORY *pCategory)
{
- FIXME("%p\n", pCategory);
- return E_NOTIMPL;
+ struct knownfolder *knownfolder = impl_from_IKnownFolder(iface);
+ HRESULT hr = S_OK;
+ DWORD dwSize, dwType;
+
+ TRACE("%p, %p\n", knownfolder, pCategory);
+
+ /* we can not get category for folder which is not registered */
+ if(!knownfolder->registryPath)
+ hr = E_FAIL;
+
+ if(SUCCEEDED(hr))
+ hr = HRESULT_FROM_WIN32(RegGetValueW(HKEY_LOCAL_MACHINE, knownfolder->registryPath, szCategory, RRF_RT_DWORD, &dwType, pCategory, &dwSize));
+
+ return hr;
}
static HRESULT WINAPI knownfolder_GetShellItem(
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c
index 2240630..b58b5c2 100644
--- a/dlls/shell32/tests/shellpath.c
+++ b/dlls/shell32/tests/shellpath.c
@@ -1176,9 +1176,7 @@ static void test_knownFolders(void)
if(SUCCEEDED(hr))
{
hr = IKnownFolder_GetCategory(folder, &cat);
- todo_wine
ok(hr == S_OK, "failed to get folder category: hr=0x%0x\n", hr);
- todo_wine
ok(cat == KF_CATEGORY_PERUSER, "invalid category returned: %d, while %d (KF_CATEGORY_PERUSER) expected\n", cat, KF_CATEGORY_PERUSER);
hr = IKnownFolder_GetId(folder, &folderId);
More information about the wine-cvs
mailing list