Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
68e57283
Commit
68e57283
authored
Dec 15, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add partial ControlPanel GetAttributesOf implementation.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52394
parent
e5c47b6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
3 deletions
+89
-3
cpanelfolder.c
dlls/shell32/cpanelfolder.c
+36
-3
shlfolder.c
dlls/shell32/tests/shlfolder.c
+53
-0
No files found.
dlls/shell32/cpanelfolder.c
View file @
68e57283
...
...
@@ -536,6 +536,34 @@ static HRESULT WINAPI ISF_ControlPanel_fnCreateViewObject(IShellFolder2 *iface,
return
hr
;
}
static
BOOL
validate_name_space
(
const
ITEMIDLIST
*
pidl
)
{
HKEY
hkey
,
hitem
;
WCHAR
*
guidW
;
GUID
*
guid
;
LSTATUS
r
;
if
(
!
_ILIsPidlSimple
(
pidl
))
return
FALSE
;
guid
=
_ILGetGUIDPointer
(
pidl
);
if
(
!
guid
)
return
FALSE
;
if
(
StringFromCLSID
(
guid
,
&
guidW
)
!=
S_OK
)
return
FALSE
;
r
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
name_spaceW
,
&
hkey
);
if
(
r
==
ERROR_SUCCESS
)
{
r
=
RegOpenKeyW
(
hkey
,
guidW
,
&
hitem
);
if
(
r
==
ERROR_SUCCESS
)
RegCloseKey
(
hitem
);
RegCloseKey
(
hkey
);
}
CoTaskMemFree
(
guidW
);
return
r
==
ERROR_SUCCESS
;
}
/**************************************************************************
* ISF_ControlPanel_fnGetAttributesOf
*/
...
...
@@ -559,12 +587,17 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 *iface, U
while
(
cidl
>
0
&&
*
apidl
)
{
pdump
(
*
apidl
);
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
/* TODO: panel with GUID can contain sub-items but we don't support it yet */
if
(
!
(
*
rgfInOut
&
SFGAO_VALIDATE
)
||
_ILGetCPanelPointer
(
*
apidl
)
||
validate_name_space
(
*
apidl
))
*
rgfInOut
&=
SFGAO_CANLINK
;
else
*
rgfInOut
&=
SFGAO_VALIDATE
;
apidl
++
;
cidl
--
;
}
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*
rgfInOut
&=
~
SFGAO_VALIDATE
;
TRACE
(
"-- result=0x%08lx
\n
"
,
*
rgfInOut
);
return
hr
;
...
...
dlls/shell32/tests/shlfolder.c
View file @
68e57283
...
...
@@ -956,6 +956,8 @@ static void test_GetAttributesOf(void)
static
WCHAR
cTestDirW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'd'
,
'i'
,
'r'
,
0
};
IShellFolder
*
IDesktopFolder
,
*
testIShellFolder
;
ITEMIDLIST
*
newPIDL
;
IEnumIDList
*
list
;
ULONG
fetch
;
int
len
;
hr
=
SHGetDesktopFolder
(
&
psfDesktop
);
...
...
@@ -1070,6 +1072,57 @@ static void test_GetAttributesOf(void)
Cleanup
();
/* test Control Panel elements */
hr
=
IShellFolder_ParseDisplayName
(
IDesktopFolder
,
NULL
,
NULL
,
(
WCHAR
*
)
L"::{21EC2020-3AEA-1069-A2DD-08002B30309D}"
,
NULL
,
&
newPIDL
,
0
);
ok
(
hr
==
S_OK
,
"ParseDisplayName failed %08lx
\n
"
,
hr
);
hr
=
IShellFolder_BindToObject
(
IDesktopFolder
,
newPIDL
,
NULL
,
&
IID_IShellFolder
,
(
void
**
)
&
testIShellFolder
);
ok
(
hr
==
S_OK
,
"BindToObject failed %08lx
\n
"
,
hr
);
ILFree
(
newPIDL
);
hr
=
IShellFolder_EnumObjects
(
testIShellFolder
,
NULL
,
SHCONTF_NONFOLDERS
,
&
list
);
ok
(
hr
==
S_OK
,
"EnumObjects failed %08lx
\n
"
,
hr
);
while
(
IEnumIDList_Next
(
list
,
1
,
&
newPIDL
,
&
fetch
)
==
S_OK
)
{
WCHAR
name
[
256
];
STRRET
strret
;
hr
=
IShellFolder_GetDisplayNameOf
(
testIShellFolder
,
newPIDL
,
SHGDN_FORPARSING
,
&
strret
);
ok
(
hr
==
S_OK
,
"GetDisplayNameOf failed %08lx
\n
"
,
hr
);
StrRetToBufW
(
&
strret
,
newPIDL
,
name
,
ARRAY_SIZE
(
name
));
dwFlags
=
~
0
;
hr
=
IShellFolder_GetAttributesOf
(
testIShellFolder
,
1
,
(
LPCITEMIDLIST
*
)
&
newPIDL
,
&
dwFlags
);
ok
(
hr
==
S_OK
,
"ControlPanel->GetAttributesOf failed %08lx
\n
"
,
hr
);
ok
(
dwFlags
==
SFGAO_CANLINK
||
broken
(
!
wcsncmp
(
L"::{26EE0668-A00A-44D7-9371-BEB064C98683}
\\
"
,
name
,
41
)
&&
dwFlags
==
SFGAO_VALIDATE
),
"%s dwFlags = %08lx
\n
"
,
debugstr_w
(
name
),
dwFlags
);
ILFree
(
newPIDL
);
}
IEnumIDList_Release
(
list
);
hr
=
IShellFolder_ParseDisplayName
(
IDesktopFolder
,
NULL
,
NULL
,
(
WCHAR
*
)
L"c:
\\
"
,
NULL
,
&
newPIDL
,
0
);
ok
(
hr
==
S_OK
,
"ParseDisplayName failed %08lx
\n
"
,
hr
);
dwFlags
=
~
0
;
hr
=
IShellFolder_GetAttributesOf
(
testIShellFolder
,
1
,
(
LPCITEMIDLIST
*
)
&
newPIDL
,
&
dwFlags
);
ok
(
hr
==
S_OK
,
"ControlPanel->GetAttributesOf failed %08lx
\n
"
,
hr
);
ok
(
dwFlags
==
SFGAO_VALIDATE
,
"dwFlags = %08lx
\n
"
,
dwFlags
);
dwFlags
=
~
0
&
~
SFGAO_VALIDATE
;
hr
=
IShellFolder_GetAttributesOf
(
testIShellFolder
,
1
,
(
LPCITEMIDLIST
*
)
&
newPIDL
,
&
dwFlags
);
ok
(
hr
==
S_OK
,
"ControlPanel->GetAttributesOf failed %08lx
\n
"
,
hr
);
ok
(
dwFlags
==
SFGAO_CANLINK
,
"dwFlags = %08lx
\n
"
,
dwFlags
);
ILFree
(
newPIDL
);
IShellFolder_Release
(
testIShellFolder
);
IShellFolder_Release
(
IDesktopFolder
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment