[PATCH 1/7] shell32: Fix copying of files when using a context menu.
From: Michael Müller <michael(a)fds-team.de> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/shell32/shlview_cmenu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index fc761e1..905dde9 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -1124,6 +1124,13 @@ static BOOL DoPaste(ContextMenu *This) apidl = _ILCopyCidaToaPidl(&pidl, lpcida); + /* + * Incase source is a file, we need to remove the last component + * to obtain a IShellFolder of the parent. + */ + if (_ILIsValue(pidl)) + ILRemoveLastID(pidl); + /* bind to the source shellfolder */ SHGetDesktopFolder(&psfDesktop); if(psfDesktop) -- 1.9.1
On Fri, May 25, 2018 at 04:49:50AM +0000, Alistair Leslie-Hughes wrote:
From: Michael Müller <michael(a)fds-team.de>
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/shell32/shlview_cmenu.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index fc761e1..905dde9 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -1124,6 +1124,13 @@ static BOOL DoPaste(ContextMenu *This)
apidl = _ILCopyCidaToaPidl(&pidl, lpcida);
+ /* + * Incase source is a file, we need to remove the last component + * to obtain a IShellFolder of the parent. + */ + if (_ILIsValue(pidl)) + ILRemoveLastID(pidl); + /* bind to the source shellfolder */ SHGetDesktopFolder(&psfDesktop); if(psfDesktop)
This looks like a hack hiding some other bug. If the root item is really allowed to be a file, we should investigate whether that file is also copied. Huw.
participants (2)
-
Alistair Leslie-Hughes -
Huw Davies