From 678434539ef7fd0009127ca5069bdef764c49d1a Mon Sep 17 00:00:00 2001 From: David Hedberg Date: Wed, 30 Jul 2014 20:43:21 +0200 Subject: [PATCH] shell32: Mask out attributes we didn't ask for in ShellItem::GetAttributes. --- dlls/shell32/shellitem.c | 1 + dlls/shell32/tests/shlfolder.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index f58c5663df0..21bf8a5d0cf 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -269,6 +269,7 @@ static HRESULT WINAPI ShellItem_GetAttributes(IShellItem2 *iface, SFGAOF sfgaoMa child_pidl = ILFindLastID(This->pidl); *psfgaoAttribs = sfgaoMask; ret = IShellFolder_GetAttributesOf(parent_folder, 1, (LPCITEMIDLIST*)&child_pidl, psfgaoAttribs); + *psfgaoAttribs &= sfgaoMask; IShellFolder_Release(parent_folder); } diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index d3b965b7d2c..fa7219ca7e9 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -3783,17 +3783,17 @@ static void test_ShellItemGetAttributes(void) sfgao = 0xdeadbeef; hr = IShellItem_GetAttributes(psi_folder1, 0, &sfgao); ok(hr == S_OK, "Got 0x%08x\n", hr); - todo_wine ok(sfgao == 0, "Got 0x%08x\n", sfgao); + ok(sfgao == 0, "Got 0x%08x\n", sfgao); sfgao = 0xdeadbeef; hr = IShellItem_GetAttributes(psi_folder1, SFGAO_FOLDER, &sfgao); ok(hr == S_OK, "Got 0x%08x\n", hr); - todo_wine ok(sfgao == SFGAO_FOLDER, "Got 0x%08x\n", sfgao); + ok(sfgao == SFGAO_FOLDER, "Got 0x%08x\n", sfgao); sfgao = 0xdeadbeef; hr = IShellItem_GetAttributes(psi_file1, SFGAO_FOLDER, &sfgao); todo_wine ok(hr == S_FALSE, "Got 0x%08x\n", hr); - todo_wine ok(sfgao == 0, "Got 0x%08x\n", sfgao); + ok(sfgao == 0, "Got 0x%08x\n", sfgao); IShellItem_Release(psi_folder1); IShellItem_Release(psi_file1);