Author: mjansen
Date: Wed Apr 19 18:45:33 2017
New Revision: 74380
URL:
http://svn.reactos.org/svn/reactos?rev=74380&view=rev
Log:
[SHELL32] Fix for BuildPathsList, this solves some problems showing while copying folders.
Patch by 'Gleb'. CORE-8434
Modified:
trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp
trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.h
trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
Modified: trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/droptarg…
==============================================================================
--- trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp [iso-8859-1] Wed Apr 19
18:45:33 2017
@@ -31,7 +31,7 @@
* PIDLs relative to the given base folder
*/
WCHAR *
-BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls)
+BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls, BOOL bRelative)
{
WCHAR *pwszPathsList;
WCHAR *pwszListPos;
@@ -48,6 +48,10 @@
wcscpy(pwszListPos, wszBasePath);
pwszListPos += iPathLen;
+
+ if (_ILIsFolder(pidls[i]) && bRelative)
+ continue;
+
/* FIXME: abort if path too long */
_ILSimpleGetTextW(pidls[i], pwszListPos, MAX_PATH - iPathLen);
pwszListPos += wcslen(pwszListPos) + 1;
@@ -95,8 +99,8 @@
wcscpy(szTargetPath, sPathTarget);
pszTarget = PathAddBackslashW(szTargetPath);
- pszSrcList = BuildPathsList(szSrcPath, cidl, apidl);
- pszTargetList = BuildPathsList(szTargetPath, cidl, apidl);
+ pszSrcList = BuildPathsList(szSrcPath, cidl, apidl, FALSE);
+ pszTargetList = BuildPathsList(szTargetPath, cidl, apidl, TRUE);
if (!pszSrcList || !pszTargetList)
{
Modified: trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/droptarg…
==============================================================================
--- trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.h [iso-8859-1] Wed Apr 19
18:45:33 2017
@@ -23,7 +23,7 @@
#ifndef _CFSDROPTARGET_H_
#define _CFSDROPTARGET_H_
-WCHAR *BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls);
+WCHAR *BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls, BOOL
bRelative);
class CFSDropTarget :
public CComObjectRootEx<CComMultiThreadModelNoCS>,
Modified: trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] Wed Apr 19
18:45:33 2017
@@ -1162,7 +1162,7 @@
*pwszFilename = L'\0';
/* Build paths list */
- LPWSTR pwszPaths = BuildPathsList(wszPath, lpcida->cidl, (LPCITEMIDLIST*) apidl);
+ LPWSTR pwszPaths = BuildPathsList(wszPath, lpcida->cidl, (LPCITEMIDLIST*) apidl,
FALSE);
if (!pwszPaths)
{
SHFree(pidl);