ReactOS 0.4.15-dev-8119-g4fb2fdb
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_GetAttributes (IN IRecycleBinFile *This, OUT DWORD *pAttributes)
 
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_GetFileName (IN IRecycleBinFile *This, IN SIZE_T BufferSize, IN OUT LPWSTR Buffer, OUT SIZE_T *RequiredSize)
 
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetTypeName (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 494 of file recyclebin_v5_enumerator.c.

500{
501 struct RecycleBin5Enum *s = NULL;
502 SIZE_T Needed;
503
504 if (!ppUnknown)
505 return E_POINTER;
506
507 Needed = (wcslen(szPrefix) + 1) * sizeof(WCHAR);
508
509 s = CoTaskMemAlloc(sizeof(struct RecycleBin5Enum) + Needed);
510 if (!s)
511 return E_OUTOFMEMORY;
512 ZeroMemory(s, sizeof(struct RecycleBin5Enum) + Needed);
513 s->recycleBinEnumImpl.lpVtbl = &RecycleBin5EnumVtbl;
514 s->ref = 1;
515 s->recycleBin = prb;
516 wcscpy(s->szPrefix, szPrefix);
517 s->hInfo = hInfo;
518 s->pInfo = MapViewOfFile(hInfoMapped, FILE_MAP_READ, 0, 0, 0);
519 if (!s->pInfo)
520 {
523 }
524 if (s->pInfo->dwVersion != 5 || s->pInfo->dwRecordSize != sizeof(DELETED_FILE_RECORD))
525 {
526 UnmapViewOfFile(s->pInfo);
528 return E_FAIL;
529 }
530 IRecycleBin5_AddRef(s->recycleBin);
531 *ppUnknown = (IUnknown *)&s->recycleBinEnumImpl;
532
533 return S_OK;
534}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define UnmapViewOfFile
Definition: compat.h:746
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
GLdouble s
Definition: gl.h:2039
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define S_OK
Definition: intsafe.h:52
CONST_VTBL struct IRecycleBinEnumListVtbl RecycleBin5EnumVtbl
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RecycleBin5_RecycleBin5_EnumObjects().

◆ RecycleBin5Enum_Destructor()

static VOID RecycleBin5Enum_Destructor ( struct RecycleBin5Enum s)
static

Definition at line 388 of file recyclebin_v5_enumerator.c.

390{
391 TRACE("(%p)\n", s);
392
393 IRecycleBin5_OnClosing(s->recycleBin, &s->recycleBinEnumImpl);
394 UnmapViewOfFile(s->pInfo);
395 IRecycleBin5_Release(s->recycleBin);
397}
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by RecycleBin5Enum_RecycleBinEnumList_Release().

◆ RecycleBin5Enum_RecycleBinEnumList_AddRef()

static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_AddRef ( IN IRecycleBinEnumList *  This)
static

Definition at line 378 of file recyclebin_v5_enumerator.c.

380{
382 ULONG refCount = InterlockedIncrement((PLONG)&s->ref);
383 TRACE("(%p)\n", This);
384 return refCount;
385}
#define InterlockedIncrement
Definition: armddk.h:53
IRecycleBinEnumList recycleBinEnumImpl
int32_t * PLONG
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59

◆ 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 417 of file recyclebin_v5_enumerator.c.

422{
425 INFO2_HEADER *pHeader = s->pInfo;
426 DELETED_FILE_RECORD *pDeletedFile;
427 DWORD fetched = 0, i;
428 DWORD dwEntries;
429 HRESULT hr;
430
431 TRACE("(%p, %u, %p, %p)\n", This, celt, rgelt, pceltFetched);
432
433 if (!rgelt)
434 return E_POINTER;
435 if (!pceltFetched && celt > 1)
436 return E_INVALIDARG;
437
438 FileSize.u.LowPart = GetFileSize(s->hInfo, &FileSize.u.HighPart);
439 if (FileSize.u.LowPart == 0)
441 dwEntries = (DWORD)((FileSize.QuadPart - sizeof(INFO2_HEADER)) / sizeof(DELETED_FILE_RECORD));
442
443 i = s->dwCurrent;
444 pDeletedFile = (DELETED_FILE_RECORD *)(pHeader + 1) + i;
445 for (; i < dwEntries && fetched < celt; i++)
446 {
447 hr = RecycleBin5File_Constructor(s->recycleBin, s->szPrefix, pDeletedFile, &rgelt[fetched]);
448 if (SUCCEEDED(hr))
449 fetched++;
450 pDeletedFile++;
451 }
452
453 s->dwCurrent = i;
454 if (pceltFetched)
455 *pceltFetched = fetched;
456 if (fetched == celt)
457 return S_OK;
458 else
459 return S_FALSE;
460}
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
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
FxContextHeader * pHeader
Definition: handleapi.cpp:604
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define DWORD
Definition: nt_native.h:44
struct _DELETED_FILE_RECORD DELETED_FILE_RECORD
static HRESULT RecycleBin5File_Constructor(IN IRecycleBin5 *prb, IN LPCWSTR Folder, IN PDELETED_FILE_RECORD pDeletedFile, OUT IRecycleBinFile **ppFile)
HRESULT hr
Definition: shlfolder.c:183
LONGLONG QuadPart
Definition: typedefs.h:114
struct _LARGE_INTEGER::@2300 u
#define S_FALSE
Definition: winerror.h:2357

◆ RecycleBin5Enum_RecycleBinEnumList_QueryInterface()

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

Definition at line 351 of file recyclebin_v5_enumerator.c.

355{
357
358 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
359
360 if (!ppvObject)
361 return E_POINTER;
362
364 *ppvObject = &s->recycleBinEnumImpl;
366 *ppvObject = &s->recycleBinEnumImpl;
367 else
368 {
369 *ppvObject = NULL;
370 return E_NOINTERFACE;
371 }
372
373 IUnknown_AddRef(This);
374 return S_OK;
375}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
EXTERN_C const IID IID_IRecycleBinEnumList
Definition: recyclebin.h:245
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ RecycleBin5Enum_RecycleBinEnumList_Release()

static ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Release ( IN IRecycleBinEnumList *  This)
static

Definition at line 400 of file recyclebin_v5_enumerator.c.

402{
404 ULONG refCount;
405
406 TRACE("(%p)\n", This);
407
408 refCount = InterlockedDecrement((PLONG)&s->ref);
409
410 if (refCount == 0)
412
413 return refCount;
414}
#define InterlockedDecrement
Definition: armddk.h:52
static VOID RecycleBin5Enum_Destructor(struct RecycleBin5Enum *s)

◆ RecycleBin5Enum_RecycleBinEnumList_Reset()

static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Reset ( IN IRecycleBinEnumList *  This)
static

Definition at line 474 of file recyclebin_v5_enumerator.c.

476{
478 TRACE("(%p)\n", This);
479 s->dwCurrent = 0;
480 return S_OK;
481}

◆ RecycleBin5Enum_RecycleBinEnumList_Skip()

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

Definition at line 463 of file recyclebin_v5_enumerator.c.

466{
468 TRACE("(%p, %u)\n", This, celt);
469 s->dwCurrent += celt;
470 return S_OK;
471}

◆ RecycleBin5File_Constructor()

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

Definition at line 298 of file recyclebin_v5_enumerator.c.

303{
304 struct RecycleBin5File *s = NULL;
306 SIZE_T Needed;
307
308 if (!ppFile)
309 return E_POINTER;
310
311 Extension = wcsrchr(pDeletedFile->FileNameW, '.');
312 if (Extension < wcsrchr(pDeletedFile->FileNameW, '\\'))
313 Extension = NULL;
314 Needed = wcslen(Folder) + 13;
315 if (Extension)
316 Needed += wcslen(Extension);
317 Needed *= sizeof(WCHAR);
318
319 s = CoTaskMemAlloc(sizeof(struct RecycleBin5File) + Needed);
320 if (!s)
321 return E_OUTOFMEMORY;
322 ZeroMemory(s, sizeof(struct RecycleBin5File) + Needed);
323 s->recycleBinFileImpl.lpVtbl = &RecycleBin5FileVtbl;
324 s->ref = 1;
325 s->deletedFile = *pDeletedFile;
326 s->recycleBin = prb;
327 IRecycleBin5_AddRef(s->recycleBin);
328 *ppFile = &s->recycleBinFileImpl;
329 wsprintfW(s->FullName, L"%s\\D%c%lu%s", Folder, pDeletedFile->dwDriveNumber + 'a', pDeletedFile->dwRecordUniqueId, Extension);
331 {
333 return E_FAIL;
334 }
335
336 return S_OK;
337}
#define wcsrchr
Definition: compat.h:16
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
#define L(x)
Definition: ntvdm.h:50
static VOID RecycleBin5File_Destructor(struct RecycleBin5File *s)
CONST_VTBL struct IRecycleBinFileVtbl RecycleBin5FileVtbl
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by RecycleBin5Enum_RecycleBinEnumList_Next().

◆ RecycleBin5File_Destructor()

static VOID RecycleBin5File_Destructor ( struct RecycleBin5File s)
static

Definition at line 71 of file recyclebin_v5_enumerator.c.

73{
74 TRACE("(%p)\n", s);
75
76 IRecycleBin5_Release(s->recycleBin);
78}

Referenced by RecycleBin5File_Constructor(), and RecycleBin5File_RecycleBinFile_Release().

◆ RecycleBin5File_RecycleBinFile_AddRef()

static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_AddRef ( IN IRecycleBinFile *  This)
static

Definition at line 61 of file recyclebin_v5_enumerator.c.

63{
65 ULONG refCount = InterlockedIncrement((PLONG)&s->ref);
66 TRACE("(%p)\n", This);
67 return refCount;
68}
IRecycleBinFile recycleBinFileImpl

◆ RecycleBin5File_RecycleBinFile_Delete()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Delete ( IN IRecycleBinFile *  This)
static

Definition at line 264 of file recyclebin_v5_enumerator.c.

266{
268 TRACE("(%p)\n", This);
269 return IRecycleBin5_Delete(s->recycleBin, s->FullName, &s->deletedFile);
270}

◆ RecycleBin5File_RecycleBinFile_GetAttributes()

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

Definition at line 184 of file recyclebin_v5_enumerator.c.

187{
190
191 TRACE("(%p, %p)\n", This, pAttributes);
192
193 dwAttributes = GetFileAttributesW(s->FullName);
196
197 *pAttributes = dwAttributes;
198 return S_OK;
199}
DWORD dwAttributes
Definition: vdmdbg.h:34

Referenced by RecycleBin5File_RecycleBinFile_GetTypeName(), and RecycleBin5File_RecycleBinFile_QueryInterface().

◆ RecycleBin5File_RecycleBinFile_GetDeletionTime()

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

Definition at line 128 of file recyclebin_v5_enumerator.c.

131{
133 TRACE("(%p, %p)\n", This, pDeletionTime);
134 *pDeletionTime = s->deletedFile.DeletionTime;
135 return S_OK;
136}

◆ 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 202 of file recyclebin_v5_enumerator.c.

207{
209 DWORD dwRequired;
210
211 TRACE("(%p, %u, %p, %p)\n", This, BufferSize, Buffer, RequiredSize);
212
213 dwRequired = (DWORD)(wcslen(s->deletedFile.FileNameW) + 1) * sizeof(WCHAR);
214 if (RequiredSize)
215 *RequiredSize = dwRequired;
216
217 if (BufferSize == 0 && !Buffer)
218 return S_OK;
219
220 if (BufferSize < dwRequired)
221 return E_OUTOFMEMORY;
222 CopyMemory(Buffer, s->deletedFile.FileNameW, dwRequired);
223 return S_OK;
224}
Definition: bufpool.h:45
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define CopyMemory
Definition: winbase.h:1710

◆ RecycleBin5File_RecycleBinFile_GetFileSize()

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

Definition at line 139 of file recyclebin_v5_enumerator.c.

142{
144 HRESULT hr;
147
148 TRACE("(%p, %p)\n", This, pFileSize);
149
150 dwAttributes = GetFileAttributesW(s->FullName);
154 {
155 pFileSize->QuadPart = 0;
156 return S_OK;
157 }
158
162 pFileSize->u.LowPart = GetFileSize(hFile, &pFileSize->u.HighPart);
163 if (pFileSize->u.LowPart != INVALID_FILE_SIZE)
164 hr = S_OK;
165 else
168 return hr;
169}
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_SHARE_READ
Definition: compat.h:136
_In_ HANDLE hFile
Definition: mswsock.h:90
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define INVALID_FILE_SIZE
Definition: winbase.h:548

◆ RecycleBin5File_RecycleBinFile_GetLastModificationTime()

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

Definition at line 98 of file recyclebin_v5_enumerator.c.

101{
103 HRESULT hr;
106
107 TRACE("(%p, %p)\n", This, pLastModificationTime);
108
109 dwAttributes = GetFileAttributesW(s->FullName);
114 else
118
119 if (GetFileTime(hFile, NULL, NULL, pLastModificationTime))
120 hr = S_OK;
121 else
124 return hr;
125}
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:896
#define FILE_FLAG_BACKUP_SEMANTICS
Definition: disk.h:41
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_DELETE
Definition: nt_native.h:682

◆ RecycleBin5File_RecycleBinFile_GetPhysicalFileSize()

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

Definition at line 172 of file recyclebin_v5_enumerator.c.

175{
177 TRACE("(%p, %p)\n", This, pPhysicalFileSize);
178 pPhysicalFileSize->u.HighPart = 0;
179 pPhysicalFileSize->u.LowPart = s->deletedFile.dwPhysicalFileSize;
180 return S_OK;
181}

◆ RecycleBin5File_RecycleBinFile_GetTypeName()

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

Definition at line 227 of file recyclebin_v5_enumerator.c.

232{
233 HRESULT hr;
234
236 DWORD dwRequired;
238 SHFILEINFOW shFileInfo;
239
240 TRACE("(%p, %u, %p, %p)\n", This, BufferSize, Buffer, RequiredSize);
241
243 if (!SUCCEEDED(hr))
244 return hr;
245
246 hr = SHGetFileInfoW(s->FullName, dwAttributes, &shFileInfo, sizeof(shFileInfo), SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES);
247 if (!SUCCEEDED(hr))
248 return hr;
249
250 dwRequired = (DWORD)(wcslen(shFileInfo.szTypeName) + 1) * sizeof(WCHAR);
251 if (RequiredSize)
252 *RequiredSize = dwRequired;
253
254 if (BufferSize == 0 && !Buffer)
255 return S_OK;
256
257 if (BufferSize < dwRequired)
258 return E_OUTOFMEMORY;
259 CopyMemory(Buffer, shFileInfo.szTypeName, dwRequired);
260 return S_OK;
261}
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetAttributes(IN IRecycleBinFile *This, OUT DWORD *pAttributes)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:415
#define SHGFI_TYPENAME
Definition: shellapi.h:167
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:181
WCHAR szTypeName[80]
Definition: shellapi.h:376

◆ RecycleBin5File_RecycleBinFile_QueryInterface()

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

Definition at line 26 of file recyclebin_v5_enumerator.c.

30{
32
33 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
34
35 if (!ppvObject)
36 return E_POINTER;
37
39 *ppvObject = &s->recycleBinFileImpl;
41 *ppvObject = &s->recycleBinFileImpl;
42 else if (IsEqualIID(riid, &IID_IExtractIconA) || IsEqualIID(riid, &IID_IExtractIconW))
43 {
47 else
48 return S_FALSE;
49 }
50 else
51 {
52 *ppvObject = NULL;
53 return E_NOINTERFACE;
54 }
55
56 IUnknown_AddRef(This);
57 return S_OK;
58}
EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW(_In_ LPCWSTR pszFile, _In_ DWORD dwFileAttributes, _In_ REFIID riid, _Outptr_ void **ppv)
EXTERN_C const IID IID_IRecycleBinFile
Definition: recyclebin.h:244

◆ RecycleBin5File_RecycleBinFile_Release()

static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Release ( IN IRecycleBinFile *  This)
static

Definition at line 81 of file recyclebin_v5_enumerator.c.

83{
85 ULONG refCount;
86
87 TRACE("(%p)\n", This);
88
89 refCount = InterlockedDecrement((PLONG)&s->ref);
90
91 if (refCount == 0)
93
94 return refCount;
95}

◆ RecycleBin5File_RecycleBinFile_Restore()

static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Restore ( IN IRecycleBinFile *  This)
static

Definition at line 273 of file recyclebin_v5_enumerator.c.

275{
277 TRACE("(%p)\n", This);
278 return IRecycleBin5_Restore(s->recycleBin, s->FullName, &s->deletedFile);
279}

Variable Documentation

◆ RecycleBin5EnumVtbl

CONST_VTBL struct IRecycleBinEnumListVtbl RecycleBin5EnumVtbl
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_Reset(IN IRecycleBinEnumList *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_QueryInterface(IN IRecycleBinEnumList *This, IN REFIID riid, OUT void **ppvObject)
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 ULONG STDMETHODCALLTYPE RecycleBin5Enum_RecycleBinEnumList_AddRef(IN IRecycleBinEnumList *This)

Definition at line 483 of file recyclebin_v5_enumerator.c.

Referenced by RecycleBin5Enum_Constructor().

◆ RecycleBin5FileVtbl

CONST_VTBL struct IRecycleBinFileVtbl RecycleBin5FileVtbl
Initial value:
=
{
}
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_GetPhysicalFileSize(IN IRecycleBinFile *This, OUT ULARGE_INTEGER *pPhysicalFileSize)
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_Restore(IN IRecycleBinFile *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetTypeName(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 ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Release(IN IRecycleBinFile *This)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetDeletionTime(IN IRecycleBinFile *This, OUT FILETIME *pDeletionTime)
static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetLastModificationTime(IN IRecycleBinFile *This, OUT FILETIME *pLastModificationTime)
static ULONG STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_AddRef(IN IRecycleBinFile *This)

Definition at line 281 of file recyclebin_v5_enumerator.c.

Referenced by RecycleBin5File_Constructor().