Author: hpoussin
Date: Wed Oct 31 12:10:20 2007
New Revision: 30001
URL:
http://svn.reactos.org/svn/reactos?rev=30001&view=rev
Log:
Replace drive letter by a root path
Modified:
trunk/reactos/dll/win32/shell32/recyclebin.c
trunk/reactos/lib/recyclebin/recyclebin.c
trunk/reactos/lib/recyclebin/recyclebin.h
Modified: trunk/reactos/dll/win32/shell32/recyclebin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/recycleb…
==============================================================================
--- trunk/reactos/dll/win32/shell32/recyclebin.c (original)
+++ trunk/reactos/dll/win32/shell32/recyclebin.c Wed Oct 31 12:10:20 2007
@@ -273,7 +273,7 @@
{
RecycleBin *This = (RecycleBin *)iface;
IEnumIDList *list;
- static const WCHAR szDrive = L'C';
+ static LPCWSTR szDrive = L"C:\\";
TRACE("(%p, %p, %x, %p)\n", This, hwnd, (unsigned int)grfFlags,
ppenumIDList);
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 (original)
+++ trunk/reactos/lib/recyclebin/recyclebin.c Wed Oct 31 12:10:20 2007
@@ -141,16 +141,39 @@
BOOL WINAPI
EnumerateRecycleBinA(
- IN CHAR driveLetter,
+ IN LPCSTR pszRoot OPTIONAL,
IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback,
IN PVOID Context OPTIONAL)
{
- return EnumerateRecycleBinW((WCHAR)driveLetter, pFnCallback, Context);
+ int len;
+ LPWSTR szRootW = NULL;
+ BOOL ret = FALSE;
+
+ if (pszRoot)
+ {
+ len = MultiByteToWideChar(CP_ACP, 0, pszRoot, -1, NULL, 0);
+ if (len == 0)
+ goto cleanup;
+ szRootW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ if (!szRootW)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ goto cleanup;
+ }
+ if (MultiByteToWideChar(CP_ACP, 0, pszRoot, -1, szRootW, len) == 0)
+ goto cleanup;
+ }
+
+ ret = EnumerateRecycleBinW(szRootW, pFnCallback, Context);
+
+cleanup:
+ HeapFree(GetProcessHeap(), 0, szRootW);
+ return ret;
}
BOOL WINAPI
EnumerateRecycleBinW(
- IN WCHAR driveLetter,
+ IN LPCWSTR pszRoot OPTIONAL,
IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback,
IN PVOID Context OPTIONAL)
{
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 (original)
+++ trunk/reactos/lib/recyclebin/recyclebin.h Wed Oct 31 12:10:20 2007
@@ -54,10 +54,10 @@
BOOL WINAPI
EmptyRecycleBinA(
- IN LPCSTR pszRoot);
+ IN LPCSTR pszRoot OPTIONAL);
BOOL WINAPI
EmptyRecycleBinW(
- IN LPCWSTR pszRoot);
+ IN LPCWSTR pszRoot OPTIONAL);
#ifdef UNICODE
#define EmptyRecycleBin EmptyRecycleBinW
#else
@@ -66,12 +66,12 @@
BOOL WINAPI
EnumerateRecycleBinA(
- IN CHAR driveLetter,
+ IN LPCSTR pszRoot OPTIONAL,
IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback,
IN PVOID Context OPTIONAL);
BOOL WINAPI
EnumerateRecycleBinW(
- IN WCHAR driveLetter,
+ IN LPCWSTR pszRoot OPTIONAL,
IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback,
IN PVOID Context OPTIONAL);
#ifdef UNICODE