Author: hpoussin
Date: Wed Oct 31 11:57:48 2007
New Revision: 29999
URL:
http://svn.reactos.org/svn/reactos?rev=29999&view=rev
Log:
Implement SHEmptyRecycleBinA/W
Implement SHQueryRecycleBinA
Modified:
trunk/reactos/dll/win32/shell32/she_ocmenu.c
trunk/reactos/dll/win32/shell32/shellord.c
Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocme…
==============================================================================
--- trunk/reactos/dll/win32/shell32/she_ocmenu.c (original)
+++ trunk/reactos/dll/win32/shell32/she_ocmenu.c Wed Oct 31 11:57:48 2007
@@ -38,6 +38,8 @@
#include "shellfolder.h"
#include "shresdef.h"
+WINE_DEFAULT_DEBUG_CHANNEL (shell);
+
const GUID CLSID_OpenWith = { 0x09799AFB, 0xAD67, 0x11d1,
{0xAB,0xCD,0x00,0xC0,0x4F,0xC3,0x09,0x36} };
typedef struct
Modified: trunk/reactos/dll/win32/shell32/shellord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellord…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellord.c (original)
+++ trunk/reactos/dll/win32/shell32/shellord.c Wed Oct 31 11:57:48 2007
@@ -45,6 +45,7 @@
#include "pidl.h"
#include "shlwapi.h"
#include "commdlg.h"
+#include "recyclebin.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
WINE_DECLARE_DEBUG_CHANNEL(pidl);
@@ -1971,18 +1972,48 @@
HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
{
- FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRootPath), dwFlags);
-
+ LPWSTR szRootPathW = NULL;
+ int len;
+ HRESULT hr;
+
+ TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_a(pszRootPath), dwFlags);
+
+ if (pszRootPath)
+ {
+ len = MultiByteToWideChar(CP_ACP, 0, pszRootPath, -1, NULL, 0);
+ if (len == 0)
+ return HRESULT_FROM_WIN32(GetLastError());
+ szRootPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ if (!szRootPathW)
+ return E_OUTOFMEMORY;
+ if (MultiByteToWideChar(CP_ACP, 0, pszRootPath, -1, szRootPathW, len) == 0)
+ {
+ HeapFree(GetProcessHeap(), 0, szRootPathW);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+ }
+
+ hr = SHEmptyRecycleBinW(hwnd, szRootPathW, dwFlags);
+ HeapFree(GetProcessHeap(), 0, szRootPathW);
+
+ return hr;
+}
+
+HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
+{
+ BOOL ret;
+
+ TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags);
+ FIXME("0x%08x flags ignored\n", dwFlags);
+
+ ret = EmptyRecycleBinW(pszRootPath);
+ if (!ret)
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ /* FIXME: update icon? */
return S_OK;
}
-HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
-{
- FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_w(pszRootPath), dwFlags);
-
- return S_OK;
-}
-
DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
{
FIXME("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
@@ -1992,7 +2023,36 @@
HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
{
- FIXME("%s, %p - stub\n", debugstr_a(pszRootPath), pSHQueryRBInfo);
+ LPWSTR szRootPathW = NULL;
+ int len;
+ HRESULT hr;
+
+ TRACE("%s, %p\n", debugstr_a(pszRootPath), pSHQueryRBInfo);
+
+ if (pszRootPath)
+ {
+ len = MultiByteToWideChar(CP_ACP, 0, pszRootPath, -1, NULL, 0);
+ if (len == 0)
+ return HRESULT_FROM_WIN32(GetLastError());
+ szRootPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ if (!szRootPathW)
+ return E_OUTOFMEMORY;
+ if (MultiByteToWideChar(CP_ACP, 0, pszRootPath, -1, szRootPathW, len) == 0)
+ {
+ HeapFree(GetProcessHeap(), 0, szRootPathW);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+ }
+
+ hr = SHQueryRecycleBinW(szRootPathW, pSHQueryRBInfo);
+ HeapFree(GetProcessHeap(), 0, szRootPathW);
+
+ return hr;
+}
+
+HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
+{
+ FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo);
pSHQueryRBInfo->i64Size = 0;
pSHQueryRBInfo->i64NumItems = 0;
@@ -2000,22 +2060,12 @@
return S_OK;
}
-HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
-{
- FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo);
-
- pSHQueryRBInfo->i64Size = 0;
- pSHQueryRBInfo->i64NumItems = 0;
+/*************************************************************************
+ * SHSetLocalizedName (SHELL32.@)
+ */
+HRESULT WINAPI SHSetLocalizedName(LPWSTR pszPath, LPCWSTR pszResModule, int idsRes)
+{
+ FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
return S_OK;
}
-
-/*************************************************************************
- * SHSetLocalizedName (SHELL32.@)
- */
-HRESULT WINAPI SHSetLocalizedName(LPWSTR pszPath, LPCWSTR pszResModule, int idsRes)
-{
- FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
-
- return S_OK;
-}