ReactOS  0.4.15-dev-449-g64abd9f
CRecycleBin Class Reference

#include <CRecycleBin.h>

Inheritance diagram for CRecycleBin:
Collaboration diagram for CRecycleBin:

Public Member Functions

 CRecycleBin ()
 
 ~CRecycleBin ()
 
virtual HRESULT WINAPI GetClassID (CLSID *pClassID)
 
virtual HRESULT WINAPI Initialize (PCIDLIST_ABSOLUTE pidl)
 
virtual HRESULT WINAPI GetCurFolder (PIDLIST_ABSOLUTE *pidl)
 
virtual HRESULT WINAPI ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
 
virtual HRESULT WINAPI EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 
virtual HRESULT WINAPI BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
 
virtual HRESULT WINAPI CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
 
virtual HRESULT WINAPI GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
 
virtual HRESULT WINAPI GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
 
virtual HRESULT WINAPI SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
 
virtual HRESULT WINAPI GetDefaultSearchGUID (GUID *pguid)
 
virtual HRESULT WINAPI EnumSearches (IEnumExtraSearch **ppenum)
 
virtual HRESULT WINAPI GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
 
virtual HRESULT WINAPI GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags)
 
virtual HRESULT WINAPI GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
 
virtual HRESULT WINAPI GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
 
virtual HRESULT WINAPI MapColumnToSCID (UINT column, SHCOLUMNID *pscid)
 
virtual HRESULT WINAPI QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
virtual HRESULT WINAPI InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi)
 
virtual HRESULT WINAPI GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
 
virtual HRESULT WINAPI AddPages (LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
 
virtual HRESULT WINAPI ReplacePage (EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam)
 
virtual HRESULT STDMETHODCALLTYPE Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
 
- 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 ()
 
- 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 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)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

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
 
- 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 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
 
- Public Attributes inherited from IShellFolder
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
 
- Public Attributes inherited from IContextMenu
CMIC_MASK_NOZONECHECKS typedef IContextMenuLPCONTEXTMENU
 
- Static Public Attributes inherited from IContextMenu
static CMDSTR_VIEWDETAILSW(const WCHAR []) 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 425 of file CRecycleBin.cpp.

