Author: hpoussin
Date: Mon Aug 11 12:31:51 2008
New Revision: 35280
URL:
http://svn.reactos.org/svn/reactos?rev=35280&view=rev
Log:
Expand recyclebin API with DeleteFileHandleToRecycleBin and GetRecycleBinDetails
Modified:
trunk/reactos/lib/recyclebin/recyclebin.c
trunk/reactos/lib/recyclebin/recyclebin.h
Modified: trunk/reactos/lib/recyclebin/recyclebin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/recyclebin/recyclebin.…
==============================================================================
--- trunk/reactos/lib/recyclebin/recyclebin.c [iso-8859-1] (original)
+++ trunk/reactos/lib/recyclebin/recyclebin.c [iso-8859-1] Mon Aug 11 12:31:51 2008
@@ -94,6 +94,26 @@
}
BOOL WINAPI
+DeleteFileHandleToRecycleBin(
+ IN HANDLE hDeletedFile)
+{
+ IRecycleBinFile *rbf = (IRecycleBinFile *)hDeletedFile;
+ HRESULT hr;
+
+ TRACE("(%p)\n", hDeletedFile);
+
+ hr = IRecycleBinFile_Delete(rbf);
+
+ if (SUCCEEDED(hr))
+ return TRUE;
+ if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
+ SetLastError(HRESULT_CODE(hr));
+ else
+ SetLastError(ERROR_GEN_FAILURE);
+ return FALSE;
+}
+
+BOOL WINAPI
EmptyRecycleBinA(
IN LPCSTR pszRoot OPTIONAL)
{
@@ -335,6 +355,18 @@
}
BOOL WINAPI
+GetRecycleBinDetails(
+ IN LPCWSTR pszVolume OPTIONAL,
+ OUT ULARGE_INTEGER *pulTotalItems,
+ OUT ULARGE_INTEGER *pulTotalSize)
+{
+ pulTotalItems->QuadPart = 0;
+ pulTotalSize->QuadPart = 0;
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+BOOL WINAPI
RestoreFile(
IN HANDLE hDeletedFile)
{
Modified: trunk/reactos/lib/recyclebin/recyclebin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/recyclebin/recyclebin.…
==============================================================================
--- trunk/reactos/lib/recyclebin/recyclebin.h [iso-8859-1] (original)
+++ trunk/reactos/lib/recyclebin/recyclebin.h [iso-8859-1] Mon Aug 11 12:31:51 2008
@@ -72,6 +72,15 @@
#define DeleteFileToRecycleBin DeleteFileToRecycleBinA
#endif
+/* Moves a file to the recycle bin.
+ * hDeletedFile: handle of the deleted file to delete
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ * Remark: The handle is obtained in the PENUMERATE_RECYCLEBIN_CALLBACK callback
+ */
+BOOL WINAPI
+DeleteFileHandleToRecycleBin(
+ IN HANDLE hDeletedFile);
+
/* Removes all elements contained in a recycle bin
* pszRoot: the name of the drive containing the recycle bin
* Returns TRUE if operation succeeded, FALSE otherwise.
@@ -137,6 +146,17 @@
#else
#define GetDeletedFileDetails GetDeletedFileDetailsA
#endif
+
+/* Get details about a whole recycle bin
+ * pszVolume:
+ * pulTotalItems:
+ * pulTotalSize
+ */
+BOOL WINAPI
+GetRecycleBinDetails(
+ IN LPCWSTR pszVolume OPTIONAL,
+ OUT ULARGE_INTEGER *pulTotalItems,
+ OUT ULARGE_INTEGER *pulTotalSize);
/* Restores a deleted file
* hDeletedFile: handle of the deleted file to restore