1 /* Recycle bin management
2  * This file is under the GPLv2 licence
3  * Copyright (C) 2006 Herv� Poussineau <hpoussin@reactos.org>
4  */
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 #include <pshpack1.h>
11 
12 /* MS Windows 2000/XP/2003 */
13 typedef struct _DELETED_FILE_RECORD
14 {
15     CHAR FileNameA[MAX_PATH];
16     DWORD dwRecordUniqueId;
17     DWORD dwDriveNumber;
18     FILETIME DeletionTime;
19     DWORD dwPhysicalFileSize;
20     WCHAR FileNameW[MAX_PATH];
21 } DELETED_FILE_RECORD, *PDELETED_FILE_RECORD;
22 
23 #include <poppack.h>
24 
25 /* COM interface */
26 
27 typedef interface IRecycleBin5 IRecycleBin5;
28 EXTERN_C const IID IID_IRecycleBin5;
29 
30 typedef struct IRecycleBin5Vtbl
31 {
32     /* IRecycleBin interface */
33     HRESULT (STDMETHODCALLTYPE *QueryInterface)(
34         IN IRecycleBin5 *This,
35         IN REFIID riid,
36         OUT void **ppvObject);
37 
38     ULONG (STDMETHODCALLTYPE *AddRef)(
39         IN IRecycleBin5 *This);
40 
41     ULONG (STDMETHODCALLTYPE *Release)(
42         IN IRecycleBin5 *This);
43 
44     HRESULT (STDMETHODCALLTYPE *DeleteFile)(
45         IN IRecycleBin5 *This,
46         IN LPCWSTR szFileName);
47 
48     HRESULT (STDMETHODCALLTYPE *EmptyRecycleBin)(
49         IN IRecycleBin5 *This);
50 
51     HRESULT (STDMETHODCALLTYPE *EnumObjects)(
52         IN IRecycleBin5 *This,
53         OUT IRecycleBinEnumList **ppEnumList);
54 
55     /* IRecycleBin5 interface */
56     HRESULT (STDMETHODCALLTYPE *Delete)(
57         IN IRecycleBin5 *This,
58         IN LPCWSTR pDeletedFileName,
59         IN DELETED_FILE_RECORD *pDeletedFile);
60 
61     HRESULT (STDMETHODCALLTYPE *Restore)(
62         IN IRecycleBin5 *This,
63         IN LPCWSTR pDeletedFileName,
64         IN DELETED_FILE_RECORD *pDeletedFile);
65 
66     HRESULT (STDMETHODCALLTYPE *OnClosing)(
67         IN IRecycleBin5 *This,
68         IN IRecycleBinEnumList *prbel);
69 } IRecycleBin5Vtbl;
70 
71 interface IRecycleBin5
72 {
73     CONST_VTBL struct IRecycleBin5Vtbl *lpVtbl;
74 };
75 
76 #ifdef COBJMACROS
77 #define IRecycleBin5_QueryInterface(This, riid, ppvObject) \
78     (This)->lpVtbl->QueryInterface(This, riid, ppvObject)
79 #define IRecycleBin5_AddRef(This) \
80     (This)->lpVtbl->AddRef(This)
81 #define IRecycleBin5_Release(This) \
82     (This)->lpVtbl->Release(This)
83 #define IRecycleBin5_DeleteFile(This, szFileName) \
84     (This)->lpVtbl->DeleteFile(This, szFileName)
85 #define IRecycleBin5_EmptyRecycleBin(This) \
86     (This)->lpVtbl->EmptyRecycleBin(This)
87 #define IRecycleBin5_EnumObjects(This, ppEnumList) \
88     (This)->lpVtbl->EnumObjects(This, ppEnumList)
89 #define IRecycleBin5_Delete(This, pDeletedFileName, pDeletedFile) \
90     (This)->lpVtbl->Delete(This, pDeletedFileName, pDeletedFile)
91 #define IRecycleBin5_Restore(This, pDeletedFileName, pDeletedFile) \
92     (This)->lpVtbl->Restore(This, pDeletedFileName, pDeletedFile)
93 #define IRecycleBin5_OnClosing(This, prb5el) \
94     (This)->lpVtbl->OnClosing(This, prb5el)
95 #endif
96 
97 HRESULT
98 RecycleBin5Enum_Constructor(
99     IN IRecycleBin5 *prb,
100     IN HANDLE hInfo,
101     IN HANDLE hInfoMapped,
102     IN LPCWSTR szPrefix,
103     OUT IUnknown **ppUnknown);
104 
105 #ifdef __cplusplus
106 }
107 #endif
108