Author: janderwald Date: Thu Sep 17 15:44:34 2009 New Revision: 43060
URL: http://svn.reactos.org/svn/reactos?rev=43060&view=rev Log: - Fix copying of files / directories in explorer view - Part 1/2
Modified: trunk/reactos/dll/win32/shell32/shv_def_cmenu.c
Modified: trunk/reactos/dll/win32/shell32/shv_def_cmenu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_def_c... ============================================================================== --- trunk/reactos/dll/win32/shell32/shv_def_cmenu.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shv_def_cmenu.c [iso-8859-1] Thu Sep 17 15:44:34 2009 @@ -1072,9 +1072,22 @@ } else { - /* target folder is desktop because cidl is zero */ - psfTarget = psfDesktop; - hr = S_OK; + IPersistFolder2 *ppf2 = NULL; + LPITEMIDLIST pidl; + + /* cidl is zero due to explorer view */ + hr = IShellFolder_QueryInterface (This->dcm.psf, &IID_IPersistFolder2, (LPVOID *) &ppf2); + if (SUCCEEDED(hr)) + { + hr = IPersistFolder2_GetCurFolder (ppf2, &pidl); + IPersistFolder2_Release(ppf2); + if (SUCCEEDED(hr)) + { + hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfTarget); + ILFree(pidl); + TRACE("psfTarget %p\n", psfTarget); + } + } }
if (FAILED(hr)) @@ -1133,6 +1146,7 @@ _ILFreeaPidl(apidl, lpcida->cidl); ReleaseStgMedium(&medium); IDataObject_Release(pda); +ERR("CP result %x\n",hr); return S_OK; }