ReactOS  0.4.14-dev-376-gaedba84
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
}
 
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 412 of file CRecycleBin.cpp.

413 {
414  pidl = NULL;
415 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
smooth NULL
Definition: ftsmooth.c:416

◆ ~CRecycleBin()

CRecycleBin::~CRecycleBin ( )

Definition at line 417 of file CRecycleBin.cpp.

418 {
419  SHFree(pidl);
420 }
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 847 of file CRecycleBin.cpp.

848 {
849  FIXME("%p %p %lu\n", this, pfnAddPage, lParam);
850 
851  return E_NOTIMPL;
852 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 477 of file CRecycleBin.cpp.

478 {
479  FIXME("(%p, %p, %p, %s, %p) - stub\n", this, pidl, pbc, debugstr_guid(&riid), ppv);
480  return E_NOTIMPL;
481 }
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:110
#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 483 of file CRecycleBin.cpp.

484 {
485  FIXME("(%p, %p, %p, %s, %p) - stub\n", this, pidl, pbc, debugstr_guid(&riid), ppv);
486  return E_NOTIMPL;
487 }
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:110
#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 489 of file CRecycleBin.cpp.

490 {
491  PIDLRecycleStruct* pData1 = _ILGetRecycleStruct(pidl1);
492  PIDLRecycleStruct* pData2 = _ILGetRecycleStruct(pidl2);
493  LPWSTR pName1, pName2;
494 
495  if(!pData1 || !pData2 || LOWORD(lParam) >= COLUMNS_COUNT)
496  return E_INVALIDARG;
497 
498  SHORT result;
499  LONGLONG diff;
500  switch (LOWORD(lParam))
501  {
502  case 0: /* Name */
503  pName1 = PathFindFileNameW(pData1->szName);
504  pName2 = PathFindFileNameW(pData2->szName);
505  result = wcsicmp(pName1, pName2);
506  break;
507  case 1: /* Orig. Location */
508  result = wcsicmp(pData1->szName, pData2->szName);
509  break;
510  case 2: /* Date Deleted */
511  result = CompareFileTime(&pData1->DeletionTime, &pData2->DeletionTime);
512  break;
513  case 3: /* Size */
514  diff = pData1->FileSize.QuadPart - pData2->FileSize.QuadPart;
515  return MAKE_COMPARE_HRESULT(diff);
516  case 4: /* Type */
517  pName1 = PathFindExtensionW(pData1->szName);
518  pName2 = PathFindExtensionW(pData2->szName);
519  result = wcsicmp(pName1, pName2);
520  break;
521  case 5: /* Modified */
522  result = CompareFileTime(&pData1->LastModification, &pData2->LastModification);
523  break;
524  }
526 }
#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:66
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 528 of file CRecycleBin.cpp.

529 {
530  CComPtr<IShellView> pShellView;
532 
533  TRACE("(%p, %p, %s, %p)\n", this, hwndOwner, debugstr_guid(&riid), ppv);
534 
535  if (!ppv)
536  return hr;
537 
538  *ppv = NULL;
539 
540  if (IsEqualIID (riid, IID_IDropTarget))
541  {
543  }
544  else if (IsEqualIID (riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2))
545  {
546  hr = this->QueryInterface(riid, ppv);
547  }
548  else if (IsEqualIID (riid, IID_IShellView))
549  {
550  SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
551  hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppv);
552  }
553  else
554  return hr;
555 
556  TRACE ("-- (%p)->(interface=%p)\n", this, ppv);
557  return hr;
558 
559 }
#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:3456
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:77
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 472 of file CRecycleBin.cpp.

473 {
474  return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
475 }
#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 646 of file CRecycleBin.cpp.

647 {
648  FIXME("stub\n");
649  *ppEnum = NULL;
650  return E_NOTIMPL;
651 }
#define FIXME(fmt,...)
Definition: debug.h:110
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 561 of file CRecycleBin.cpp.

563 {
564  TRACE("(%p, %d, {%p, ...}, {%x})\n", this, cidl, apidl ? apidl[0] : NULL, (unsigned int)*rgfInOut);
565  *rgfInOut &= SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK;
566  return S_OK;
567 }
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 426 of file CRecycleBin.cpp.

427 {
428  TRACE("(%p, %p)\n", this, pClassID);
429  if (pClassID == NULL)
430  return E_INVALIDARG;
431  memcpy(pClassID, &CLSID_RecycleBin, sizeof(CLSID));
432  return S_OK;
433 }
#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 836 of file CRecycleBin.cpp.

837 {
838  FIXME("%p %lu %u %p %p %u\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
839 
840  return E_NOTIMPL;
841 }
UINT uFlags
Definition: api.c:59
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetCurFolder()

HRESULT WINAPI CRecycleBin::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
virtual

Implements IPersistFolder2.

Definition at line 446 of file CRecycleBin.cpp.

447 {
448  TRACE("\n");
449  *ppidl = ILClone(pidl);
450  return S_OK;
451 }
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 653 of file CRecycleBin.cpp.

654 {
655  TRACE("(%p, %x, %p, %p)\n", this, (unsigned int)dwReserved, pSort, pDisplay);
656  if (pSort)
657  *pSort = 0;
658  if (pDisplay)
659  *pDisplay = 0;
660  return S_OK;
661 }
_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 663 of file CRecycleBin.cpp.

664 {
665  TRACE("(%p, %d, %p)\n", this, iColumn, pcsFlags);
666  if (iColumn >= COLUMNS_COUNT)
667  return E_INVALIDARG;
668  *pcsFlags = RecycleBinColumns[iColumn].pcsFlags;
669  return S_OK;
670 }
#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 640 of file CRecycleBin.cpp.

641 {
642  FIXME("stub\n");
643  return E_NOTIMPL;
644 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 672 of file CRecycleBin.cpp.

673 {
674  FIXME("stub\n");
675  return E_NOTIMPL;
676 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 698 of file CRecycleBin.cpp.

699 {
700  PIDLRecycleStruct * pFileDetails;
702  WCHAR szTypeName[100];
703  LPWSTR pszBackslash;
704  UINT Length;
705 
706  TRACE("(%p, %p, %d, %p)\n", this, pidl, iColumn, pDetails);
707  if (iColumn >= COLUMNS_COUNT)
708  return E_FAIL;
709  pDetails->fmt = RecycleBinColumns[iColumn].fmt;
710  pDetails->cxChar = RecycleBinColumns[iColumn].cxChars;
711  if (pidl == NULL)
712  return SHSetStrRet(&pDetails->str, RecycleBinColumns[iColumn].column_name_id);
713 
714  if (iColumn == COLUMN_NAME)
715  return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
716 
717  pFileDetails = _ILGetRecycleStruct(pidl);
718  switch (iColumn)
719  {
720  case COLUMN_DATEDEL:
721  FormatDateTime(buffer, MAX_PATH, &pFileDetails->DeletionTime);
722  break;
723  case COLUMN_DELFROM:
724  pszBackslash = wcsrchr(pFileDetails->szName, L'\\');
725  Length = (pszBackslash - pFileDetails->szName);
726  memcpy((LPVOID)buffer, pFileDetails->szName, Length * sizeof(WCHAR));
727  buffer[Length] = L'\0';
728  break;
729  case COLUMN_SIZE:
730  StrFormatKBSizeW(pFileDetails->FileSize.QuadPart, buffer, MAX_PATH);
731  break;
732  case COLUMN_MTIME:
733  FormatDateTime(buffer, MAX_PATH, &pFileDetails->LastModification);
734  break;
735  case COLUMN_TYPE:
736  // FIXME: We should in fact use a UNICODE version of _ILGetFileType
737  szTypeName[0] = L'\0';
738  wcscpy(buffer, PathFindExtensionW(pFileDetails->szName));
741  {
742  /* load localized file string */
743  szTypeName[0] = '\0';
745  {
746  szTypeName[63] = '\0';
748  }
749  }
750  return SHSetStrRet(&pDetails->str, szTypeName);
751  default:
752  return E_FAIL;
753  }
754 
755  return SHSetStrRet(&pDetails->str, buffer);
756 }
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
#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 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 602 of file CRecycleBin.cpp.

603 {
604  PIDLRecycleStruct *pFileDetails;
605  LPWSTR pFileName;
606 
607  TRACE("(%p, %p, %x, %p)\n", this, pidl, (unsigned int)uFlags, pName);
608 
609  pFileDetails = _ILGetRecycleStruct(pidl);
610  if (!pFileDetails)
611  {
612  pName->cStr[0] = 0;
613  pName->uType = STRRET_CSTR;
614  return E_INVALIDARG;
615  }
616 
617  pFileName = wcsrchr(pFileDetails->szName, L'\\');
618  if (!pFileName)
619  {
620  pName->cStr[0] = 0;
621  pName->uType = STRRET_CSTR;
622  return E_UNEXPECTED;
623  }
624 
625  pName->pOleStr = StrDupW(pFileName + 1);
626  if (pName->pOleStr == NULL)
627  return E_OUTOFMEMORY;
628 
629  pName->uType = STRRET_WSTR;
630  return S_OK;
631 }
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 569 of file CRecycleBin.cpp.

571 {
572  LPVOID pObj = NULL;
574 
575  TRACE ("(%p)->(%p,%u,apidl=%p, %p %p)\n", this,
576  hwndOwner, cidl, apidl, prgfInOut, ppv);
577 
578  if (!ppv)
579  return hr;
580 
581  *ppv = NULL;
582 
583  if ((IsEqualIID (riid, IID_IContextMenu) || IsEqualIID(riid, IID_IContextMenu2)) && (cidl >= 1))
584  {
585  hr = ShellObjectCreatorInit<CRecycleBinItemContextMenu>(apidl[0], riid, &pObj);
586  }
587  else if((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW)) && (cidl == 1))
588  {
589  hr = CRecyclerExtractIcon_CreateInstance(apidl[0], riid, &pObj);
590  }
591  else
592  hr = E_NOINTERFACE;
593 
594  if (SUCCEEDED(hr) && !pObj)
595  hr = E_OUTOFMEMORY;
596 
597  *ppv = pObj;
598  TRACE ("(%p)->hr=0x%08x\n", this, hr);
599  return hr;
600 }
#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:77
#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 435 of file CRecycleBin.cpp.

436 {
437  TRACE("(%p, %p)\n", this, pidl);
438 
439  SHFree((LPVOID)this->pidl);
440  this->pidl = ILClone(pidl);
441  if (this->pidl == NULL)
442  return E_OUTOFMEMORY;
443  return S_OK;
444 }
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 865 of file CRecycleBin.cpp.

866 {
867  TRACE("%p %p %p %p\n", this, pidlFolder, pdtobj, hkeyProgID );
868  return S_OK;
869 }
#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 812 of file CRecycleBin.cpp.

813 {
814  HRESULT hr;
815  LPSHELLBROWSER lpSB;
816  IShellView * lpSV = NULL;
817 
818  TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
819 
820  if (LOWORD(lpcmi->lpVerb) == iIdEmpty)
821  {
822  // FIXME
823  // path & flags
824  hr = SHEmptyRecycleBinW(lpcmi->hwnd, L"C:\\", 0);
825  TRACE("result %x\n", hr);
826  if (hr != S_OK)
827  return hr;
828 
829  lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER, 0, 0);
830  if (lpSB && SUCCEEDED(lpSB->QueryActiveShellView(&lpSV)))
831  lpSV->Refresh();
832  }
833  return S_OK;
834 }
HRESULT Refresh()
HRESULT hr
Definition: shlfolder.c:183
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
#define CWM_GETISHELLBROWSER
Definition: undocshell.h:185
#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 758 of file CRecycleBin.cpp.

759 {
760  TRACE("(%p, %d, %p)\n", this, iColumn, pscid);
761  if (iColumn >= COLUMNS_COUNT)
762  return E_INVALIDARG;
763  pscid->fmtid = *RecycleBinColumns[iColumn].fmtId;
764  pscid->pid = RecycleBinColumns[iColumn].pid;
765  return S_OK;
766 }
#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 457 of file CRecycleBin.cpp.

460 {
461  FIXME("stub\n");
462  return E_NOTIMPL;
463 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 783 of file CRecycleBin.cpp.

784 {
785  WCHAR szBuffer[100];
786  MENUITEMINFOW mii;
787  int id = 1;
788 
789  TRACE("QueryContextMenu %p %p %u %u %u %u\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags );
790 
791  if (!hMenu)
792  return E_INVALIDARG;
793 
794  ZeroMemory(&mii, sizeof(mii));
795  mii.cbSize = sizeof(mii);
796  mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
798  szBuffer[0] = L'\0';
800  mii.dwTypeData = szBuffer;
801  mii.cch = wcslen(mii.dwTypeData);
802  mii.wID = idCmdFirst + id++;
803  mii.fType = MFT_STRING;
804  iIdEmpty = 1;
805 
806  if (!InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
807  return E_FAIL;
808 
809  return MAKE_HRESULT(SEVERITY_SUCCESS, 0, id);
810 }
#define MFT_STRING
Definition: winuser.h:741
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
#define MFS_DISABLED
Definition: winuser.h:744
#define ZeroMemory
Definition: winbase.h:1642
LPWSTR dwTypeData
Definition: winuser.h:3243
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
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 768 of file CRecycleBin.cpp.

769 {
770  CComPtr<IEnumIDList> spEnumFiles;
772  if (FAILED(hr))
773  return TRUE;
774  CComHeapPtr<ITEMIDLIST> spPidl;
775  ULONG itemcount;
776  return spEnumFiles->Next(1, &spPidl, &itemcount) != S_OK;
777  }
#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:77
#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 854 of file CRecycleBin.cpp.

855 {
856  FIXME("%p %lu %p %lu\n", this, uPageID, pfnReplaceWith, lParam);
857 
858  return E_NOTIMPL;
859 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 633 of file CRecycleBin.cpp.

635 {
636  TRACE("\n");
637  return E_FAIL; /* not supported */
638 }
#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: