ReactOS  0.4.14-dev-317-g96040ec
recyclebin_v5_enumerator.c File Reference
Include dependency graph for recyclebin_v5_enumerator.c:

Go to the source code of this file.

Classes

struct  RecycleBin5File
 
struct  RecycleBin5Enum
 

Functions

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_QueryInterface (IN IRecycleBinFile *This, IN REFIID riid, OUT void **ppvObject)
 
static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_AddRef (IN IRecycleBinFile *This)
 
static VOID RecycleBin5File_Destructor (struct RecycleBin5File *s)
 
static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Release (IN IRecycleBinFile *This)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetLastModificationTime (IN IRecycleBinFile *This, OUT FILETIME *pLastModificationTime)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetDeletionTime (IN IRecycleBinFile *This, OUT FILETIME *pDeletionTime)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileSize (IN IRecycleBinFile *This, OUT ULARGE_INTEGER *pFileSize)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetPhysicalFileSize (IN IRecycleBinFile *This, OUT ULARGE_INTEGER *pPhysicalFileSize)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetAttributes (IN IRecycleBinFile *This, OUT DWORD *pAttributes)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileName (IN IRecycleBinFile *This, IN SIZE_T BufferSize, IN OUT LPWSTR Buffer, OUT SIZE_T *RequiredSize)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Delete (IN IRecycleBinFile *This)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Restore (IN IRecycleBinFile *This)
 
static HRESULT RecycleBin5File_Constructor (IN IRecycleBin5 *prb, IN LPCWSTR Folder, IN PDELETED_FILE_RECORD pDeletedFile, OUT IRecycleBinFile **ppFile)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_QueryInterface (IN IRecycleBinEnumList *This, IN REFIID riid, OUT void **ppvObject)
 
static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_AddRef (IN IRecycleBinEnumList *This)
 
static VOID RecycleBin5Enum_Destructor (struct RecycleBin5Enum *s)
 
static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Release (IN IRecycleBinEnumList *This)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Next (IRecycleBinEnumList *This, IN DWORD celt, IN OUT IRecycleBinFile **rgelt, OUT DWORD *pceltFetched)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Skip (IN IRecycleBinEnumList *This, IN DWORD celt)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Reset (IN IRecycleBinEnumList *This)
 
HRESULT RecycleBin5Enum_Constructor (IN IRecycleBin5 *prb, IN HANDLE hInfo, IN HANDLE hInfoMapped, IN LPCWSTR szPrefix, OUT IUnknown **ppUnknown)
 

Variables

CONST_VTBL struct IRecycleBinFileVtbl RecycleBin5FileVtbl
 
CONST_VTBL struct IRecycleBinEnumListVtbl RecycleBin5EnumVtbl
 

Function Documentation

◆ RecycleBin5Enum_Constructor()

HRESULT RecycleBin5Enum_Constructor ( IN IRecycleBin5 prb,
IN HANDLE  hInfo,
IN HANDLE  hInfoMapped,
IN LPCWSTR  szPrefix,
OUT IUnknown **  ppUnknown 
)

Definition at line 443 of file recyclebin_v5_enumerator.c.

