Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1c86f979
Commit
1c86f979
authored
Nov 27, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Get rid of some casts by using IShellFolder2 internally.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e4987828
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
32 deletions
+25
-32
cpanelfolder.c
dlls/shell32/cpanelfolder.c
+1
-1
shfldr.h
dlls/shell32/shfldr.h
+1
-1
shfldr_desktop.c
dlls/shell32/shfldr_desktop.c
+2
-4
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+7
-9
shfldr_mycomp.c
dlls/shell32/shfldr_mycomp.c
+6
-7
shfldr_netplaces.c
dlls/shell32/shfldr_netplaces.c
+6
-7
shlfolder.c
dlls/shell32/shlfolder.c
+2
-3
No files found.
dlls/shell32/cpanelfolder.c
View file @
1c86f979
...
...
@@ -561,7 +561,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 *iface, U
while
(
cidl
>
0
&&
*
apidl
)
{
pdump
(
*
apidl
);
SHELL32_GetItemAttributes
(
(
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
apidl
++
;
cidl
--
;
}
...
...
dlls/shell32/shfldr.h
View file @
1c86f979
...
...
@@ -39,7 +39,7 @@ BOOL SHELL32_GetCustomFolderAttribute (LPCITEMIDLIST pidl, LPCWSTR pwszHeading,
LPCWSTR
GetNextElementW
(
LPCWSTR
pszNext
,
LPWSTR
pszOut
,
DWORD
dwOut
)
DECLSPEC_HIDDEN
;
HRESULT
SHELL32_ParseNextElement
(
IShellFolder2
*
psf
,
HWND
hwndOwner
,
LPBC
pbc
,
LPITEMIDLIST
*
pidlInOut
,
LPOLESTR
szNext
,
DWORD
*
pEaten
,
DWORD
*
pdwAttributes
)
DECLSPEC_HIDDEN
;
HRESULT
SHELL32_GetItemAttributes
(
IShellFolder
*
psf
,
LPCITEMIDLIST
pidl
,
LPDWORD
pdwA
ttributes
)
DECLSPEC_HIDDEN
;
HRESULT
SHELL32_GetItemAttributes
(
IShellFolder
2
*
folder
,
LPCITEMIDLIST
pidl
,
DWORD
*
a
ttributes
)
DECLSPEC_HIDDEN
;
HRESULT
SHELL32_GetDisplayNameOfChild
(
IShellFolder2
*
psf
,
LPCITEMIDLIST
pidl
,
DWORD
dwFlags
,
LPWSTR
szOut
,
DWORD
dwOutLen
)
DECLSPEC_HIDDEN
;
...
...
dlls/shell32/shfldr_desktop.c
View file @
1c86f979
...
...
@@ -155,7 +155,6 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
DWORD
*
pchEaten
,
LPITEMIDLIST
*
ppidl
,
DWORD
*
pdwAttributes
)
{
IDesktopFolderImpl
*
This
=
impl_from_IShellFolder2
(
iface
);
IShellFolder
*
shell_folder
=
(
IShellFolder
*
)
iface
;
WCHAR
szElement
[
MAX_PATH
];
LPCWSTR
szNext
=
NULL
;
LPITEMIDLIST
pidlTemp
=
NULL
;
...
...
@@ -268,7 +267,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
else
{
if
(
pdwAttributes
&&
*
pdwAttributes
)
hr
=
SHELL32_GetItemAttributes
(
shell_folder
,
pidlTemp
,
pdwAttributes
);
hr
=
SHELL32_GetItemAttributes
(
iface
,
pidlTemp
,
pdwAttributes
);
}
}
...
...
@@ -454,7 +453,6 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
UINT
cidl
,
LPCITEMIDLIST
*
apidl
,
DWORD
*
rgfInOut
)
{
IDesktopFolderImpl
*
This
=
impl_from_IShellFolder2
(
iface
);
IShellFolder
*
shell_folder
=
(
IShellFolder
*
)
iface
;
static
const
DWORD
dwDesktopAttributes
=
SFGAO_STORAGE
|
SFGAO_HASPROPSHEET
|
SFGAO_STORAGEANCESTOR
|
...
...
@@ -484,7 +482,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
}
else
if
(
_ILIsMyComputer
(
*
apidl
))
{
*
rgfInOut
&=
dwMyComputerAttributes
;
}
else
{
SHELL32_GetItemAttributes
(
shell_folder
,
*
apidl
,
rgfInOut
);
SHELL32_GetItemAttributes
(
iface
,
*
apidl
,
rgfInOut
);
}
apidl
++
;
cidl
--
;
...
...
dlls/shell32/shfldr_fs.c
View file @
1c86f979
...
...
@@ -342,10 +342,8 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
&
pidlTemp
,
(
LPOLESTR
)
szNext
,
pchEaten
,
pdwAttributes
);
}
else
{
/* it's the last element */
if
(
pdwAttributes
&&
*
pdwAttributes
)
{
hr
=
SHELL32_GetItemAttributes
((
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
pidlTemp
,
pdwAttributes
);
}
if
(
pdwAttributes
&&
*
pdwAttributes
)
hr
=
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
pidlTemp
,
pdwAttributes
);
}
}
}
...
...
@@ -511,19 +509,19 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl,
*
rgfInOut
=
~
0
;
if
(
cidl
==
0
){
IShellFolder
*
psfP
arent
=
NULL
;
IShellFolder
2
*
p
arent
=
NULL
;
LPCITEMIDLIST
rpidl
=
NULL
;
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
,
(
LPVOID
*
)
&
psfP
arent
,
&
rpidl
);
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
2
,
(
void
**
)
&
p
arent
,
&
rpidl
);
if
(
SUCCEEDED
(
hr
))
{
SHELL32_GetItemAttributes
(
psfP
arent
,
rpidl
,
rgfInOut
);
IShellFolder
_Release
(
psfP
arent
);
SHELL32_GetItemAttributes
(
p
arent
,
rpidl
,
rgfInOut
);
IShellFolder
2_Release
(
p
arent
);
}
}
else
{
while
(
cidl
>
0
&&
*
apidl
)
{
pdump
(
*
apidl
);
SHELL32_GetItemAttributes
(
(
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
apidl
++
;
cidl
--
;
}
...
...
dlls/shell32/shfldr_mycomp.c
View file @
1c86f979
...
...
@@ -232,8 +232,7 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
else
{
if
(
pdwAttributes
&&
*
pdwAttributes
)
SHELL32_GetItemAttributes
((
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
pidlTemp
,
pdwAttributes
);
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
pidlTemp
,
pdwAttributes
);
hr
=
S_OK
;
}
...
...
@@ -477,18 +476,18 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
*
rgfInOut
=
~
0
;
if
(
cidl
==
0
){
IShellFolder
*
psfP
arent
=
NULL
;
IShellFolder
2
*
p
arent
=
NULL
;
LPCITEMIDLIST
rpidl
=
NULL
;
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
,
(
LPVOID
*
)
&
psfP
arent
,
&
rpidl
);
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
2
,
(
void
**
)
&
p
arent
,
&
rpidl
);
if
(
SUCCEEDED
(
hr
))
{
SHELL32_GetItemAttributes
(
psfP
arent
,
rpidl
,
rgfInOut
);
IShellFolder
_Release
(
psfP
arent
);
SHELL32_GetItemAttributes
(
p
arent
,
rpidl
,
rgfInOut
);
IShellFolder
2_Release
(
p
arent
);
}
}
else
{
while
(
cidl
>
0
&&
*
apidl
)
{
pdump
(
*
apidl
);
SHELL32_GetItemAttributes
((
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
apidl
++
;
cidl
--
;
}
...
...
dlls/shell32/shfldr_netplaces.c
View file @
1c86f979
...
...
@@ -220,8 +220,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac
else
{
if
(
pdwAttributes
&&
*
pdwAttributes
)
hr
=
SHELL32_GetItemAttributes
((
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
pidlTemp
,
pdwAttributes
);
hr
=
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
pidlTemp
,
pdwAttributes
);
}
}
...
...
@@ -364,14 +363,14 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface
if
(
cidl
==
0
)
{
IShellFolder
*
psfP
arent
=
NULL
;
IShellFolder
2
*
p
arent
=
NULL
;
LPCITEMIDLIST
rpidl
=
NULL
;
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
,
(
void
**
)
&
psfP
arent
,
&
rpidl
);
hr
=
SHBindToParent
(
This
->
pidlRoot
,
&
IID_IShellFolder
2
,
(
void
**
)
&
p
arent
,
&
rpidl
);
if
(
SUCCEEDED
(
hr
))
{
SHELL32_GetItemAttributes
(
psfP
arent
,
rpidl
,
rgfInOut
);
IShellFolder
_Release
(
psfP
arent
);
SHELL32_GetItemAttributes
(
p
arent
,
rpidl
,
rgfInOut
);
IShellFolder
2_Release
(
p
arent
);
}
}
else
...
...
@@ -379,7 +378,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface
while
(
cidl
>
0
&&
*
apidl
)
{
pdump
(
*
apidl
);
SHELL32_GetItemAttributes
((
IShellFolder
*
)
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
SHELL32_GetItemAttributes
(
&
This
->
IShellFolder2_iface
,
*
apidl
,
rgfInOut
);
apidl
++
;
cidl
--
;
}
...
...
dlls/shell32/shlfolder.c
View file @
1c86f979
...
...
@@ -389,7 +389,7 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
* According to the MSDN documentation this function should not set flags. It claims only to reset flags when necessary.
* However it turns out the native shell32.dll _sets_ flags in several cases - so do we.
*/
HRESULT
SHELL32_GetItemAttributes
(
IShellFolder
*
psf
,
LPCITEMIDLIST
pidl
,
LPDWORD
pdwAttributes
)
HRESULT
SHELL32_GetItemAttributes
(
IShellFolder
2
*
psf
,
LPCITEMIDLIST
pidl
,
LPDWORD
pdwAttributes
)
{
DWORD
dwAttributes
;
BOOL
has_guid
;
...
...
@@ -435,8 +435,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
/* File attributes are not present in the internal PIDL structure, so get them from the file system. */
HRESULT
hr
=
IShellFolder_GetDisplayNameOf
(
psf
,
pidl
,
SHGDN_FORPARSING
,
&
strret
);
HRESULT
hr
=
IShellFolder2_GetDisplayNameOf
(
psf
,
pidl
,
SHGDN_FORPARSING
,
&
strret
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
StrRetToBufW
(
&
strret
,
pidl
,
path
,
MAX_PATH
);
...
...
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