Replace drive letter by a root path

svn path=/trunk/; revision=30001
This commit is contained in:
Hervé Poussineau
2007-10-31 09:10:20 +00:00
parent e7e959fb0d
commit e6a393c3ad
3 changed files with 31 additions and 8 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ static HRESULT WINAPI RecycleBin_EnumObjects(IShellFolder2 *iface, HWND hwnd, SH
{
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);
+26 -3
View File
@@ -141,16 +141,39 @@ cleanup:
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)
{
+4 -4
View File
@@ -54,10 +54,10 @@ DeleteFileToRecycleBinW(
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 @@ EmptyRecycleBinW(
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