mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[SHELL32] Move some *RecycleBin*() functions to a more appropriate source file. Improve header inclusions.
svn path=/trunk/; revision=66159
This commit is contained in:
parent
949aef7e6c
commit
d952727844
2 changed files with 142 additions and 142 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <mmsystem.h>
|
||||
#include <ntquery.h>
|
||||
|
||||
#define MAX_PROPERTY_SHEET_PAGE 32
|
||||
|
@ -1566,4 +1567,135 @@ HRESULT WINAPI DoDeleteDataObject(IDataObject *pda)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <commdlg.h>
|
||||
#include <commoncontrols.h>
|
||||
#include <recyclebin.h>
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
#include <wine/unicode.h>
|
||||
|
@ -1646,6 +1645,15 @@ BOOL WINAPI GUIDFromStringW(LPCWSTR str, LPGUID guid)
|
|||
return !RtlGUIDFromString(&guid_str, guid);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsTemporaryA [SHELL32.713]
|
||||
*/
|
||||
BOOL WINAPI PathIsTemporaryA(LPSTR Str)
|
||||
{
|
||||
FIXME("(%s)stub\n", debugstr_a(Str));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsTemporaryW [SHELL32.714]
|
||||
*/
|
||||
|
@ -2190,143 +2198,3 @@ HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv,
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue