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 #define INTERFACE IRecycleBin5
DECLARE_INTERFACE_(IRecycleBin5,IRecycleBin)31 DECLARE_INTERFACE_(IRecycleBin5, IRecycleBin)
32 {
33     BEGIN_INTERFACE
34 
35     /* IUnknown interface */
36     STDMETHOD(QueryInterface)(THIS_ IN REFIID riid, OUT void **ppvObject) PURE;
37     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
38     STDMETHOD_(ULONG, Release)(THIS) PURE;
39 
40     /* IRecycleBin interface */
41     STDMETHOD(DeleteFile)(THIS_ IN LPCWSTR szFileName) PURE;
42     STDMETHOD(EmptyRecycleBin)(THIS);
43     STDMETHOD(EnumObjects)(THIS_ OUT IRecycleBinEnumList **ppEnumList) PURE;
44     STDMETHOD(GetDirectory)(THIS_ LPWSTR szPath) PURE;
45 
46     /* IRecycleBin5 interface */
47     STDMETHOD(Delete)(
48         THIS_
49         IN LPCWSTR pDeletedFileName,
50         IN DELETED_FILE_RECORD *pDeletedFile) PURE;
51     STDMETHOD(Restore)(
52         THIS_
53         IN LPCWSTR pDeletedFileName,
54         IN DELETED_FILE_RECORD *pDeletedFile) PURE;
55     STDMETHOD(OnClosing)(
56         THIS_
57         IN IRecycleBinEnumList *prbel) PURE;
58 
59     END_INTERFACE
60 };
61 #undef INTERFACE
62 
63 #ifdef COBJMACROS
64 #define IRecycleBin5_QueryInterface(This, riid, ppvObject) \
65     (This)->lpVtbl->QueryInterface(This, riid, ppvObject)
66 #define IRecycleBin5_AddRef(This) \
67     (This)->lpVtbl->AddRef(This)
68 #define IRecycleBin5_Release(This) \
69     (This)->lpVtbl->Release(This)
70 #define IRecycleBin5_DeleteFile(This, szFileName) \
71     (This)->lpVtbl->DeleteFile(This, szFileName)
72 #define IRecycleBin5_EmptyRecycleBin(This) \
73     (This)->lpVtbl->EmptyRecycleBin(This)
74 #define IRecycleBin5_EnumObjects(This, ppEnumList) \
75     (This)->lpVtbl->EnumObjects(This, ppEnumList)
76 #define IRecycleBin5_Delete(This, pDeletedFileName, pDeletedFile) \
77     (This)->lpVtbl->Delete(This, pDeletedFileName, pDeletedFile)
78 #define IRecycleBin5_Restore(This, pDeletedFileName, pDeletedFile) \
79     (This)->lpVtbl->Restore(This, pDeletedFileName, pDeletedFile)
80 #define IRecycleBin5_OnClosing(This, prb5el) \
81     (This)->lpVtbl->OnClosing(This, prb5el)
82 #endif
83 
84 EXTERN_C
85 HRESULT
86 RecycleBin5Enum_Constructor(
87     _In_ IRecycleBin5 *prb,
88     _In_ HANDLE hInfo,
89     _In_ HANDLE hInfoMapped,
90     _In_ LPCWSTR szPrefix,
91     _Out_ IUnknown **ppUnknown);
92 
93 #ifdef __cplusplus
94 }
95 #endif
96