53#define COLUMN_DELFROM 1
54#define COLUMN_DATEDEL 2
59#define COLUMNS_COUNT 6
80 if (pFileDetails ==
NULL)
85 Context.pFileDetails = pFileDetails;
92 IRecycleBinFile* pRecycleFile = (IRecycleBinFile*)
Context.hDeletedFile;
105 ERR(
"Recycler could not retrieve the icon, this shouldn't happen\n");
107 CComPtr<IDefaultExtractIconInit> initIcon;
134 public CComObjectRootEx<CComMultiThreadModelNoCS>,
172 ERR(
"GetDeletedFileDetailsW failed\n");
188 ERR(
"GetDeletedFileDetailsW failed\n");
211 return (PIDLRecycleStruct*) & (
pdata->u.crecycle);
229 ERR(
"GetEnvironmentVariableW failed\n");
234 if (
dwFlags & SHCONTF_NONFOLDERS)
236 TRACE(
"Starting Enumeration\n");
240 WARN(
"Error: EnumerateCRecycleBinW failed\n");
255 PIDLRecycleStruct *
p;
256 int size0 = (
char*)&tmp.
u.crecycle.
szName - (
char*)&tmp.
u.crecycle;
266 pidl->mkid.cb =
size + 2;
267 memcpy(pidl->mkid.abID, &tmp, 2 + size0);
269 p = &((
PIDLDATA*)pidl->mkid.abID)->u.crecycle;
272 *(
WORD*)((
char*)pidl + (
size + 2)) = 0;
294 ERR(
"GetDeletedFileDetailsW failed\n");
310 ERR(
"GetDeletedFileDetailsW failed\n");
356 WCHAR szBuffer[30] = {0};
359 TRACE(
"(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",
this, hMenu, indexMenu, idCmdFirst, idCmdLast,
uFlags);
397 TRACE(
"(%p)->(invcom=%p verb=%p wnd=%p)\n",
this, lpcmi, lpcmi->
lpVerb, lpcmi->
hwnd);
406 ERR(
"GetEnvironmentVariableW failed\n");
430 FIXME(
"implement cut\n");
435 FIXME(
"implement properties\n");
444 TRACE(
"(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",
this, idCommand,
uFlags, lpReserved, lpszName, uMaxNameLen);
451 TRACE(
"CRecycleBin_IContextMenu2Item_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",
this, uMsg,
wParam,
lParam);
472 TRACE(
"(%p, %p)\n",
this, pClassID);
473 if (pClassID ==
NULL)
475 memcpy(pClassID, &CLSID_RecycleBin,
sizeof(
CLSID));
485 if (this->pidl ==
NULL)
503 ULONG *pdwAttributes)
558 diff = pData1->FileSize.QuadPart - pData2->FileSize.QuadPart;
574 CComPtr<IShellView> pShellView;
600 TRACE (
"-- (%p)->(interface=%p)\n",
this,
ppv);
608 TRACE(
"(%p, %d, {%p, ...}, {%x})\n",
this, cidl, apidl ? apidl[0] :
NULL, (
unsigned int)*rgfInOut);
609 *rgfInOut &= SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK;
619 TRACE (
"(%p)->(%p,%u,apidl=%p, %p %p)\n",
this,
620 hwndOwner, cidl, apidl, prgfInOut,
ppv);
629 hr = ShellObjectCreatorInit<CRecycleBinItemContextMenu>(apidl[0],
riid, &pObj);
642 TRACE (
"(%p)->hr=0x%08x\n",
this,
hr);
648 PIDLRecycleStruct *pFileDetails;
661 pFileName =
wcsrchr(pFileDetails->szName,
L'\\');
699 TRACE(
"(%p, %x, %p, %p)\n",
this, (
unsigned int)
dwReserved, pSort, pDisplay);
709 TRACE(
"(%p, %d, %p)\n",
this, iColumn, pcsFlags);
744 PIDLRecycleStruct * pFileDetails;
750 TRACE(
"(%p, %p, %d, %p)\n",
this,
pidl, iColumn, pDetails);
768 pszBackslash =
wcsrchr(pFileDetails->szName,
L'\\');
769 Length = (pszBackslash - pFileDetails->szName);
787 Context.pFileDetails = pFileDetails;
803 return SHSetStrRet(&pDetails->
str,
buffer);
809 return SHSetStrRet(&pDetails->
str,
buffer);
814 TRACE(
"(%p, %d, %p)\n",
this, iColumn, pscid);
824 CComPtr<IEnumIDList> spEnumFiles;
828 CComHeapPtr<ITEMIDLIST> spPidl;
830 return spEnumFiles->Next(1, &spPidl, &itemcount) !=
S_OK;
843 TRACE(
"QueryContextMenu %p %p %u %u %u %u\n",
this, hMenu, indexMenu, idCmdFirst, idCmdLast,
uFlags );
856 mii.
wID = idCmdFirst +
id++;
873 TRACE(
"%p %p verb %p\n",
this, lpcmi, lpcmi->
lpVerb);
879 ERR(
"GetEnvironmentVariableW failed\n");
890 if (lpSB &&
SUCCEEDED(lpSB->QueryActiveShellView(&lpSV)))
898 FIXME(
"%p %lu %u %p %p %u\n",
this, idCommand,
uFlags, lpReserved, lpszName, uMaxNameLen);
916 FIXME(
"%p %lu %p %lu\n",
this, uPageID, pfnReplaceWith,
lParam);
927 TRACE(
"%p %p %p %p\n",
this, pidlFolder, pdtobj, hkeyProgID );
940 DWORD dwNukeOnDelete, dwType, VolSerialNumber, MaxComponentLength;
944 WCHAR szKey[150] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\BitBucket\\Volume\\";
946 if (wszPath[1] !=
L':')
954 StringCbCopyW(wszRootPathName,
sizeof(wszRootPathName), wszPath);
975 ERR(
"RegCreateKeyExW failed\n");
992 dwSize =
sizeof(dwNukeOnDelete);
1005 else if (dwNukeOnDelete)
1035 L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current",
1047 lError = regKey.QueryValue(
NULL, &dwType, pszValue, &
dwSize);
1063 else if (dwType ==
REG_SZ)
1135 LPENUMIDLIST penumFiles;
1156 hr = pRecycleBin->
EnumObjects(
hwnd, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penumFiles);
1166 while (penumFiles->Next(1, &pidl,
NULL) ==
S_OK)
1173 penumFiles->Release();
1259 if (!pszRootPath || (pszRootPath[0] == 0) ||
1268 CComPtr<IRecycleBin> spRecycleBin;
1273 CComPtr<IRecycleBinEnumList> spEnumList;
1274 hr = spRecycleBin->EnumObjects(&spEnumList);
1280 CComPtr<IRecycleBinFile> spFile;
1281 hr = spEnumList->Next(1, &spFile,
NULL);
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static HRESULT FormatDateTime(LPWSTR buffer, int size, FILETIME *ft)
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
static const columninfo RecycleBinColumns[]
BOOL TRASH_TrashFile(LPCWSTR wszPath)
HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
BOOL WINAPI CBSearchRecycleBin(IN PVOID Context, IN HDELFILE hDeletedFile)
HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
EXTERN_C HRESULT WINAPI SHUpdateRecycleBinIcon(void)
struct _SEARCH_CONTEXT * PSEARCH_CONTEXT
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
HRESULT CRecyclerExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
struct _SEARCH_CONTEXT SEARCH_CONTEXT
BOOL TRASH_CanTrashFile(LPCWSTR wszPath)
PDELETED_FILE_DETAILS_W UnpackDetailsFromPidl(LPCITEMIDLIST pidl)
static LPITEMIDLIST _ILCreateRecycleItem(PDELETED_FILE_DETAILS_W pFileDetails)
static void TRASH_PlayEmptyRecycleBinSound()
HRESULT CRecyclerDropTarget_CreateInstance(REFIID riid, LPVOID *ppvOut)
#define shell32_hInstance
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
LPWSTR FormatDateTime(IN LPSYSTEMTIME pDateTime)
#define RegCloseKey(hKey)
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
BOOL AddToEnumList(LPITEMIDLIST pidl)
bool AllocateBytes(_In_ size_t nBytes)
bool Allocate(_In_ size_t nElements=1)
HRESULT WINAPI Initialize(DWORD dwFlags)
static BOOL WINAPI CBEnumRecycleBin(IN PVOID Context, IN HDELFILE hDeletedFile)
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
STDMETHOD() GetClassID(CLSID *pClassID) override
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
STDMETHOD() InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) override
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
STDMETHOD() GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
STDMETHOD() ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam) override
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
STDMETHOD() Initialize(PCIDLIST_ABSOLUTE pidl) override
STDMETHOD() QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
#define ERROR_INSUFFICIENT_BUFFER
#define IDS_SHV_COLUMN_TYPE
#define IDS_SHV_COLUMN_NAME
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define GetEnvironmentVariableW(x, y, z)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
#define FAILED_UNEXPECTEDLY(hr)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
BOOL WINAPI RestoreFile(IN HDELFILE hDeletedFile)
BOOL WINAPI EnumerateRecycleBinW(IN LPCWSTR pszRoot OPTIONAL, IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback, IN PVOID Context OPTIONAL)
BOOL WINAPI CloseRecycleBinHandle(IN HDELFILE hDeletedFile)
BOOL WINAPI GetDeletedFileTypeNameW(IN HDELFILE hDeletedFile, OUT LPWSTR pTypeName, IN DWORD BufferSize, OUT LPDWORD RequiredSize OPTIONAL)
BOOL WINAPI GetDeletedFileDetailsW(IN HDELFILE hDeletedFile, IN DWORD BufferSize, IN OUT PDELETED_FILE_DETAILS_W FileDetails OPTIONAL, OUT LPDWORD RequiredSize OPTIONAL)
BOOL WINAPI EmptyRecycleBinW(IN LPCWSTR pszRoot OPTIONAL)
BOOL WINAPI DeleteFileHandleToRecycleBin(IN HDELFILE hDeletedFile)
HRESULT WINAPI GetDefaultRecycleBin(IN LPCWSTR pszVolume OPTIONAL, OUT IRecycleBin **pprb)
void WINAPI SHFree(LPVOID pv)
LPVOID WINAPI SHAlloc(SIZE_T len)
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
#define MAKE_HRESULT(sev, fac, code)
WCHAR swShell32Name[MAX_PATH]
GLuint GLuint GLsizei count
VOID WINAPI CoTaskMemFree(LPVOID ptr)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT EnumObjects([in] HWND hwndOwner, [in] SHCONTF grfFlags, [out] IEnumIDList **ppenumIDList)
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
HRESULT GetDisplayNameOf([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define COM_INTERFACE_ENTRY_IID(iid, x)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static PROTOCOLDATA * pdata
unsigned __int3264 UINT_PTR
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
#define REG_CREATED_NEW_KEY
#define LOCALE_USER_DEFAULT
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define PID_STG_STORAGETYPE
#define PID_STG_WRITETIME
interface IBindCtx * LPBC
#define PathAddBackslashW
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
void WINAPI ILFree(LPITEMIDLIST pidl)
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
#define IsEqualIID(riid1, riid2)
#define DeleteFileToRecycleBin
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define SHERB_NOPROGRESSUI
#define SHERB_NOCONFIRMATION
#define MAKE_COMPARE_HRESULT(x)
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
#define PID_DISPLACED_FROM
#define PID_DISPLACED_DATE
#define SHCNE_UPDATEIMAGE
struct _SFV_CREATE SFV_CREATE
LPARAM LPFNSVADDPROPSHEETPAGE
#define IDS_SHV_COLUMN_DELFROM
#define IDS_SHV_COLUMN_SIZE
#define IDS_SHV_COLUMN_MODIFIED
#define IDS_DELETEITEM_TEXT
#define IDS_EMPTY_BITBUCKET
#define IDS_SHV_COLUMN_DELDATE
#define IDS_DELETEMULTIPLE_TEXT
ITEMIDLIST UNALIGNED * LPITEMIDLIST
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
PIDLRecycleStruct * pFileDetails
union tagPIDLDATA::@557 u
#define RtlCopyMemory(Destination, Source, Length)
#define CWM_GETISHELLBROWSER
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
DWORD WINAPI GetLastError(void)
_Reserved_ DWORD _In_ DWORD _Out_ DWORD _Out_writes_bytes_to_opt_ pcbTypeName LPSTR szTypeName
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define HRESULT_FROM_WIN32(x)
#define HKEY_CURRENT_USER
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_ICONEXCLAMATION
#define MAKEINTRESOURCEA(i)
#define MAKEINTRESOURCEW(i)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define IID_PPV_ARG(Itype, ppType)