Commit d935fa69 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Implement FolderItem attributes properties.

parent 0d87da46
......@@ -83,6 +83,7 @@ typedef struct {
LONG ref;
FolderImpl *folder;
WCHAR *path; /* if NULL, folder path is used */
DWORD attributes;
} FolderItemImpl;
typedef struct {
......@@ -788,36 +789,48 @@ static HRESULT WINAPI FolderItemImpl_get_GetFolder(FolderItem2 *iface,
return E_NOTIMPL;
}
static HRESULT WINAPI FolderItemImpl_get_IsLink(FolderItem2 *iface,
VARIANT_BOOL *pb)
static HRESULT WINAPI FolderItemImpl_get_IsLink(FolderItem2 *iface, VARIANT_BOOL *b)
{
FIXME("(%p,%p)\n", iface, pb);
FolderItemImpl *This = impl_from_FolderItem(iface);
return E_NOTIMPL;
TRACE("(%p,%p)\n", iface, b);
*b = This->attributes & SFGAO_LINK ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
static HRESULT WINAPI FolderItemImpl_get_IsFolder(FolderItem2 *iface,
VARIANT_BOOL *pb)
static HRESULT WINAPI FolderItemImpl_get_IsFolder(FolderItem2 *iface, VARIANT_BOOL *b)
{
FIXME("(%p,%p)\n", iface, pb);
FolderItemImpl *This = impl_from_FolderItem(iface);
return E_NOTIMPL;
TRACE("(%p,%p)\n", iface, b);
*b = This->attributes & SFGAO_FOLDER ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
static HRESULT WINAPI FolderItemImpl_get_IsFileSystem(FolderItem2 *iface,
VARIANT_BOOL *pb)
static HRESULT WINAPI FolderItemImpl_get_IsFileSystem(FolderItem2 *iface, VARIANT_BOOL *b)
{
FIXME("(%p,%p)\n", iface, pb);
FolderItemImpl *This = impl_from_FolderItem(iface);
return E_NOTIMPL;
TRACE("(%p,%p)\n", iface, b);
*b = This->attributes & SFGAO_FILESYSTEM ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
static HRESULT WINAPI FolderItemImpl_get_IsBrowsable(FolderItem2 *iface,
VARIANT_BOOL *pb)
static HRESULT WINAPI FolderItemImpl_get_IsBrowsable(FolderItem2 *iface, VARIANT_BOOL *b)
{
FIXME("(%p,%p)\n", iface, pb);
FolderItemImpl *This = impl_from_FolderItem(iface);
return E_NOTIMPL;
TRACE("(%p,%p)\n", iface, b);
*b = This->attributes & SFGAO_BROWSABLE ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
static HRESULT WINAPI FolderItemImpl_get_ModifyDate(FolderItem2 *iface,
......@@ -924,6 +937,7 @@ static const FolderItem2Vtbl FolderItemImpl_Vtbl = {
static HRESULT FolderItem_Constructor(FolderImpl *folder, const WCHAR *path, FolderItem **item)
{
PIDLIST_ABSOLUTE pidl;
FolderItemImpl *This;
TRACE("%s\n", debugstr_w(path));
......@@ -942,6 +956,9 @@ static HRESULT FolderItem_Constructor(FolderImpl *folder, const WCHAR *path, Fol
This->folder = folder;
Folder3_AddRef(&folder->Folder3_iface);
if (SHParseDisplayName(This->path, NULL, &pidl, ~0u, &This->attributes) == S_OK)
ILFree(pidl);
*item = (FolderItem *)&This->FolderItem2_iface;
return S_OK;
}
......
......@@ -594,6 +594,8 @@ static void test_items(void)
/* test the folder item corresponding to each file */
for (i = 0; i < sizeof(file_defs)/sizeof(file_defs[0]); i++)
{
VARIANT_BOOL b;
V_I4(&int_index) = i;
variant_set_string(&str_index, file_defs[i].name);
......@@ -629,6 +631,11 @@ static void test_items(void)
"file_defs[%d]: expected %s, got %s\n", i, wine_dbgstr_w(path), wine_dbgstr_w(bstr));
SysFreeString(bstr);
b = 0xdead;
r = FolderItem_get_IsFolder(item, &b);
ok(r == S_OK, "Failed to get IsFolder property, %#x.\n", r);
ok(file_defs[i].type == DIRECTORY ? b == VARIANT_TRUE : b == VARIANT_FALSE, "Unexpected prop value %#x.\n", b);
FolderItem_Release(item);
if (file_defs[i].type == DIRECTORY)
......
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