Author: akhaldi
Date: Wed Feb 4 09:13:43 2015
New Revision: 66159
URL:
http://svn.reactos.org/svn/reactos?rev=66159&view=rev
Log:
[SHELL32] Move some *RecycleBin*() functions to a more appropriate source file. Improve
header inclusions.
Modified:
trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
trunk/reactos/dll/win32/shell32/wine/shellord.c
Modified: trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] Wed Feb 4
09:13:43 2015
@@ -21,6 +21,7 @@
#include <precomp.h>
+#include <mmsystem.h>
#include <ntquery.h>
#define MAX_PROPERTY_SHEET_PAGE 32
@@ -1566,4 +1567,135 @@
ReleaseStgMedium(&medium);
return hr;
-}
+}
+
+/*************************************************************************
+ * SHEmptyRecycleBinA (SHELL32.@)
+ */
+HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD 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 = (LPWSTR)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)
+{
+ WCHAR szPath[MAX_PATH] = {0};
+ DWORD dwSize, dwType;
+ LONG ret;
+
+ TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags);
+
+ if (!(dwFlags & SHERB_NOCONFIRMATION))
+ {
+ /* FIXME
+ * enumerate available files
+ * show confirmation dialog
+ */
+ FIXME("show confirmation dialog\n");
+ }
+
+ if (dwFlags & SHERB_NOPROGRESSUI)
+ {
+ ret = EmptyRecycleBinW(pszRootPath);
+ }
+ else
+ {
+ /* FIXME
+ * show a progress dialog
+ */
+ ret = EmptyRecycleBinW(pszRootPath);
+ }
+
+ if (!ret)
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ if (!(dwFlags & SHERB_NOSOUND))
+ {
+ dwSize = sizeof(szPath);
+ ret = RegGetValueW(HKEY_CURRENT_USER,
+
L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current",
+ NULL,
+ RRF_RT_REG_EXPAND_SZ,
+ &dwType,
+ (PVOID)szPath,
+ &dwSize);
+ if (ret != ERROR_SUCCESS)
+ return S_OK;
+
+ if (dwType != REG_EXPAND_SZ) /* type dismatch */
+ return S_OK;
+
+ szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
+ PlaySoundW(szPath, NULL, SND_FILENAME);
+ }
+ return S_OK;
+}
+
+HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO 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 = (LPWSTR)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);
+
+ if (!(pszRootPath) || (pszRootPath[0] == 0) ||
+ !(pSHQueryRBInfo) || (pSHQueryRBInfo->cbSize < sizeof(SHQUERYRBINFO)))
+ {
+ return E_INVALIDARG;
+ }
+
+ pSHQueryRBInfo->i64Size = 0;
+ pSHQueryRBInfo->i64NumItems = 0;
+
+ return S_OK;
+}
Modified: trunk/reactos/dll/win32/shell32/wine/shellord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/she…
==============================================================================
--- trunk/reactos/dll/win32/shell32/wine/shellord.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/wine/shellord.c [iso-8859-1] Wed Feb 4 09:13:43 2015
@@ -35,7 +35,6 @@
#include <commdlg.h>
#include <commoncontrols.h>
#include <recyclebin.h>
-#include <mmsystem.h>
#include <wine/debug.h>
#include <wine/unicode.h>
@@ -1647,6 +1646,15 @@
}
/*************************************************************************
+ * PathIsTemporaryA [SHELL32.713]
+ */
+BOOL WINAPI PathIsTemporaryA(LPSTR Str)
+{
+ FIXME("(%s)stub\n", debugstr_a(Str));
+ return FALSE;
+}
+
+/*************************************************************************
* PathIsTemporaryW [SHELL32.714]
*/
BOOL WINAPI PathIsTemporaryW(LPWSTR Str)
@@ -2190,143 +2198,3 @@
return hRes;
}
-
-/*************************************************************************
- * PathIsTemporaryA [SHELL32.713]
- */
-BOOL WINAPI PathIsTemporaryA(LPSTR Str)
-{
- FIXME("(%s)stub\n", debugstr_a(Str));
- return FALSE;
-}
-
-/*************************************************************************
- * SHEmptyRecycleBinA (SHELL32.@)
- */
-HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD 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 = (LPWSTR)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)
-{
- WCHAR szPath[MAX_PATH] = {0};
- DWORD dwSize, dwType;
- LONG ret;
-
- TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags);
-
- if (!(dwFlags & SHERB_NOCONFIRMATION))
- {
- /* FIXME
- * enumerate available files
- * show confirmation dialog
- */
- FIXME("show confirmation dialog\n");
- }
-
- if (dwFlags & SHERB_NOPROGRESSUI)
- {
- ret = EmptyRecycleBinW(pszRootPath);
- }
- else
- {
- /* FIXME
- * show a progress dialog
- */
- ret = EmptyRecycleBinW(pszRootPath);
- }
-
- if (!ret)
- return HRESULT_FROM_WIN32(GetLastError());
-
- if (!(dwFlags & SHERB_NOSOUND))
- {
- dwSize = sizeof(szPath);
- ret = RegGetValueW(HKEY_CURRENT_USER,
-
L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current",
- NULL,
- RRF_RT_REG_EXPAND_SZ,
- &dwType,
- (PVOID)szPath,
- &dwSize);
- if (ret != ERROR_SUCCESS)
- return S_OK;
-
- if (dwType != REG_EXPAND_SZ) /* type dismatch */
- return S_OK;
-
- szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
- PlaySoundW(szPath, NULL, SND_FILENAME);
- }
- return S_OK;
-}
-
-HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO 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 = (LPWSTR)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);
-
- if (!(pszRootPath) || (pszRootPath[0] == 0) ||
- !(pSHQueryRBInfo) || (pSHQueryRBInfo->cbSize < sizeof(SHQUERYRBINFO)))
- {
- return E_INVALIDARG;
- }
-
- pSHQueryRBInfo->i64Size = 0;
- pSHQueryRBInfo->i64NumItems = 0;
-
- return S_OK;
-}