From 9175a389d86cc231e7e8158360402feb7c5b269e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 2 Apr 2016 00:22:30 +0200
Subject: shell32: Fix copying of files when using a context menu.

---
 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 099f5bc..552b809 100644
--- a/dlls/shell32/shlview_cmenu.c
+++ b/dlls/shell32/shlview_cmenu.c
@@ -739,6 +739,13 @@ static BOOL DoPaste(ContextMenu *This)
 
 	    apidl = _ILCopyCidaToaPidl(&pidl, lpcida);
 
+            /*
+             * In case 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)
-- 
2.7.1