426 {
427  pidl = NULL;
428 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
smooth NULL
Definition: ftsmooth.c:416

◆ ~CRecycleBin()

CRecycleBin::~CRecycleBin ( )

Definition at line 430 of file CRecycleBin.cpp.

431 {
432  SHFree(pidl);
433 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

Member Function Documentation

◆ AddPages()

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

Implements IShellPropSheetExt.

Definition at line 866 of file CRecycleBin.cpp.

867 {
868  FIXME("%p %p %lu\n", this, pfnAddPage, lParam);
869 
870  return E_NOTIMPL;
871 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
LPARAM lParam
Definition: combotst.c:139

◆ BindToObject()

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

Definition at line 490 of file CRecycleBin.cpp.

491 {
492  FIXME("(%p, %p, %p, %s, %p) - stub\n", this, pidl, pbc, debugstr_guid(&riid), ppv);
493  return E_NOTIMPL;
494 }
REFIID riid
Definition: precomp.h:44
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindToStorage()

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

Definition at line 496 of file CRecycleBin.cpp.

497 {
498  FIXME("(%p, %p, %p, %s, %p) - stub\n", this, pidl, pbc, debugstr_guid(&riid), ppv);
499  return E_NOTIMPL;
500 }
REFIID riid
Definition: precomp.h:44
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CompareIDs()

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

Implements IShellFolder.

Definition at line 502 of file CRecycleBin.cpp.

503 {
504  PIDLRecycleStruct* pData1 = _ILGetRecycleStruct(pidl1);
505  PIDLRecycleStruct* pData2 = _ILGetRecycleStruct(pidl2);
506  LPWSTR pName1, pName2;
507 
508  if(!pData1 || !pData2 || LOWORD(lParam) >= COLUMNS_COUNT)
509  return E_INVALIDARG;
510 
511  SHORT result;
512  LONGLONG diff;
513  switch (LOWORD(lParam))
514  {
515  case 0: /* Name */
516  pName1 = PathFindFileNameW(pData1->szName);
517  pName2 = PathFindFileNameW(pData2->szName);
518  result = wcsicmp(pName1, pName2);
519  break;
520  case 1: /* Orig. Location */
521  result = wcsicmp(pData1->szName, pData2->szName);
522  break;
523  case 2: /* Date Deleted */
524  result = CompareFileTime(&pData1->DeletionTime, &pData2->DeletionTime);
525  break;
526  case 3: /* Size */
527  diff = pData1->FileSize.QuadPart - pData2->FileSize.QuadPart;
528  return MAKE_COMPARE_HRESULT(diff);
529  case 4: /* Type */
530  pName1 = PathFindExtensionW(pData1->szName);
531  pName2 = PathFindExtensionW(pData2->szName);
532  result = wcsicmp(pName1, pName2);
533  break;
534  case 5: /* Modified */
535  result = CompareFileTime(&pData1->LastModification, &pData2->LastModification);
536  break;
537  }
539 }
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
#define COLUMNS_COUNT
Definition: CRecycleBin.cpp:59
short SHORT
Definition: pedump.c:59
#define E_INVALIDARG
Definition: ddrawi.h:101
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:389
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
int64_t LONGLONG
Definition: typedefs.h:67
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
#define wcsicmp
Definition: string.h:1152
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ CreateViewObject()

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

Definition at line 541 of file CRecycleBin.cpp.

542 {
543  CComPtr<IShellView> pShellView;
545 
546  TRACE("(%p, %p, %s, %p)\n", this, hwndOwner, debugstr_guid(&riid), ppv);
547 
548  if (!ppv)
549  return hr;
550 
551  *ppv = NULL;
552 
553  if (IsEqualIID (riid, IID_IDropTarget))
554  {
556  }
557  else if (IsEqualIID (riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2))
558  {
559  hr = this->QueryInterface(riid, ppv);
560  }
561  else if (IsEqualIID (riid, IID_IShellView))
562  {
563  SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
564  hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppv);
565  }
566  else
567  return hr;
568 
569  TRACE ("-- (%p)->(interface=%p)\n", this, ppv);
570  return hr;
571 
572 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3594
smooth NULL
Definition: ftsmooth.c:416
struct _SFV_CREATE SFV_CREATE
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
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

◆ EnumObjects()

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

Definition at line 485 of file CRecycleBin.cpp.

486 {
487  return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
488 }
#define IID_PPV_ARG(Itype, ppType)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

Referenced by RecycleBinIsEmpty().

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 659 of file CRecycleBin.cpp.

660 {
661  FIXME("stub\n");
662  *ppEnum = NULL;
663  return E_NOTIMPL;
664 }
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetAttributesOf()

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

Definition at line 574 of file CRecycleBin.cpp.

576 {
577  TRACE("(%p, %d, {%p, ...}, {%x})\n", this, cidl, apidl ? apidl[0] : NULL, (unsigned int)*rgfInOut);
578  *rgfInOut &= SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK;
579  return S_OK;
580 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ GetClassID()

HRESULT WINAPI CRecycleBin::GetClassID ( CLSID pClassID)
virtual

Implements IPersist.

Definition at line 439 of file CRecycleBin.cpp.

440 {
441  TRACE("(%p, %p)\n", this, pClassID);
442  if (pClassID == NULL)
443  return E_INVALIDARG;
444  memcpy(pClassID, &CLSID_RecycleBin, sizeof(CLSID));
445  return S_OK;
446 }
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59

◆ GetCommandString()

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

Implements IContextMenu.

Definition at line 855 of file CRecycleBin.cpp.

856 {
857  FIXME("%p %lu %u %p %p %u\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
858 
859  return E_NOTIMPL;
860 }
UINT uFlags
Definition: api.c:59
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetCurFolder()

HRESULT WINAPI CRecycleBin::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
virtual

Implements IPersistFolder2.

Definition at line 459 of file CRecycleBin.cpp.

460 {
461  TRACE("\n");
462  *ppidl = ILClone(pidl);
463  return S_OK;
464 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

◆ GetDefaultColumn()

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

Implements IShellFolder2.

Definition at line 666 of file CRecycleBin.cpp.

667 {
668  TRACE("(%p, %x, %p, %p)\n", this, (unsigned int)dwReserved, pSort, pDisplay);
669  if (pSort)
670  *pSort = 0;
671  if (pDisplay)
672  *pDisplay = 0;
673  return S_OK;
674 }
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ GetDefaultColumnState()

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

Implements IShellFolder2.

Definition at line 676 of file CRecycleBin.cpp.

677 {
678  TRACE("(%p, %d, %p)\n", this, iColumn, pcsFlags);
679  if (iColumn >= COLUMNS_COUNT)
680  return E_INVALIDARG;
681  *pcsFlags = RecycleBinColumns[iColumn].pcsFlags;
682  return S_OK;
683 }
#define COLUMNS_COUNT
Definition: CRecycleBin.cpp:59
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
static const columninfo RecycleBinColumns[]
Definition: CRecycleBin.cpp:40
#define S_OK
Definition: intsafe.h:59

◆ GetDefaultSearchGUID()

HRESULT WINAPI CRecycleBin::GetDefaultSearchGUID ( GUID pguid)
virtual

Implements IShellFolder2.

Definition at line 653 of file CRecycleBin.cpp.

654 {
655  FIXME("stub\n");
656  return E_NOTIMPL;
657 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetDetailsEx()

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

Implements IShellFolder2.

Definition at line 685 of file CRecycleBin.cpp.

686 {
687  FIXME("stub\n");
688  return E_NOTIMPL;
689 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetDetailsOf()

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

Implements IShellFolder2.

Definition at line 711 of file CRecycleBin.cpp.

712 {
713  PIDLRecycleStruct * pFileDetails;
715  WCHAR szTypeName[100];
716  LPWSTR pszBackslash;
717  UINT Length;
718 
719  TRACE("(%p, %p, %d, %p)\n", this, pidl, iColumn, pDetails);
720  if (iColumn >= COLUMNS_COUNT)
721  return E_FAIL;
722  pDetails->fmt = RecycleBinColumns[iColumn].fmt;
723  pDetails->cxChar = RecycleBinColumns[iColumn].cxChars;
724  if (pidl == NULL)
725  return SHSetStrRet(&pDetails->str, RecycleBinColumns[iColumn].column_name_id);
726 
727  if (iColumn == COLUMN_NAME)
728  return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
729 
730  pFileDetails = _ILGetRecycleStruct(pidl);
731  switch (iColumn)
732  {
733  case COLUMN_DATEDEL:
734  FormatDateTime(buffer, MAX_PATH, &pFileDetails->DeletionTime);
735  break;
736  case COLUMN_DELFROM:
737  pszBackslash = wcsrchr(pFileDetails->szName, L'\\');
738  Length = (pszBackslash - pFileDetails->szName);
739  memcpy((LPVOID)buffer, pFileDetails->szName, Length * sizeof(WCHAR));
740  buffer[Length] = L'\0';
741  break;
742  case COLUMN_SIZE:
743  StrFormatKBSizeW(pFileDetails->FileSize.QuadPart, buffer, MAX_PATH);
744  break;
745  case COLUMN_MTIME:
746  FormatDateTime(buffer, MAX_PATH, &pFileDetails->LastModification);
747  break;
748  case COLUMN_TYPE:
749  // FIXME: We should in fact use a UNICODE version of _ILGetFileType
750  szTypeName[0] = L'\0';
751  wcscpy(buffer, PathFindExtensionW(pFileDetails->szName));
754  {
755  /* load localized file string */
756  szTypeName[0] = '\0';
758  {
759  szTypeName[63] = '\0';
761  }
762  }
763  return SHSetStrRet(&pDetails->str, szTypeName);
764  default:
765  return E_FAIL;
766  }
767 
768  return SHSetStrRet(&pDetails->str, buffer);
769 }
#define TRUE
Definition: types.h:120
#define COLUMN_MTIME
Definition: CRecycleBin.cpp:57
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
#define COLUMN_DELFROM
Definition: CRecycleBin.cpp:53
GLuint buffer
Definition: glext.h:5915
static HRESULT FormatDateTime(LPWSTR buffer, int size, FILETIME *ft)
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
#define E_FAIL
Definition: ddrawi.h:102
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define COLUMNS_COUNT
Definition: CRecycleBin.cpp:59
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
#define IDS_ANY_FILE
Definition: shresdef.h:172
smooth NULL
Definition: ftsmooth.c:416
_Reserved_ DWORD _In_ DWORD _Out_ DWORD _Out_writes_bytes_to_opt_ pcbTypeName LPSTR szTypeName
Definition: wincrypt.h:4283
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define COLUMN_NAME
Definition: CRecycleBin.cpp:52
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:26
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:46
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const columninfo RecycleBinColumns[]
Definition: CRecycleBin.cpp:40
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1743
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define COLUMN_SIZE
Definition: CRecycleBin.cpp:55
#define COLUMN_TYPE
Definition: CRecycleBin.cpp:56
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
unsigned int UINT
Definition: ndis.h:50
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
int column_name_id
Definition: CRecycleBin.cpp:32
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define COLUMN_DATEDEL
Definition: CRecycleBin.cpp:54

◆ GetDisplayNameOf()

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

Definition at line 615 of file CRecycleBin.cpp.

616 {
617  PIDLRecycleStruct *pFileDetails;
618  LPWSTR pFileName;
619 
620  TRACE("(%p, %p, %x, %p)\n", this, pidl, (unsigned int)uFlags, pName);
621 
622  pFileDetails = _ILGetRecycleStruct(pidl);
623  if (!pFileDetails)
624  {
625  pName->cStr[0] = 0;
626  pName->uType = STRRET_CSTR;
627  return E_INVALIDARG;
628  }
629 
630  pFileName = wcsrchr(pFileDetails->szName, L'\\');
631  if (!pFileName)
632  {
633  pName->cStr[0] = 0;
634  pName->uType = STRRET_CSTR;
635  return E_UNEXPECTED;
636  }
637 
638  pName->pOleStr = StrDupW(pFileName + 1);
639  if (pName->pOleStr == NULL)
640  return E_OUTOFMEMORY;
641 
642  pName->uType = STRRET_WSTR;
643  return S_OK;
644 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
UINT uFlags
Definition: api.c:59
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
#define TRACE(s)
Definition: solgame.cpp:4
static LPSTR pName
Definition: security.c:75
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
#define E_UNEXPECTED
Definition: winerror.h:2456
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by GetDetailsOf().

◆ GetUIObjectOf()

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

Definition at line 582 of file CRecycleBin.cpp.

584 {
585  LPVOID pObj = NULL;
587 
588  TRACE ("(%p)->(%p,%u,apidl=%p, %p %p)\n", this,
589  hwndOwner, cidl, apidl, prgfInOut, ppv);
590 
591  if (!ppv)
592  return hr;
593 
594  *ppv = NULL;
595 
596  if ((IsEqualIID (riid, IID_IContextMenu) || IsEqualIID(riid, IID_IContextMenu2)) && (cidl >= 1))
597  {
598  hr = ShellObjectCreatorInit<CRecycleBinItemContextMenu>(apidl[0], riid, &pObj);
599  }
600  else if((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW)) && (cidl == 1))
601  {
602  hr = CRecyclerExtractIcon_CreateInstance(apidl[0], riid, &pObj);
603  }
604  else
605  hr = E_NOINTERFACE;
606 
607  if (SUCCEEDED(hr) && !pObj)
608  hr = E_OUTOFMEMORY;
609 
610  *ppv = pObj;
611  TRACE ("(%p)->hr=0x%08x\n", this, hr);
612  return hr;
613 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT CRecyclerExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CRecycleBin.cpp:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ Initialize() [1/2]

HRESULT WINAPI CRecycleBin::Initialize ( PCIDLIST_ABSOLUTE  pidl)
virtual

Implements IPersistFolder.

Definition at line 448 of file CRecycleBin.cpp.

449 {
450  TRACE("(%p, %p)\n", this, pidl);
451 
452  SHFree((LPVOID)this->pidl);
453  this->pidl = ILClone(pidl);
454  if (this->pidl == NULL)
455  return E_OUTOFMEMORY;
456  return S_OK;
457 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

◆ Initialize() [2/2]

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

Implements IShellExtInit.

Definition at line 884 of file CRecycleBin.cpp.

885 {
886  TRACE("%p %p %p %p\n", this, pidlFolder, pdtobj, hkeyProgID );
887  return S_OK;
888 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ InvokeCommand()

HRESULT WINAPI CRecycleBin::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
virtual

Implements IContextMenu.

Definition at line 825 of file CRecycleBin.cpp.

826 {
827  HRESULT hr;
828  LPSHELLBROWSER lpSB;
829  IShellView * lpSV = NULL;
830  WCHAR szDrive[8];
831 
832  TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
833 
834  if (LOWORD(lpcmi->lpVerb) == iIdEmpty)
835  {
836  if (!GetEnvironmentVariableW(L"SystemDrive", szDrive, _countof(szDrive) - 1))
837  {
838  ERR("GetEnvironmentVariableW failed\n");
839  return E_FAIL;
840  }
841  PathAddBackslashW(szDrive);
842 
843  hr = SHEmptyRecycleBinW(lpcmi->hwnd, szDrive, 0);
844  TRACE("result %x\n", hr);
845  if (hr != S_OK)
846  return hr;
847 
848  lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER, 0, 0);
849  if (lpSB && SUCCEEDED(lpSB->QueryActiveShellView(&lpSV)))
850  lpSV->Refresh();
851  }
852  return S_OK;
853 }
HRESULT Refresh()
HRESULT hr
Definition: shlfolder.c:183
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define E_FAIL
Definition: ddrawi.h:102
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
#define CWM_GETISHELLBROWSER
Definition: undocshell.h:185
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:421
#define LOWORD(l)
Definition: pedump.c:82
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ MapColumnToSCID()

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

Implements IShellFolder2.

Definition at line 771 of file CRecycleBin.cpp.

772 {
773  TRACE("(%p, %d, %p)\n", this, iColumn, pscid);
774  if (iColumn >= COLUMNS_COUNT)
775  return E_INVALIDARG;
776  pscid->fmtid = *RecycleBinColumns[iColumn].fmtId;
777  pscid->pid = RecycleBinColumns[iColumn].pid;
778  return S_OK;
779 }
#define COLUMNS_COUNT
Definition: CRecycleBin.cpp:59
const GUID * fmtId
Definition: CRecycleBin.cpp:33
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
static const columninfo RecycleBinColumns[]
Definition: CRecycleBin.cpp:40
#define S_OK
Definition: intsafe.h:59

◆ ParseDisplayName()

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

Definition at line 470 of file CRecycleBin.cpp.

473 {
474  FIXME("stub\n");
475  return E_NOTIMPL;
476 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ QueryContextMenu()

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

Implements IContextMenu.

Definition at line 796 of file CRecycleBin.cpp.

797 {
798  WCHAR szBuffer[100];
799  MENUITEMINFOW mii;
800  int id = 1;
801 
802  TRACE("QueryContextMenu %p %p %u %u %u %u\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags );
803 
804  if (!hMenu)
805  return E_INVALIDARG;
806 
807  ZeroMemory(&mii, sizeof(mii));
808  mii.cbSize = sizeof(mii);
809  mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
811  szBuffer[0] = L'\0';
813  mii.dwTypeData = szBuffer;
814  mii.cch = wcslen(mii.dwTypeData);
815  mii.wID = idCmdFirst + id++;
816  mii.fType = MFT_STRING;
817  iIdEmpty = 1;
818 
819  if (!InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
820  return E_FAIL;
821 
822  return MAKE_HRESULT(SEVERITY_SUCCESS, 0, id);
823 }
#define MFT_STRING
Definition: winuser.h:741
#define TRUE
Definition: types.h:120
#define MFS_DISABLED
Definition: winuser.h:744
#define ZeroMemory
Definition: winbase.h:1648
LPWSTR dwTypeData
Definition: winuser.h:3244
BOOL RecycleBinIsEmpty()
UINT uFlags
Definition: api.c:59
#define E_FAIL
Definition: ddrawi.h:102
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define MFS_ENABLED
Definition: winuser.h:745
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
#define MIIM_STATE
Definition: winuser.h:716
#define E_INVALIDARG
Definition: ddrawi.h:101
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define MIIM_ID
Definition: winuser.h:717
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR L[]
Definition: oid.c:1250
#define MIIM_TYPE
Definition: winuser.h:720
#define IDS_EMPTY_BITBUCKET
Definition: shresdef.h:174
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ RecycleBinIsEmpty()

BOOL CRecycleBin::RecycleBinIsEmpty ( )
private

Definition at line 781 of file CRecycleBin.cpp.

782 {
783  CComPtr<IEnumIDList> spEnumFiles;
785  if (FAILED(hr))
786  return TRUE;
787  CComHeapPtr<ITEMIDLIST> spPidl;
788  ULONG itemcount;
789  return spEnumFiles->Next(1, &spPidl, &itemcount) != S_OK;
790  }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1

Referenced by QueryContextMenu().

◆ ReplacePage()

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

Implements IShellPropSheetExt.

Definition at line 873 of file CRecycleBin.cpp.

874 {
875  FIXME("%p %lu %p %lu\n", this, uPageID, pfnReplaceWith, lParam);
876 
877  return E_NOTIMPL;
878 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
LPARAM lParam
Definition: combotst.c:139

◆ SetNameOf()

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

Implements IShellFolder.

Definition at line 646 of file CRecycleBin.cpp.

648 {
649  TRACE("\n");
650  return E_FAIL; /* not supported */
651 }
#define E_FAIL
Definition: ddrawi.h:102
#define TRACE(s)
Definition: solgame.cpp:4

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: