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
a6a946b2
Commit
a6a946b2
authored
Nov 08, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Nov 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Remove reliance on the ability to bind to files in UnixFolder GetDisplayNameOf.
parent
193a80a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
5 deletions
+57
-5
shfldr_unixfs.c
dlls/shell32/shfldr_unixfs.c
+57
-5
No files found.
dlls/shell32/shfldr_unixfs.c
View file @
a6a946b2
...
...
@@ -1161,6 +1161,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i
LPCITEMIDLIST
pidl
,
SHGDNF
uFlags
,
STRRET
*
lpName
)
{
UnixFolder
*
This
=
ADJUST_THIS
(
UnixFolder
,
IShellFolder2
,
iface
);
SHITEMID
emptyIDL
=
{
0
,
{
0
}
};
HRESULT
hr
=
S_OK
;
TRACE
(
"(iface=%p, pidl=%p, uFlags=%x, lpName=%p)
\n
"
,
iface
,
pidl
,
uFlags
,
lpName
);
...
...
@@ -1184,15 +1185,66 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i
PathRemoveBackslashW
(
lpName
->
u
.
pOleStr
);
HeapFree
(
GetProcessHeap
(),
0
,
pwszDosFileName
);
}
}
else
if
(
_ILIsValue
(
pidl
))
{
STRRET
str
;
PWSTR
path
,
file
;
/* We are looking for the complete path to a file */
/* Get the complete path for the current folder object */
hr
=
IShellFolder_GetDisplayNameOf
(
iface
,
(
LPITEMIDLIST
)
&
emptyIDL
,
uFlags
,
&
str
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
StrRetToStrW
(
&
str
,
NULL
,
&
path
);
if
(
SUCCEEDED
(
hr
))
{
/* Get the child filename */
hr
=
IShellFolder_GetDisplayNameOf
(
iface
,
pidl
,
SHGDN_FORPARSING
|
SHGDN_INFOLDER
,
&
str
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
StrRetToStrW
(
&
str
,
NULL
,
&
file
);
if
(
SUCCEEDED
(
hr
))
{
static
const
WCHAR
slashW
=
'/'
;
UINT
len_path
=
strlenW
(
path
),
len_file
=
strlenW
(
file
);
/* Now, combine them */
lpName
->
uType
=
STRRET_WSTR
;
lpName
->
u
.
pOleStr
=
SHAlloc
(
(
len_path
+
len_file
+
2
)
*
sizeof
(
WCHAR
)
);
lstrcpyW
(
lpName
->
u
.
pOleStr
,
path
);
if
(
This
->
m_dwPathMode
==
PATHMODE_UNIX
&&
lpName
->
u
.
pOleStr
[
len_path
-
1
]
!=
slashW
)
{
lpName
->
u
.
pOleStr
[
len_path
]
=
slashW
;
lpName
->
u
.
pOleStr
[
len_path
+
1
]
=
'\0'
;
}
else
PathAddBackslashW
(
lpName
->
u
.
pOleStr
);
lstrcatW
(
lpName
->
u
.
pOleStr
,
file
);
CoTaskMemFree
(
file
);
}
else
WARN
(
"Failed to convert strret (file)
\n
"
);
}
CoTaskMemFree
(
path
);
}
else
WARN
(
"Failed to convert strret (path)
\n
"
);
}
}
else
{
IShellFolder
*
pSubFolder
;
SHITEMID
emptyIDL
=
{
0
,
{
0
}
};
hr
=
IShellFolder_BindToObject
(
iface
,
pidl
,
NULL
,
&
IID_IShellFolder
,
(
void
**
)
&
pSubFolder
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IShellFolder_GetDisplayNameOf
(
pSubFolder
,
(
LPITEMIDLIST
)
&
emptyIDL
,
uFlags
,
lpName
);
IShellFolder_Release
(
pSubFolder
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IShellFolder_GetDisplayNameOf
(
pSubFolder
,
(
LPITEMIDLIST
)
&
emptyIDL
,
uFlags
,
lpName
);
IShellFolder_Release
(
pSubFolder
);
}
else
if
(
FAILED
(
hr
)
&&
!
_ILIsPidlSimple
(
pidl
))
{
LPITEMIDLIST
pidl_parent
=
ILClone
(
pidl
);
LPITEMIDLIST
pidl_child
=
ILFindLastID
(
pidl
);
/* Might be a file, try binding to its parent */
ILRemoveLastID
(
pidl_parent
);
hr
=
IShellFolder_BindToObject
(
iface
,
pidl_parent
,
NULL
,
&
IID_IShellFolder
,
(
void
**
)
&
pSubFolder
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IShellFolder_GetDisplayNameOf
(
pSubFolder
,
pidl_child
,
uFlags
,
lpName
);
IShellFolder_Release
(
pSubFolder
);
}
ILFree
(
pidl_parent
);
}
}
}
else
{
WCHAR
wszFileName
[
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