mirror of
https://github.com/reactos/reactos.git
synced 2024-06-21 13:31:38 +00:00
[SHELL32] Fix for BuildPathsList, this solves some problems showing while copying folders. Patch by 'Gleb'. CORE-8434
svn path=/trunk/; revision=74380
This commit is contained in:
parent
5db681f766
commit
fd91fe3337
|
@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
|||
* 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 @@ BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls)
|
|||
|
||||
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 @@ HRESULT WINAPI CFSDropTarget::CopyItems(IShellFolder * pSFFrom, UINT cidl,
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -1162,7 +1162,7 @@ HRESULT WINAPI DoDeleteDataObject(IDataObject *pda, DWORD fMask)
|
|||
*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);
|
||||
|
|
Loading…
Reference in a new issue