ReactOS  0.4.15-dev-4570-g4f8bbd1
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_PKEYSFGAOMASK 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 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 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326

Member Function Documentation

◆ AddPages()

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

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: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 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: 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 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 }
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 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 
542  SHORT result;
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 }
GLuint64EXT * result
Definition: glext.h:11304
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:546
#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:394
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
int64_t LONGLONG
Definition: typedefs.h:68
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
#define wcsicmp
Definition: compat.h:15
WCHAR * LPWSTR
Definition: xmlstorage.h:184
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 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 }
#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:3900
struct _SFV_CREATE SFV_CREATE
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
HRESULT CRecyclerDropTarget_CreateInstance(REFIID riid, LPVOID *ppvOut)
#define NULL
Definition: types.h:112
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 516 of file CRecycleBin.cpp.

517 {
518  return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
519 }
#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 690 of file CRecycleBin.cpp.

691 {
692  FIXME("stub\n");
693  *ppEnum = NULL;
694  return E_NOTIMPL;
695 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112

◆ GetAttributesOf()

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

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 TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112

◆ GetClassID()

HRESULT WINAPI CRecycleBin::GetClassID ( CLSID pClassID)
virtual

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 E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112

◆ GetCommandString()

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

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
#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 490 of file CRecycleBin.cpp.

491 {
492  TRACE("\n");
493  *ppidl = ILClone(pidl);
494  return S_OK;
495 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:52
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 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:90
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:52

◆ GetDefaultColumnState()

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

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 }
#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:52

◆ GetDefaultSearchGUID()

HRESULT WINAPI CRecycleBin::GetDefaultSearchGUID ( GUID pguid)
virtual

Implements IShellFolder2.

Definition at line 684 of file CRecycleBin.cpp.

685 {
686  FIXME("stub\n");
687  return E_NOTIMPL;
688 }
#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 716 of file CRecycleBin.cpp.

717 {
718  FIXME("stub\n");
719  return E_NOTIMPL;
720 }
#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 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 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#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
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define IDS_ANY_FILE
Definition: shresdef.h:180
_Reserved_ DWORD _In_ DWORD _Out_ DWORD _Out_writes_bytes_to_opt_ pcbTypeName LPSTR szTypeName
Definition: wincrypt.h:4283
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
BOOL WINAPI CloseRecycleBinHandle(IN HANDLE hDeletedFile)
Definition: recyclebin.c:12
#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
BOOL WINAPI CBSearchRecycleBin(IN PVOID Context, IN HANDLE hDeletedFile)
#define MAX_PATH
Definition: compat.h:34
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
BOOL WINAPI GetDeletedFileTypeNameW(IN HANDLE hDeletedFile, OUT LPWSTR pTypeName, IN DWORD BufferSize, OUT LPDWORD RequiredSize OPTIONAL)
Definition: recyclebin.c:256
static const columninfo RecycleBinColumns[]
Definition: CRecycleBin.cpp:40
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1743
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define wcsrchr
Definition: compat.h:16
BOOL WINAPI EnumerateRecycleBinW(IN LPCWSTR pszRoot OPTIONAL, IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback, IN PVOID Context OPTIONAL)
Definition: recyclebin.c:205
#define COLUMN_SIZE
Definition: CRecycleBin.cpp:55
#define COLUMN_TYPE
Definition: CRecycleBin.cpp:56
#define shell32_hInstance
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
struct tagContext Context
Definition: acpixf.h:1034
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 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 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
UINT uFlags
Definition: api.c:59
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#define L(x)
Definition: ntvdm.h:50
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
static LPSTR pName
Definition: security.c:75
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
#define wcsrchr
Definition: compat.h:16
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define E_UNEXPECTED
Definition: winerror.h:2456
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 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
636  hr = E_NOINTERFACE;
637 
638  if (SUCCEEDED(hr) && !pObj)
639  hr = E_OUTOFMEMORY;
640 
641  *ppv = pObj;
642  TRACE ("(%p)->hr=0x%08x\n", this, hr);
643  return hr;
644 }
#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:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
if SUCCEEDED(hr)
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define NULL
Definition: types.h:112
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ Initialize() [1/2]

HRESULT WINAPI CRecycleBin::Initialize ( PCIDLIST_ABSOLUTE  pidl)
virtual

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 }
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:52
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define NULL
Definition: types.h:112
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326

◆ Initialize() [2/2]

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

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 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:52

◆ InvokeCommand()

HRESULT WINAPI CRecycleBin::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
virtual

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 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
#define L(x)
Definition: ntvdm.h:50
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:294
if SUCCEEDED(hr)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:52
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
#define CWM_GETISHELLBROWSER
Definition: undocshell.h:201
#define NULL
Definition: types.h:112
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:614
#define LOWORD(l)
Definition: pedump.c:82

◆ MapColumnToSCID()

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

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 }
#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:52

◆ ParseDisplayName()

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

Definition at line 501 of file CRecycleBin.cpp.

504 {
505  FIXME("stub\n");
506  return E_NOTIMPL;
507 }
#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 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);
845  mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
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 }
#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:1667
LPWSTR dwTypeData
Definition: winuser.h:3249
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 L(x)
Definition: ntvdm.h:50
#define MFS_ENABLED
Definition: winuser.h:745
#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
#define MIIM_TYPE
Definition: winuser.h:720
#define IDS_EMPTY_BITBUCKET
Definition: shresdef.h:182
#define shell32_hInstance
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ 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  }
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
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 909 of file CRecycleBin.cpp.

910 {
911  FIXME("%p %lu %p %lu\n", this, uPageID, pfnReplaceWith, lParam);
912 
913  return E_NOTIMPL;
914 }
#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 677 of file CRecycleBin.cpp.

679 {
680  TRACE("\n");
681  return E_FAIL; /* not supported */
682 }
#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: