ReactOS 0.4.15-dev-8116-gf69e256
CRecycleBin Class Reference

#include <CRecycleBin.h>

Inheritance diagram for CRecycleBin:
Collaboration diagram for CRecycleBin:

Public Member Functions

 CRecycleBin ()
 
 ~CRecycleBin ()
 
STDMETHOD() GetClassID (CLSID *pClassID) override
 
STDMETHOD() Initialize (PCIDLIST_ABSOLUTE pidl) override
 
STDMETHOD() GetCurFolder (PIDLIST_ABSOLUTE *pidl) override
 
STDMETHOD() ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
 
STDMETHOD() EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
 
STDMETHOD() BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
 
STDMETHOD() BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
 
STDMETHOD() CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
 
STDMETHOD() CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
 
STDMETHOD() GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
 
STDMETHOD() GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
 
STDMETHOD() GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
 
STDMETHOD() SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
 
STDMETHOD() GetDefaultSearchGUID (GUID *pguid) override
 
STDMETHOD() EnumSearches (IEnumExtraSearch **ppenum) override
 
STDMETHOD() GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
 
STDMETHOD() GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags) override
 
STDMETHOD() GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
 
STDMETHOD() GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
 
STDMETHOD() MapColumnToSCID (UINT column, SHCOLUMNID *pscid) override
 
STDMETHOD() QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
 
STDMETHOD() InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi) override
 
STDMETHOD() GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override
 
STDMETHOD() AddPages (LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override
 
STDMETHOD() ReplacePage (EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam) override
 
STDMETHOD() Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT GetDefaultSearchGUID ([out] GUID *lpguid)
 
HRESULT EnumSearches ([out] IEnumExtraSearch **ppenum)
 
HRESULT GetDefaultColumn ([in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay)
 
HRESULT GetDefaultColumnState ([in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags)
 
HRESULT GetDetailsEx ([in] PCUITEMID_CHILD pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv)
 
HRESULT GetDetailsOf ([in] PCUITEMID_CHILD pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd)
 
HRESULT MapColumnToSCID ([in] UINT iColumn, [in] SHCOLUMNID *pscid)
 
- Public Member Functions inherited from IShellFolder
HRESULT ParseDisplayName ([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
 
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 BindToStorage ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvObj)
 
HRESULT CompareIDs ([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
 
HRESULT CreateViewObject ([in] HWND hwndOwner, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetAttributesOf ([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
 
HRESULT GetUIObjectOf ([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetDisplayNameOf ([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
 
HRESULT SetNameOf ([in] HWND hwnd, [in] PCUITEMID_CHILD pidl, [in, string] LPCOLESTR lpszName, [in] SHGDNF uFlags, [out] PITEMID_CHILD *ppidlOut)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT GetCurFolder ([out] PIDLIST_ABSOLUTE *ppidl)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidl)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 
HRESULT AddPages ([in] LPFNSVADDPROPSHEETPAGE pfnAddPage, [in] LPARAM lParam)
 
HRESULT ReplacePage ([in] EXPPS uPageID, [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith, [in] LPARAM lParam)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID)
 

Private Member Functions

BOOL RecycleBinIsEmpty ()
 

Private Attributes

LPITEMIDLIST pidl
 
INT iIdEmpty
 

Additional Inherited Members

- Public Types inherited from IShellFolder2
typedef struct IShellFolder2::SHCOLUMNIDLPSHCOLUMNID
 
typedef const SHCOLUMNIDLPCSHCOLUMNID
 
- Public Types inherited from IShellFolder
enum  tagSHGDN {
  SHGDN_NORMAL = 0 , SHGDN_INFOLDER = 1 , SHGDN_FOREDITING = 0x1000 , SHGDN_INCLUDE_NONFILESYS = 0x2000 ,
  SHGDN_FORADDRESSBAR = 0x4000 , SHGDN_FORPARSING = 0x8000
}
 
enum  tagSHCONTF {
  SHCONTF_FOLDERS = 32 , SHCONTF_NONFOLDERS = 64 , SHCONTF_INCLUDEHIDDEN = 128 , SHCONTF_INIT_ON_FIRST_NEXT = 256 ,
  SHCONTF_NETPRINTERSRCH = 512 , SHCONTF_SHAREABLE = 1024 , SHCONTF_STORAGE = 2048 , SHCONTF_NAVIGATION_ENUM = 0x01000 ,
  SHCONTF_FASTITEMS = 0x02000 , SHCONTF_FLATLIST = 0x04000 , SHCONTF_ENABLE_ASYNC = 0x08000 , SHCONTF_INCLUDESUPERHIDDEN = 0x10000
}
 
typedef IShellFolderLPSHELLFOLDER
 
typedef enum IShellFolder::tagSHGDN SHGNO
 
typedef DWORD SHGDNF
 
typedef DWORD SHCONTF
 
typedef ULONG SFGAOF
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistFolder2
typedef IPersistFolder2LPPERSISTFOLDER2
 
- Public Types inherited from IPersistFolder
typedef IPersistFolderLPPERSISTFOLDER
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IContextMenu
typedef IContextMenuLPCONTEXTMENU
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Public Types inherited from IShellPropSheetExt
enum  tagSHELLPROPSHEETEXTPAGEID { EXPPS_FILETYPES = 0x1 }
 
typedef UINT EXPPS
 
- Public Types inherited from IShellExtInit
typedef IShellExtInitLPSHELLEXTINIT
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Static Public Attributes inherited from IContextMenu
static const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 

Detailed Description

Definition at line 29 of file CRecycleBin.h.

Constructor & Destructor Documentation

◆ CRecycleBin()

CRecycleBin::CRecycleBin ( )

Definition at line 456 of file CRecycleBin.cpp.

457{
458 pidl = NULL;
459}
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
#define NULL
Definition: types.h:112

◆ ~CRecycleBin()

CRecycleBin::~CRecycleBin ( )

Definition at line 461 of file CRecycleBin.cpp.

462{
463 SHFree(pidl);
464}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326

Member Function Documentation

◆ AddPages()

HRESULT WINAPI CRecycleBin::AddPages ( LPFNSVADDPROPSHEETPAGE  pfnAddPage,
LPARAM  lParam 
)
override

Implements IShellPropSheetExt.

Definition at line 902 of file CRecycleBin.cpp.

903{
904 FIXME("%p %p %lu\n", this, pfnAddPage, lParam);
905
906 return E_NOTIMPL;
907}
#define FIXME(fmt,...)
Definition: debug.h:114
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindToObject()

HRESULT WINAPI CRecycleBin::BindToObject ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
override

Definition at line 521 of file CRecycleBin.cpp.

522{
523 FIXME("(%p, %p, %p, %s, %p) - stub\n", this, pidl, pbc, debugstr_guid(&riid), ppv);
524 return E_NOTIMPL;
525}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35

◆ BindToStorage()

HRESULT WINAPI CRecycleBin::BindToStorage ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
override

Definition at line 527 of file CRecycleBin.cpp.

528{
529 FIXME("(%p, %p, %p, %s, %p) - stub\n", this, pidl, pbc, debugstr_guid(&riid), ppv);
530 return E_NOTIMPL;
531}

◆ CompareIDs()

HRESULT WINAPI CRecycleBin::CompareIDs ( LPARAM  lParam,
PCUIDLIST_RELATIVE  pidl1,
PCUIDLIST_RELATIVE  pidl2 
)
override

Implements IShellFolder.

Definition at line 533 of file CRecycleBin.cpp.

534{
535 PIDLRecycleStruct* pData1 = _ILGetRecycleStruct(pidl1);
536 PIDLRecycleStruct* pData2 = _ILGetRecycleStruct(pidl2);
537 LPWSTR pName1, pName2;
538
539 if(!pData1 || !pData2 || LOWORD(lParam) >= COLUMNS_COUNT)
540 return E_INVALIDARG;
541
543 LONGLONG diff;
544 switch (LOWORD(lParam))
545 {
546 case 0: /* Name */
547 pName1 = PathFindFileNameW(pData1->szName);
548 pName2 = PathFindFileNameW(pData2->szName);
549 result = wcsicmp(pName1, pName2);
550 break;
551 case 1: /* Orig. Location */
552 result = wcsicmp(pData1->szName, pData2->szName);
553 break;
554 case 2: /* Date Deleted */
555 result = CompareFileTime(&pData1->DeletionTime, &pData2->DeletionTime);
556 break;
557 case 3: /* Size */
558 diff = pData1->FileSize.QuadPart - pData2->FileSize.QuadPart;
559 return MAKE_COMPARE_HRESULT(diff);
560 case 4: /* Type */
561 pName1 = PathFindExtensionW(pData1->szName);
562 pName2 = PathFindExtensionW(pData2->szName);
563 result = wcsicmp(pName1, pName2);
564 break;
565 case 5: /* Modified */
566 result = CompareFileTime(&pData1->LastModification, &pData2->LastModification);
567 break;
568 }
570}
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
#define COLUMNS_COUNT
Definition: CRecycleBin.cpp:59
#define E_INVALIDARG
Definition: ddrawi.h:101
#define wcsicmp
Definition: compat.h:15
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
GLuint64EXT * result
Definition: glext.h:11304
#define LOWORD(l)
Definition: pedump.c:82
short SHORT
Definition: pedump.c:59
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:577
int64_t LONGLONG
Definition: typedefs.h:68
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ CreateViewObject()

HRESULT WINAPI CRecycleBin::CreateViewObject ( HWND  hwndOwner,
REFIID  riid,
LPVOID ppvOut 
)
override

Definition at line 572 of file CRecycleBin.cpp.

573{
574 CComPtr<IShellView> pShellView;
576
577 TRACE("(%p, %p, %s, %p)\n", this, hwndOwner, debugstr_guid(&riid), ppv);
578
579 if (!ppv)
580 return hr;
581
582 *ppv = NULL;
583
584 if (IsEqualIID (riid, IID_IDropTarget))
585 {
587 }
588 else if (IsEqualIID (riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2))
589 {
590 hr = this->QueryInterface(riid, ppv);
591 }
592 else if (IsEqualIID (riid, IID_IShellView))
593 {
594 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
595 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppv);
596 }
597 else
598 return hr;
599
600 TRACE ("-- (%p)->(interface=%p)\n", this, ppv);
601 return hr;
602
603}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3951
HRESULT CRecyclerDropTarget_CreateInstance(REFIID riid, LPVOID *ppvOut)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
HRESULT hr
Definition: shlfolder.c:183
struct _SFV_CREATE SFV_CREATE
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ EnumObjects()

HRESULT WINAPI CRecycleBin::EnumObjects ( HWND  hwndOwner,
DWORD  dwFlags,
LPENUMIDLIST *  ppEnumIDList 
)
override

Definition at line 516 of file CRecycleBin.cpp.

517{
518 return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
519}
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define IID_PPV_ARG(Itype, ppType)

Referenced by RecycleBinIsEmpty().

◆ EnumSearches()

HRESULT WINAPI CRecycleBin::EnumSearches ( IEnumExtraSearch **  ppenum)
override

Implements IShellFolder2.

Definition at line 690 of file CRecycleBin.cpp.

691{
692 FIXME("stub\n");
693 *ppEnum = NULL;
694 return E_NOTIMPL;
695}

◆ GetAttributesOf()

HRESULT WINAPI CRecycleBin::GetAttributesOf ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
DWORD rgfInOut 
)
override

Definition at line 605 of file CRecycleBin.cpp.

607{
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;
610 return S_OK;
611}
#define S_OK
Definition: intsafe.h:52

◆ GetClassID()

HRESULT WINAPI CRecycleBin::GetClassID ( CLSID pClassID)
override

Implements IPersist.

Definition at line 470 of file CRecycleBin.cpp.

471{
472 TRACE("(%p, %p)\n", this, pClassID);
473 if (pClassID == NULL)
474 return E_INVALIDARG;
475 memcpy(pClassID, &CLSID_RecycleBin, sizeof(CLSID));
476 return S_OK;
477}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

◆ GetCommandString()

HRESULT WINAPI CRecycleBin::GetCommandString ( UINT_PTR  idCommand,
UINT  uFlags,
UINT lpReserved,
LPSTR  lpszName,
UINT  uMaxNameLen 
)
override

Implements IContextMenu.

Definition at line 891 of file CRecycleBin.cpp.

892{
893 FIXME("%p %lu %u %p %p %u\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
894
895 return E_NOTIMPL;
896}
UINT uFlags
Definition: api.c:59

◆ GetCurFolder()

HRESULT WINAPI CRecycleBin::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
override

Implements IPersistFolder2.

Definition at line 490 of file CRecycleBin.cpp.

491{
492 TRACE("\n");
493 *ppidl = ILClone(pidl);
494 return S_OK;
495}
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

◆ GetDefaultColumn()

HRESULT WINAPI CRecycleBin::GetDefaultColumn ( DWORD  dwRes,
ULONG pSort,
ULONG pDisplay 
)
override

Implements IShellFolder2.

Definition at line 697 of file CRecycleBin.cpp.

698{
699 TRACE("(%p, %x, %p, %p)\n", this, (unsigned int)dwReserved, pSort, pDisplay);
700 if (pSort)
701 *pSort = 0;
702 if (pDisplay)
703 *pDisplay = 0;
704 return S_OK;
705}
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ GetDefaultColumnState()

HRESULT WINAPI CRecycleBin::GetDefaultColumnState ( UINT  iColumn,
DWORD pcsFlags 
)
override

Implements IShellFolder2.

Definition at line 707 of file CRecycleBin.cpp.

708{
709 TRACE("(%p, %d, %p)\n", this, iColumn, pcsFlags);
710 if (iColumn >= COLUMNS_COUNT)
711 return E_INVALIDARG;
712 *pcsFlags = RecycleBinColumns[iColumn].pcsFlags;
713 return S_OK;
714}
static const columninfo RecycleBinColumns[]
Definition: CRecycleBin.cpp:40

◆ GetDefaultSearchGUID()

HRESULT WINAPI CRecycleBin::GetDefaultSearchGUID ( GUID pguid)
override

Implements IShellFolder2.

Definition at line 684 of file CRecycleBin.cpp.

685{
686 FIXME("stub\n");
687 return E_NOTIMPL;
688}

◆ GetDetailsEx()

HRESULT WINAPI CRecycleBin::GetDetailsEx ( PCUITEMID_CHILD  pidl,
const SHCOLUMNID pscid,
VARIANT pv 
)
override

Implements IShellFolder2.

Definition at line 716 of file CRecycleBin.cpp.

717{
718 FIXME("stub\n");
719 return E_NOTIMPL;
720}

◆ GetDetailsOf()

HRESULT WINAPI CRecycleBin::GetDetailsOf ( PCUITEMID_CHILD  pidl,
UINT  iColumn,
SHELLDETAILS psd 
)
override

Implements IShellFolder2.

Definition at line 742 of file CRecycleBin.cpp.

743{
744 PIDLRecycleStruct * pFileDetails;
746 WCHAR szTypeName[100];
747 LPWSTR pszBackslash;
748 UINT Length;
749
750 TRACE("(%p, %p, %d, %p)\n", this, pidl, iColumn, pDetails);
751 if (iColumn >= COLUMNS_COUNT)
752 return E_FAIL;
753 pDetails->fmt = RecycleBinColumns[iColumn].fmt;
754 pDetails->cxChar = RecycleBinColumns[iColumn].cxChars;
755 if (pidl == NULL)
756 return SHSetStrRet(&pDetails->str, RecycleBinColumns[iColumn].column_name_id);
757
758 if (iColumn == COLUMN_NAME)
759 return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
760
761 pFileDetails = _ILGetRecycleStruct(pidl);
762 switch (iColumn)
763 {
764 case COLUMN_DATEDEL:
765 FormatDateTime(buffer, MAX_PATH, &pFileDetails->DeletionTime);
766 break;
767 case COLUMN_DELFROM:
768 pszBackslash = wcsrchr(pFileDetails->szName, L'\\');
769 Length = (pszBackslash - pFileDetails->szName);
770 memcpy((LPVOID)buffer, pFileDetails->szName, Length * sizeof(WCHAR));
771 buffer[Length] = L'\0';
772 break;
773 case COLUMN_SIZE:
774 StrFormatKBSizeW(pFileDetails->FileSize.QuadPart, buffer, MAX_PATH);
775 break;
776 case COLUMN_MTIME:
777 FormatDateTime(buffer, MAX_PATH, &pFileDetails->LastModification);
778 break;
779 case COLUMN_TYPE:
780 {
782 Context.pFileDetails = pFileDetails;
783 Context.bFound = FALSE;
785
786 if (Context.bFound)
787 {
789
790 CloseRecycleBinHandle(Context.hDeletedFile);
791 }
792 /* load localized file string */
794 {
796 }
797
798 return SHSetStrRet(&pDetails->str, buffer);
799 }
800 default:
801 return E_FAIL;
802 }
803
804 return SHSetStrRet(&pDetails->str, buffer);
805}
#define COLUMN_SIZE
Definition: CRecycleBin.cpp:55
BOOL WINAPI CBSearchRecycleBin(IN PVOID Context, IN HDELFILE hDeletedFile)
#define COLUMN_MTIME
Definition: CRecycleBin.cpp:57
#define COLUMN_DATEDEL
Definition: CRecycleBin.cpp:54
#define COLUMN_DELFROM
Definition: CRecycleBin.cpp:53
#define shell32_hInstance
LPWSTR FormatDateTime(IN LPSYSTEMTIME pDateTime)
Definition: utils.c:41
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
#define wcsrchr
Definition: compat.h:16
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI EnumerateRecycleBinW(IN LPCWSTR pszRoot OPTIONAL, IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback, IN PVOID Context OPTIONAL)
Definition: recyclebin.c:205
BOOL WINAPI CloseRecycleBinHandle(IN HDELFILE hDeletedFile)
Definition: recyclebin.c:12
BOOL WINAPI GetDeletedFileTypeNameW(IN HDELFILE hDeletedFile, OUT LPWSTR pTypeName, IN DWORD BufferSize, OUT LPDWORD RequiredSize OPTIONAL)
Definition: recyclebin.c:256
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1751
GLuint buffer
Definition: glext.h:5915
unsigned int UINT
Definition: ndis.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
#define COLUMN_NAME
#define COLUMN_TYPE
#define IDS_ANY_FILE
Definition: shresdef.h:183
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
int column_name_id
Definition: CRecycleBin.cpp:32
_Reserved_ DWORD _In_ DWORD _Out_ DWORD _Out_writes_bytes_to_opt_ pcbTypeName LPSTR szTypeName
Definition: wincrypt.h:4283
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ GetDisplayNameOf()

HRESULT WINAPI CRecycleBin::GetDisplayNameOf ( PCUITEMID_CHILD  pidl,
DWORD  dwFlags,
LPSTRRET  strRet 
)
override

Definition at line 646 of file CRecycleBin.cpp.

647{
648 PIDLRecycleStruct *pFileDetails;
649 LPWSTR pFileName;
650
651 TRACE("(%p, %p, %x, %p)\n", this, pidl, (unsigned int)uFlags, pName);
652
653 pFileDetails = _ILGetRecycleStruct(pidl);
654 if (!pFileDetails)
655 {
656 pName->cStr[0] = 0;
657 pName->uType = STRRET_CSTR;
658 return E_INVALIDARG;
659 }
660
661 pFileName = wcsrchr(pFileDetails->szName, L'\\');
662 if (!pFileName)
663 {
664 pName->cStr[0] = 0;
665 pName->uType = STRRET_CSTR;
666 return E_UNEXPECTED;
667 }
668
669 pName->pOleStr = StrDupW(pFileName + 1);
670 if (pName->pOleStr == NULL)
671 return E_OUTOFMEMORY;
672
673 pName->uType = STRRET_WSTR;
674 return S_OK;
675}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1093
static LPSTR pName
Definition: security.c:75
@ STRRET_CSTR
Definition: shtypes.idl:87
@ STRRET_WSTR
Definition: shtypes.idl:85
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by GetDetailsOf().

◆ GetUIObjectOf()

HRESULT WINAPI CRecycleBin::GetUIObjectOf ( HWND  hwndOwner,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
REFIID  riid,
UINT prgfInOut,
LPVOID ppvOut 
)
override

Definition at line 613 of file CRecycleBin.cpp.

615{
616 LPVOID pObj = NULL;
618
619 TRACE ("(%p)->(%p,%u,apidl=%p, %p %p)\n", this,
620 hwndOwner, cidl, apidl, prgfInOut, ppv);
621
622 if (!ppv)
623 return hr;
624
625 *ppv = NULL;
626
627 if ((IsEqualIID (riid, IID_IContextMenu) || IsEqualIID(riid, IID_IContextMenu2)) && (cidl >= 1))
628 {
629 hr = ShellObjectCreatorInit<CRecycleBinItemContextMenu>(apidl[0], riid, &pObj);
630 }
631 else if((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW)) && (cidl == 1))
632 {
633 hr = CRecyclerExtractIcon_CreateInstance(apidl[0], riid, &pObj);
634 }
635 else
637
638 if (SUCCEEDED(hr) && !pObj)
640
641 *ppv = pObj;
642 TRACE ("(%p)->hr=0x%08x\n", this, hr);
643 return hr;
644}
HRESULT CRecyclerExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CRecycleBin.cpp:76
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ Initialize() [1/2]

HRESULT WINAPI CRecycleBin::Initialize ( PCIDLIST_ABSOLUTE  pidl)
override

Implements IPersistFolder.

Definition at line 479 of file CRecycleBin.cpp.

480{
481 TRACE("(%p, %p)\n", this, pidl);
482
483 SHFree((LPVOID)this->pidl);
484 this->pidl = ILClone(pidl);
485 if (this->pidl == NULL)
486 return E_OUTOFMEMORY;
487 return S_OK;
488}

◆ Initialize() [2/2]

HRESULT WINAPI CRecycleBin::Initialize ( PCIDLIST_ABSOLUTE  pidlFolder,
IDataObject pdtobj,
HKEY  hkeyProgID 
)
override

Implements IShellExtInit.

Definition at line 920 of file CRecycleBin.cpp.

921{
922 TRACE("%p %p %p %p\n", this, pidlFolder, pdtobj, hkeyProgID );
923 return S_OK;
924}

◆ InvokeCommand()

HRESULT WINAPI CRecycleBin::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
override

Implements IContextMenu.

Definition at line 861 of file CRecycleBin.cpp.

862{
863 HRESULT hr;
864 LPSHELLBROWSER lpSB;
865 IShellView * lpSV = NULL;
866 WCHAR szDrive[8];
867
868 TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
869
870 if (LOWORD(lpcmi->lpVerb) == iIdEmpty)
871 {
872 if (!GetEnvironmentVariableW(L"SystemDrive", szDrive, _countof(szDrive) - 1))
873 {
874 ERR("GetEnvironmentVariableW failed\n");
875 return E_FAIL;
876 }
877 PathAddBackslashW(szDrive);
878
879 hr = SHEmptyRecycleBinW(lpcmi->hwnd, szDrive, 0);
880 TRACE("result %x\n", hr);
881 if (hr != S_OK)
882 return hr;
883
884 lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER, 0, 0);
885 if (lpSB && SUCCEEDED(lpSB->QueryActiveShellView(&lpSV)))
886 lpSV->Refresh();
887 }
888 return S_OK;
889}
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
#define ERR(fmt,...)
Definition: debug.h:113
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
HRESULT Refresh()
#define PathAddBackslashW
Definition: pathcch.h:301
#define CWM_GETISHELLBROWSER
Definition: undocshell.h:205
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ MapColumnToSCID()

HRESULT WINAPI CRecycleBin::MapColumnToSCID ( UINT  column,
SHCOLUMNID pscid 
)
override

Implements IShellFolder2.

Definition at line 807 of file CRecycleBin.cpp.

808{
809 TRACE("(%p, %d, %p)\n", this, iColumn, pscid);
810 if (iColumn >= COLUMNS_COUNT)
811 return E_INVALIDARG;
812 pscid->fmtid = *RecycleBinColumns[iColumn].fmtId;
813 pscid->pid = RecycleBinColumns[iColumn].pid;
814 return S_OK;
815}
const GUID * fmtId
Definition: CRecycleBin.cpp:33

◆ ParseDisplayName()

HRESULT WINAPI CRecycleBin::ParseDisplayName ( HWND  hwndOwner,
LPBC  pbc,
LPOLESTR  lpszDisplayName,
DWORD pchEaten,
PIDLIST_RELATIVE ppidl,
DWORD pdwAttributes 
)
override

Definition at line 501 of file CRecycleBin.cpp.

504{
505 FIXME("stub\n");
506 return E_NOTIMPL;
507}

◆ QueryContextMenu()

HRESULT WINAPI CRecycleBin::QueryContextMenu ( HMENU  hMenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
override

Implements IContextMenu.

Definition at line 832 of file CRecycleBin.cpp.

833{
834 WCHAR szBuffer[100];
835 MENUITEMINFOW mii;
836 int id = 1;
837
838 TRACE("QueryContextMenu %p %p %u %u %u %u\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags );
839
840 if (!hMenu)
841 return E_INVALIDARG;
842
843 ZeroMemory(&mii, sizeof(mii));
844 mii.cbSize = sizeof(mii);
847 szBuffer[0] = L'\0';
849 mii.dwTypeData = szBuffer;
850 mii.cch = wcslen(mii.dwTypeData);
851 mii.wID = idCmdFirst + id++;
852 mii.fType = MFT_STRING;
853 iIdEmpty = 1;
854
855 if (!InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
856 return E_FAIL;
857
858 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, id);
859}
BOOL RecycleBinIsEmpty()
#define TRUE
Definition: types.h:120
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IDS_EMPTY_BITBUCKET
Definition: shresdef.h:185
LPWSTR dwTypeData
Definition: winuser.h:3269
#define ZeroMemory
Definition: winbase.h:1712
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define MIIM_ID
Definition: winuser.h:722
#define MFS_DISABLED
Definition: winuser.h:749
#define MIIM_STATE
Definition: winuser.h:721
#define MFS_ENABLED
Definition: winuser.h:750
#define MFT_STRING
Definition: winuser.h:746
#define MIIM_TYPE
Definition: winuser.h:725
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)

◆ RecycleBinIsEmpty()

BOOL CRecycleBin::RecycleBinIsEmpty ( )
private

Definition at line 817 of file CRecycleBin.cpp.

818{
819 CComPtr<IEnumIDList> spEnumFiles;
821 if (FAILED(hr))
822 return TRUE;
823 CComHeapPtr<ITEMIDLIST> spPidl;
824 ULONG itemcount;
825 return spEnumFiles->Next(1, &spPidl, &itemcount) != S_OK;
826 }
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
@ SHCONTF_NONFOLDERS
Definition: shobjidl.idl:174
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t ULONG
Definition: typedefs.h:59

Referenced by QueryContextMenu().

◆ ReplacePage()

HRESULT WINAPI CRecycleBin::ReplacePage ( EXPPS  uPageID,
LPFNSVADDPROPSHEETPAGE  pfnReplaceWith,
LPARAM  lParam 
)
override

Implements IShellPropSheetExt.

Definition at line 909 of file CRecycleBin.cpp.

910{
911 FIXME("%p %lu %p %lu\n", this, uPageID, pfnReplaceWith, lParam);
912
913 return E_NOTIMPL;
914}

◆ SetNameOf()

HRESULT WINAPI CRecycleBin::SetNameOf ( HWND  hwndOwner,
PCUITEMID_CHILD  pidl,
LPCOLESTR  lpName,
DWORD  dwFlags,
PITEMID_CHILD pPidlOut 
)
override

Implements IShellFolder.

Definition at line 677 of file CRecycleBin.cpp.

679{
680 TRACE("\n");
681 return E_FAIL; /* not supported */
682}

Member Data Documentation

◆ iIdEmpty

INT CRecycleBin::iIdEmpty
private

Definition at line 40 of file CRecycleBin.h.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ pidl


The documentation for this class was generated from the following files: