ReactOS 0.4.16-dev-338-g34e76ad
recyclebin_v5_enumerator.cpp File Reference
#include "recyclebin_private.h"
#include <atlstr.h>
#include <shlwapi.h>
#include <strsafe.h>
Include dependency graph for recyclebin_v5_enumerator.cpp:

Go to the source code of this file.

Classes

class  RecycleBin5File
 
class  RecycleBin5Enum
 

Functions

 STDMETHODIMP_ (ULONG) RecycleBin5File
 
static HRESULT RecycleBin5File_Constructor (_In_ IRecycleBin5 *prb, _In_ LPCWSTR Folder, _In_ PDELETED_FILE_RECORD pDeletedFile, _Out_ IRecycleBinFile **ppFile)
 
EXTERN_C HRESULT RecycleBin5Enum_Constructor (_In_ IRecycleBin5 *prb, _In_ HANDLE hInfo, _In_ HANDLE hInfoMapped, _In_ LPCWSTR szPrefix, _Out_ IUnknown **ppUnknown)
 

Function Documentation

◆ RecycleBin5Enum_Constructor()

EXTERN_C HRESULT RecycleBin5Enum_Constructor ( _In_ IRecycleBin5 prb,
_In_ HANDLE  hInfo,
_In_ HANDLE  hInfoMapped,
_In_ LPCWSTR  szPrefix,
_Out_ IUnknown **  ppUnknown 
)

Definition at line 468 of file recyclebin_v5_enumerator.cpp.

474{
475 if (!ppUnknown)
476 return E_POINTER;
477
478 *ppUnknown = NULL;
479
480 RecycleBin5Enum *pThis = new RecycleBin5Enum();
481 if (!pThis)
482 return E_OUTOFMEMORY;
483
484 HRESULT hr = pThis->Init(prb, hInfo, hInfoMapped, szPrefix);
485 if (FAILED(hr))
486 {
487 delete pThis;
488 return hr;
489 }
490
491 *ppUnknown = static_cast<IRecycleBinEnumList *>(pThis);
492 return S_OK;
493}
HRESULT Init(_In_ IRecycleBin5 *prb, _In_ HANDLE hInfo, _In_ HANDLE hInfoMapped, _In_ LPCWSTR pszPrefix)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
#define E_POINTER
Definition: winerror.h:2365

Referenced by RecycleBin5::EnumObjects().

◆ RecycleBin5File_Constructor()

static HRESULT RecycleBin5File_Constructor ( _In_ IRecycleBin5 prb,
_In_ LPCWSTR  Folder,
_In_ PDELETED_FILE_RECORD  pDeletedFile,
_Out_ IRecycleBinFile **  ppFile 
)
static

Definition at line 277 of file recyclebin_v5_enumerator.cpp.

282{
283 if (!ppFile)
284 return E_POINTER;
285
286 *ppFile = NULL;
287
288 RecycleBin5File *pThis = new RecycleBin5File();
289 if (!pThis)
290 return E_OUTOFMEMORY;
291
292 HRESULT hr = pThis->Init(prb, Folder, pDeletedFile);
293 if (FAILED(hr))
294 {
295 delete pThis;
296 return hr;
297 }
298
299 *ppFile = static_cast<IRecycleBinFile *>(pThis);
300 return S_OK;
301}
HRESULT Init(_In_ IRecycleBin5 *prb, _In_ LPCWSTR Folder, _In_ PDELETED_FILE_RECORD pDeletedFile)

Referenced by RecycleBin5Enum::Next().

◆ STDMETHODIMP_()

STDMETHODIMP_ ( ULONG  )

Definition at line 75 of file recyclebin_v5_enumerator.cpp.

76{
77 TRACE("(%p)\n", this);
78 return InterlockedIncrement(&m_ref);
79}
#define InterlockedIncrement
Definition: armddk.h:53
#define TRACE(s)
Definition: solgame.cpp:4