449 {
450  struct RecycleBin5Enum *s = NULL;
451  SIZE_T Needed;
452 
453  if (!ppUnknown)
454  return E_POINTER;
455 
456  Needed = (wcslen(szPrefix) + 1) * sizeof(WCHAR);
457 
458  s = CoTaskMemAlloc(sizeof(struct RecycleBin5Enum) + Needed);
459  if (!s)
460  return E_OUTOFMEMORY;
461  ZeroMemory(s, sizeof(struct RecycleBin5Enum) + Needed);
462  s->recycleBinEnumImpl.lpVtbl = &RecycleBin5EnumVtbl;
463  s->ref = 1;
464  s->recycleBin = prb;
465  wcscpy(s->szPrefix, szPrefix);
466  s->hInfo = hInfo;
467  s->pInfo = MapViewOfFile(hInfoMapped, FILE_MAP_READ, 0, 0, 0);
468  if (!s->pInfo)
469  {
470  CoTaskMemFree(s);
472  }
473  if (s->pInfo->dwVersion != 5 || s->pInfo->dwRecordSize != sizeof(DELETED_FILE_RECORD))
474  {
475  UnmapViewOfFile(s->pInfo);
476  CoTaskMemFree(s);
477  return E_FAIL;
478  }
479  IRecycleBin5_AddRef(s->recycleBin);
480  *ppUnknown = (IUnknown *)&s->recycleBinEnumImpl;
481 
482  return S_OK;
483 }
CONST_VTBL struct IRecycleBinEnumListVtbl RecycleBin5EnumVtbl
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define MapViewOfFile
Definition: compat.h:402
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1642
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:427
__wchar_t WCHAR
Definition: xmlstorage.h:180
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
GLdouble s
Definition: gl.h:2039
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define UnmapViewOfFile
Definition: compat.h:403
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by RecycleBin5_RecycleBin5_EnumObjects().

◆ RecycleBin5Enum_Destructor()

static VOID RecycleBin5Enum_Destructor ( struct RecycleBin5Enum s)
static

Definition at line 337 of file recyclebin_v5_enumerator.c.

