Commit 5e90301b authored by Mariusz Pluciński's avatar Mariusz Pluciński Committed by Alexandre Julliard

shell32: Add implementation of IKnownFolder::GetCategory.

parent efc1162e
......@@ -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(
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment