shell32: Mask out attributes we didn't ask for in ShellItem::GetAttributes.

This commit is contained in:
David Hedberg 2014-07-30 20:43:21 +02:00 committed by Alexandre Julliard
parent 955b487b20
commit 678434539e
2 changed files with 4 additions and 3 deletions

View File

@ -269,6 +269,7 @@ static HRESULT WINAPI ShellItem_GetAttributes(IShellItem2 *iface, SFGAOF sfgaoMa
child_pidl = ILFindLastID(This->pidl); child_pidl = ILFindLastID(This->pidl);
*psfgaoAttribs = sfgaoMask; *psfgaoAttribs = sfgaoMask;
ret = IShellFolder_GetAttributesOf(parent_folder, 1, (LPCITEMIDLIST*)&child_pidl, psfgaoAttribs); ret = IShellFolder_GetAttributesOf(parent_folder, 1, (LPCITEMIDLIST*)&child_pidl, psfgaoAttribs);
*psfgaoAttribs &= sfgaoMask;
IShellFolder_Release(parent_folder); IShellFolder_Release(parent_folder);
} }

View File

@ -3783,17 +3783,17 @@ static void test_ShellItemGetAttributes(void)
sfgao = 0xdeadbeef; sfgao = 0xdeadbeef;
hr = IShellItem_GetAttributes(psi_folder1, 0, &sfgao); hr = IShellItem_GetAttributes(psi_folder1, 0, &sfgao);
ok(hr == S_OK, "Got 0x%08x\n", hr); 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; sfgao = 0xdeadbeef;
hr = IShellItem_GetAttributes(psi_folder1, SFGAO_FOLDER, &sfgao); hr = IShellItem_GetAttributes(psi_folder1, SFGAO_FOLDER, &sfgao);
ok(hr == S_OK, "Got 0x%08x\n", hr); 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; sfgao = 0xdeadbeef;
hr = IShellItem_GetAttributes(psi_file1, SFGAO_FOLDER, &sfgao); hr = IShellItem_GetAttributes(psi_file1, SFGAO_FOLDER, &sfgao);
todo_wine ok(hr == S_FALSE, "Got 0x%08x\n", hr); 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_folder1);
IShellItem_Release(psi_file1); IShellItem_Release(psi_file1);