339 {
340  TRACE("(%p)\n", s);
341 
342  IRecycleBin5_OnClosing(s->recycleBin, &s->recycleBinEnumImpl);
343  UnmapViewOfFile(s->pInfo);
344  IRecycleBin5_Release(s->recycleBin);
345  CoTaskMemFree(s);
346 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
#define UnmapViewOfFile
Definition: compat.h:403

Referenced by RecycleBin5Enum_RecycleBinEnumList_Release().

◆ RecycleBin5Enum_RecycleBinEnumList_AddRef()

static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_AddRef ( IN IRecycleBinEnumList *  This)
static

Definition at line 327 of file recyclebin_v5_enumerator.c.

329 {
331  ULONG refCount = InterlockedIncrement((PLONG)&s->ref);
332  TRACE("(%p)\n", This);
333  return refCount;
334 }
IRecycleBinEnumList recycleBinEnumImpl
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5

◆ RecycleBin5Enum_RecycleBinEnumList_Next()

static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Next ( IRecycleBinEnumList *  This,
IN DWORD  celt,
IN OUT IRecycleBinFile **  rgelt,
OUT DWORD pceltFetched 
)
static

Definition at line 366 of file recyclebin_v5_enumerator.c.

371 {
374  INFO2_HEADER *pHeader = s->pInfo;
375  DELETED_FILE_RECORD *pDeletedFile;
376  DWORD fetched = 0, i;
377  DWORD dwEntries;
378  HRESULT hr;
379 
380  TRACE("(%p, %u, %p, %p)\n", This, celt, rgelt, pceltFetched);
381 
382  if (!rgelt)
383  return E_POINTER;
384  if (!pceltFetched && celt > 1)
385  return E_INVALIDARG;
386 
387  FileSize.u.LowPart = GetFileSize(s->hInfo, &FileSize.u.HighPart);
388  if (FileSize.u.LowPart == 0)
390  dwEntries = (DWORD)((FileSize.QuadPart - sizeof(INFO2_HEADER)) / sizeof(DELETED_FILE_RECORD));
391 
392  i = s->dwCurrent;
393  pDeletedFile = (DELETED_FILE_RECORD *)(pHeader + 1) + i;
394  for (; i < dwEntries && fetched < celt; i++)
395  {
396  hr = RecycleBin5File_Constructor(s->recycleBin, s->szPrefix, pDeletedFile, &rgelt[fetched]);
397  if (SUCCEEDED(hr))
398  fetched++;
399  pDeletedFile++;
400  }
401 
402  s->dwCurrent = i;
403  if (pceltFetched)
404  *pceltFetched = fetched;
405  if (fetched == celt)
406  return S_OK;
407  else
408  return S_FALSE;
409 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define DWORD
Definition: nt_native.h:44
IRecycleBinEnumList recycleBinEnumImpl
struct _DELETED_FILE_RECORD DELETED_FILE_RECORD
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static HRESULT RecycleBin5File_Constructor(IN IRecycleBin5 *prb, IN LPCWSTR Folder, IN PDELETED_FILE_RECORD pDeletedFile, OUT IRecycleBinFile **ppFile)
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
struct _LARGE_INTEGER::@2221 u
#define SUCCEEDED(hr)
Definition: intsafe.h:57
LONGLONG QuadPart
Definition: typedefs.h:112

◆ RecycleBin5Enum_RecycleBinEnumList_QueryInterface()

static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_QueryInterface ( IN IRecycleBinEnumList *  This,
IN REFIID  riid,
OUT void **  ppvObject 
)
static

Definition at line 300 of file recyclebin_v5_enumerator.c.

304 {
306 
307  TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
308 
309  if (!ppvObject)
310  return E_POINTER;
311 
313  *ppvObject = &s->recycleBinEnumImpl;
315  *ppvObject = &s->recycleBinEnumImpl;
316  else
317  {
318  *ppvObject = NULL;
319  return E_NOINTERFACE;
320  }
321 
322  IUnknown_AddRef(This);
323  return S_OK;
324 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
EXTERN_C const IID IID_IRecycleBinEnumList
Definition: recyclebin.h:248
IRecycleBinEnumList recycleBinEnumImpl
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
GLdouble s
Definition: gl.h:2039
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ RecycleBin5Enum_RecycleBinEnumList_Release()

static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Release ( IN IRecycleBinEnumList *  This)
static

Definition at line 349 of file recyclebin_v5_enumerator.c.

351 {
353  ULONG refCount;
354 
355  TRACE("(%p)\n", This);
356 
357  refCount = InterlockedDecrement((PLONG)&s->ref);
358 
359  if (refCount == 0)
361 
362  return refCount;
363 }
IRecycleBinEnumList recycleBinEnumImpl
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
GLdouble s
Definition: gl.h:2039
static VOID RecycleBin5Enum_Destructor(struct RecycleBin5Enum *s)
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5

◆ RecycleBin5Enum_RecycleBinEnumList_Reset()

static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Reset ( IN IRecycleBinEnumList *  This)
static

Definition at line 423 of file recyclebin_v5_enumerator.c.

425 {
427  TRACE("(%p)\n", This);
428  s->dwCurrent = 0;
429  return S_OK;
430 }
IRecycleBinEnumList recycleBinEnumImpl
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59

◆ RecycleBin5Enum_RecycleBinEnumList_Skip()

static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Skip ( IN IRecycleBinEnumList *  This,
IN DWORD  celt 
)
static

Definition at line 412 of file recyclebin_v5_enumerator.c.

415 {
417  TRACE("(%p, %u)\n", This, celt);
418  s->dwCurrent += celt;
419  return S_OK;
420 }
IRecycleBinEnumList recycleBinEnumImpl
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59

◆ RecycleBin5File_Constructor()

static HRESULT RecycleBin5File_Constructor ( IN IRecycleBin5 prb,
IN LPCWSTR  Folder,
IN PDELETED_FILE_RECORD  pDeletedFile,
OUT IRecycleBinFile **  ppFile 
)
static

Definition at line 247 of file recyclebin_v5_enumerator.c.

252 {
253  struct RecycleBin5File *s = NULL;
255  SIZE_T Needed;
256 
257  if (!ppFile)
258  return E_POINTER;
259 
260  Extension = wcsrchr(pDeletedFile->FileNameW, '.');
261  if (Extension < wcsrchr(pDeletedFile->FileNameW, '\\'))
262  Extension = NULL;
263  Needed = wcslen(Folder) + 13;
264  if (Extension)
265  Needed += wcslen(Extension);
266  Needed *= sizeof(WCHAR);
267 
268  s = CoTaskMemAlloc(sizeof(struct RecycleBin5File) + Needed);
269  if (!s)
270  return E_OUTOFMEMORY;
271  ZeroMemory(s, sizeof(struct RecycleBin5File) + Needed);
272  s->recycleBinFileImpl.lpVtbl = &RecycleBin5FileVtbl;
273  s->ref = 1;
274  s->deletedFile = *pDeletedFile;
275  s->recycleBin = prb;
276  IRecycleBin5_AddRef(s->recycleBin);
277  *ppFile = &s->recycleBinFileImpl;
278  wsprintfW(s->FullName, L"%s\\D%c%lu%s", Folder, pDeletedFile->dwDriveNumber + 'a', pDeletedFile->dwRecordUniqueId, Extension);
279  if (GetFileAttributesW(s->FullName) == INVALID_FILE_ATTRIBUTES)
280  {
282  return E_FAIL;
283  }
284 
285  return S_OK;
286 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ZeroMemory
Definition: winbase.h:1642
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
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)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR L[]
Definition: oid.c:1250
GLdouble s
Definition: gl.h:2039
static VOID RecycleBin5File_Destructor(struct RecycleBin5File *s)
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
CONST_VTBL struct IRecycleBinFileVtbl RecycleBin5FileVtbl
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by RecycleBin5Enum_RecycleBinEnumList_Next().

◆ RecycleBin5File_Destructor()

static VOID RecycleBin5File_Destructor ( struct RecycleBin5File s)
static

Definition at line 58 of file recyclebin_v5_enumerator.c.

60 {
61  TRACE("(%p)\n", s);
62 
63  IRecycleBin5_Release(s->recycleBin);
65 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039

Referenced by RecycleBin5File_Constructor(), and RecycleBin5File_RecycleBinFile_Release().

◆ RecycleBin5File_RecycleBinFile_AddRef()

static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_AddRef ( IN IRecycleBinFile *  This)
static

Definition at line 48 of file recyclebin_v5_enumerator.c.

50 {
52  ULONG refCount = InterlockedIncrement((PLONG)&s->ref);
53  TRACE("(%p)\n", This);
54  return refCount;
55 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5

◆ RecycleBin5File_RecycleBinFile_Delete()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Delete ( IN IRecycleBinFile *  This)
static

Definition at line 214 of file recyclebin_v5_enumerator.c.

216 {
218  TRACE("(%p)\n", This);
219  return IRecycleBin5_Delete(s->recycleBin, s->FullName, &s->deletedFile);
220 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039

◆ RecycleBin5File_RecycleBinFile_GetAttributes()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetAttributes ( IN IRecycleBinFile *  This,
OUT DWORD pAttributes 
)
static

Definition at line 171 of file recyclebin_v5_enumerator.c.

174 {
177 
178  TRACE("(%p, %p)\n", This, pAttributes);
179 
180  dwAttributes = GetFileAttributesW(s->FullName);
183 
184  *pAttributes = dwAttributes;
185  return S_OK;
186 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD dwAttributes
Definition: vdmdbg.h:34
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59

◆ RecycleBin5File_RecycleBinFile_GetDeletionTime()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetDeletionTime ( IN IRecycleBinFile *  This,
OUT FILETIME pDeletionTime 
)
static

Definition at line 115 of file recyclebin_v5_enumerator.c.

118 {
120  TRACE("(%p, %p)\n", This, pDeletionTime);
121  *pDeletionTime = s->deletedFile.DeletionTime;
122  return S_OK;
123 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59

◆ RecycleBin5File_RecycleBinFile_GetFileName()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileName ( IN IRecycleBinFile *  This,
IN SIZE_T  BufferSize,
IN OUT LPWSTR  Buffer,
OUT SIZE_T RequiredSize 
)
static

Definition at line 189 of file recyclebin_v5_enumerator.c.

194 {
196  DWORD dwRequired;
197 
198  TRACE("(%p, %u, %p, %p)\n", This, BufferSize, Buffer, RequiredSize);
199 
200  dwRequired = (DWORD)(wcslen(s->deletedFile.FileNameW) + 1) * sizeof(WCHAR);
201  if (RequiredSize)
202  *RequiredSize = dwRequired;
203 
204  if (BufferSize == 0 && !Buffer)
205  return S_OK;
206 
207  if (BufferSize < dwRequired)
208  return E_OUTOFMEMORY;
209  CopyMemory(Buffer, s->deletedFile.FileNameW, dwRequired);
210  return S_OK;
211 }
#define DWORD
Definition: nt_native.h:44
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: bufpool.h:45
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1640
#define BufferSize
Definition: classpnp.h:419
unsigned long DWORD
Definition: ntddk_ex.h:95
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ RecycleBin5File_RecycleBinFile_GetFileSize()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileSize ( IN IRecycleBinFile *  This,
OUT ULARGE_INTEGER pFileSize 
)
static

Definition at line 126 of file recyclebin_v5_enumerator.c.

129 {
131  HRESULT hr;
133  HANDLE hFile;
134 
135  TRACE("(%p, %p)\n", This, pFileSize);
136 
137  dwAttributes = GetFileAttributesW(s->FullName);
141  {
142  pFileSize->QuadPart = 0;
143  return S_OK;
144  }
145 
149  pFileSize->u.LowPart = GetFileSize(hFile, &pFileSize->u.HighPart);
150  if (pFileSize->u.LowPart != INVALID_FILE_SIZE)
151  hr = S_OK;
152  else
155  return hr;
156 }
#define CloseHandle
Definition: compat.h:398
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define INVALID_FILE_SIZE
Definition: winbase.h:529
DWORD dwAttributes
Definition: vdmdbg.h:34
#define FILE_SHARE_READ
Definition: compat.h:125
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:426
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define S_OK
Definition: intsafe.h:59
#define CreateFileW
Definition: compat.h:400

◆ RecycleBin5File_RecycleBinFile_GetLastModificationTime()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetLastModificationTime ( IN IRecycleBinFile *  This,
OUT FILETIME pLastModificationTime 
)
static

Definition at line 85 of file recyclebin_v5_enumerator.c.

88 {
90  HRESULT hr;
92  HANDLE hFile;
93 
94  TRACE("(%p, %p)\n", This, pLastModificationTime);
95 
96  dwAttributes = GetFileAttributesW(s->FullName);
101  else
105 
106  if (GetFileTime(hFile, NULL, NULL, pLastModificationTime))
107  hr = S_OK;
108  else
111  return hr;
112 }
#define CloseHandle
Definition: compat.h:398
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
DWORD dwAttributes
Definition: vdmdbg.h:34
#define FILE_SHARE_READ
Definition: compat.h:125
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:426
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
IRecycleBinFile recycleBinFileImpl
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
GLdouble s
Definition: gl.h:2039
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define S_OK
Definition: intsafe.h:59
#define CreateFileW
Definition: compat.h:400
#define FILE_FLAG_BACKUP_SEMANTICS
Definition: disk.h:41
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:1046

◆ RecycleBin5File_RecycleBinFile_GetPhysicalFileSize()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetPhysicalFileSize ( IN IRecycleBinFile *  This,
OUT ULARGE_INTEGER pPhysicalFileSize 
)
static

Definition at line 159 of file recyclebin_v5_enumerator.c.

162 {
164  TRACE("(%p, %p)\n", This, pPhysicalFileSize);
165  pPhysicalFileSize->u.HighPart = 0;
166  pPhysicalFileSize->u.LowPart = s->deletedFile.dwPhysicalFileSize;
167  return S_OK;
168 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
#define S_OK
Definition: intsafe.h:59

◆ RecycleBin5File_RecycleBinFile_QueryInterface()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_QueryInterface ( IN IRecycleBinFile *  This,
IN REFIID  riid,
OUT void **  ppvObject 
)
static

Definition at line 21 of file recyclebin_v5_enumerator.c.

25 {
27 
28  TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
29 
30  if (!ppvObject)
31  return E_POINTER;
32 
34  *ppvObject = &s->recycleBinFileImpl;
36  *ppvObject = &s->recycleBinFileImpl;
37  else
38  {
39  *ppvObject = NULL;
40  return E_NOINTERFACE;
41  }
42 
43  IUnknown_AddRef(This);
44  return S_OK;
45 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
EXTERN_C const IID IID_IRecycleBinFile
Definition: recyclebin.h:245
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ RecycleBin5File_RecycleBinFile_Release()

static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Release ( IN IRecycleBinFile *  This)
static

Definition at line 68 of file recyclebin_v5_enumerator.c.

70 {
72  ULONG refCount;
73 
74  TRACE("(%p)\n", This);
75 
76  refCount = InterlockedDecrement((PLONG)&s->ref);
77 
78  if (refCount == 0)
80 
81  return refCount;
82 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
IRecycleBinFile recycleBinFileImpl
#define InterlockedDecrement
Definition: armddk.h:52
GLdouble s
Definition: gl.h:2039
static VOID RecycleBin5File_Destructor(struct RecycleBin5File *s)
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5

◆ RecycleBin5File_RecycleBinFile_Restore()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Restore ( IN IRecycleBinFile *  This)
static

Definition at line 223 of file recyclebin_v5_enumerator.c.

225 {
227  TRACE("(%p)\n", This);
228  return IRecycleBin5_Restore(s->recycleBin, s->FullName, &s->deletedFile);
229 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
IRecycleBinFile recycleBinFileImpl
GLdouble s
Definition: gl.h:2039

Variable Documentation

◆ RecycleBin5EnumVtbl

CONST_VTBL struct IRecycleBinEnumListVtbl RecycleBin5EnumVtbl
Initial value:
=
{
}
static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_AddRef(IN IRecycleBinEnumList *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Reset(IN IRecycleBinEnumList *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Next(IRecycleBinEnumList *This, IN DWORD celt, IN OUT IRecycleBinFile **rgelt, OUT DWORD *pceltFetched)
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Skip(IN IRecycleBinEnumList *This, IN DWORD celt)
static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Release(IN IRecycleBinEnumList *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_QueryInterface(IN IRecycleBinEnumList *This, IN REFIID riid, OUT void **ppvObject)

Definition at line 432 of file recyclebin_v5_enumerator.c.

Referenced by RecycleBin5Enum_Constructor().

◆ RecycleBin5FileVtbl

CONST_VTBL struct IRecycleBinFileVtbl RecycleBin5FileVtbl
Initial value:
=
{
}
static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Release(IN IRecycleBinFile *This)
static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_AddRef(IN IRecycleBinFile *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetPhysicalFileSize(IN IRecycleBinFile *This, OUT ULARGE_INTEGER *pPhysicalFileSize)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Restore(IN IRecycleBinFile *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetLastModificationTime(IN IRecycleBinFile *This, OUT FILETIME *pLastModificationTime)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileName(IN IRecycleBinFile *This, IN SIZE_T BufferSize, IN OUT LPWSTR Buffer, OUT SIZE_T *RequiredSize)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_QueryInterface(IN IRecycleBinFile *This, IN REFIID riid, OUT void **ppvObject)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetAttributes(IN IRecycleBinFile *This, OUT DWORD *pAttributes)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileSize(IN IRecycleBinFile *This, OUT ULARGE_INTEGER *pFileSize)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Delete(IN IRecycleBinFile *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetDeletionTime(IN IRecycleBinFile *This, OUT FILETIME *pDeletionTime)

Definition at line 231 of file recyclebin_v5_enumerator.c.

Referenced by RecycleBin5File_Constructor().