Author: janderwald
Date: Tue Aug 19 08:14:25 2008
New Revision: 35451
URL:
http://svn.reactos.org/svn/reactos?rev=35451&view=rev
Log:
* Restore file with SHFileOperation
Modified:
trunk/reactos/lib/recyclebin/recyclebin_v5.c
Modified: trunk/reactos/lib/recyclebin/recyclebin_v5.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/recyclebin/recyclebin_…
==============================================================================
--- trunk/reactos/lib/recyclebin/recyclebin_v5.c [iso-8859-1] (original)
+++ trunk/reactos/lib/recyclebin/recyclebin_v5.c [iso-8859-1] Tue Aug 19 08:14:25 2008
@@ -472,6 +472,7 @@
PINFO2_HEADER pHeader;
DELETED_FILE_RECORD *pRecord, *pLast;
DWORD dwEntries, i;
+ SHFILEOPSTRUCTW op;
TRACE("(%p, %s, %p)\n", This, debugstr_w(pDeletedFileName), pDeletedFile);
@@ -496,7 +497,12 @@
if (pRecord->dwRecordUniqueId == pDeletedFile->dwRecordUniqueId)
{
/* Restore file */
- if (!MoveFileW(pDeletedFileName, pDeletedFile->FileNameW))
+ ZeroMemory(&op, sizeof(op));
+ op.wFunc = FO_COPY;
+ op.pFrom = pDeletedFileName;
+ op.pTo = pDeletedFile->FileNameW;
+
+ if (!SHFileOperationW(&op))
{
UnmapViewOfFile(pHeader);
return HRESULT_FROM_WIN32(GetLastError());