Moved to new trace interface.
[wine] / include / wine / obj_storage.h
1 /*
2  * Defines the COM interfaces and APIs related to structured data storage.
3  */
4
5 #ifndef __WINE_WINE_OBJ_STORAGE_H
6 #define __WINE_WINE_OBJ_STORAGE_H
7
8
9 #include "winnt.h"
10 #include "wine/obj_base.h"
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* defined(__cplusplus) */
15
16 /*****************************************************************************
17  * Predeclare the structures
18  */
19 typedef enum tagLOCKTYPE
20 {
21         LOCK_WRITE = 1,
22         LOCK_EXCLUSIVE = 2,
23         LOCK_ONLYONCE = 4
24 } LOCKTYPE;
25
26 typedef struct tagStorageLayout
27 {
28     DWORD LayoutType;
29     OLECHAR16* pwcsElementName;
30     LARGE_INTEGER cOffset;
31     LARGE_INTEGER cBytes;
32 } StorageLayout;
33
34 typedef struct tagSTATSTG {
35     LPOLESTR    pwcsName;
36     DWORD       type;
37     ULARGE_INTEGER cbSize;
38     FILETIME    mtime;
39     FILETIME    ctime;
40     FILETIME    atime;
41     DWORD       grfMode;
42     DWORD       grfLocksSupported;
43     CLSID       clsid;
44     DWORD       grfStateBits;
45     DWORD       reserved;
46 } STATSTG;
47
48 typedef struct tagSTATSTG16 {
49     LPOLESTR16  pwcsName;
50     DWORD       type;
51     ULARGE_INTEGER cbSize;
52     FILETIME    mtime;
53     FILETIME    ctime;
54     FILETIME    atime;
55     DWORD       grfMode;
56     DWORD       grfLocksSupported;
57     CLSID       clsid;
58     DWORD       grfStateBits;
59     DWORD       reserved;
60 } STATSTG16;
61
62 typedef LPOLESTR16 *SNB16;
63 typedef LPOLESTR *SNB;
64
65
66 /*****************************************************************************
67  * Predeclare the interfaces
68  */
69 DEFINE_OLEGUID(IID_IEnumSTATSTG,        0x0000000dL, 0, 0);
70 typedef struct IEnumSTATSTG IEnumSTATSTG,*LPENUMSTATSTG;
71
72 DEFINE_GUID   (IID_IFillLockBytes,      0x99caf010L, 0x415e, 0x11cf, 0x88, 0x14, 0x00, 0xaa, 0x00, 0xb5, 0x69, 0xf5);
73 typedef struct IFillLockBytes IFillLockBytes,*LPFILLLOCKBYTES;
74
75 DEFINE_GUID   (IID_ILayoutStorage,      0x0e6d4d90L, 0x6738, 0x11cf, 0x96, 0x08, 0x00, 0xaa, 0x00, 0x68, 0x0d, 0xb4);
76 typedef struct ILayoutStorage ILayoutStorage,*LPLAYOUTSTORAGE;
77
78 DEFINE_OLEGUID(IID_ILockBytes,          0x0000000aL, 0, 0);
79 typedef struct ILockBytes ILockBytes,*LPLOCKBYTES;
80
81 DEFINE_OLEGUID(IID_IPersist,            0x0000010cL, 0, 0);
82 typedef struct IPersist IPersist,*LPPERSIST;
83
84 DEFINE_OLEGUID(IID_IPersistFile,        0x0000010bL, 0, 0);
85 typedef struct IPersistFile IPersistFile,*LPPERSISTFILE;
86
87 DEFINE_OLEGUID(IID_IPersistStorage,     0x0000010aL, 0, 0);
88 typedef struct IPersistStorage IPersistStorage,*LPPERSISTSTORAGE;
89
90 DEFINE_OLEGUID(IID_IPersistStream,      0x00000109L, 0, 0);
91 typedef struct IPersistStream IPersistStream,*LPPERSISTSTREAM;
92
93 DEFINE_GUID   (IID_IProgressNotify,     0xa9d758a0L, 0x4617, 0x11cf, 0x95, 0xfc, 0x00, 0xaa, 0x00, 0x68, 0x0d, 0xb4);
94 typedef struct IProgressNotify IProgressNotify,*LPPROGRESSNOTIFY;
95
96 DEFINE_OLEGUID(IID_IRootStorage,        0x00000012L, 0, 0);
97 typedef struct IRootStorage IRootStorage,*LPROOTSTORAGE;
98
99 DEFINE_GUID   (IID_ISequentialStream,   0x0c733a30L, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
100 typedef struct ISequentialStream ISequentialStream,*LPSEQUENTIALSTREAM;
101
102 DEFINE_OLEGUID(IID_IStorage,            0x0000000bL, 0, 0);
103 typedef struct IStorage16 IStorage16,*LPSTORAGE16;
104 typedef struct IStorage IStorage,*LPSTORAGE;
105
106 DEFINE_OLEGUID(IID_IStream,             0x0000000cL, 0, 0);
107 typedef struct IStream16 IStream16,*LPSTREAM16;
108 typedef struct IStream IStream,*LPSTREAM;
109
110
111 /*****************************************************************************
112  * STGM enumeration
113  *
114  * See IStorage and IStream
115  */
116 #define STGM_DIRECT             0x00000000
117 #define STGM_TRANSACTED         0x00010000
118 #define STGM_SIMPLE             0x08000000
119 #define STGM_READ               0x00000000
120 #define STGM_WRITE              0x00000001
121 #define STGM_READWRITE          0x00000002
122 #define STGM_SHARE_DENY_NONE    0x00000040
123 #define STGM_SHARE_DENY_READ    0x00000030
124 #define STGM_SHARE_DENY_WRITE   0x00000020
125 #define STGM_SHARE_EXCLUSIVE    0x00000010
126 #define STGM_PRIORITY           0x00040000
127 #define STGM_DELETEONRELEASE    0x04000000
128 #define STGM_CREATE             0x00001000
129 #define STGM_CONVERT            0x00020000
130 #define STGM_FAILIFTHERE        0x00000000
131 #define STGM_NOSCRATCH          0x00100000
132 #define STGM_NOSNAPSHOT         0x00200000
133
134 /*****************************************************************************
135  * STGTY enumeration
136  *
137  * See IStorage
138  */
139 #define STGTY_STORAGE 1
140 #define STGTY_STREAM  2
141 #define STGTY_LOCKBYTES 3
142 #define STGTY_PROPERTY  4
143
144 /*****************************************************************************
145  * STATFLAG enumeration
146  *
147  * See IStorage and IStream
148  */
149 #define STATFLAG_DEFAULT 0
150 #define STATFLAG_NONAME  1
151
152 /*****************************************************************************
153  * STREAM_SEEK enumeration
154  *
155  * See IStream
156  */
157 #define STREAM_SEEK_SET 0
158 #define STREAM_SEEK_CUR 1
159 #define STREAM_SEEK_END 2
160
161 /*****************************************************************************
162  * IEnumSTATSTG interface
163  */
164 #define ICOM_INTERFACE IEnumSTATSTG
165 #define IEnumSTATSTG_METHODS \
166     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, STATSTG*,rgelt, ULONG*,pceltFethed) \
167     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
168     ICOM_METHOD (HRESULT,Reset) \
169     ICOM_METHOD1(HRESULT,Clone, IEnumSTATSTG**,ppenum)
170 #define IEnumSTATSTG_IMETHODS \
171     IUnknown_IMETHODS \
172     IEnumSTATSTG_METHODS
173 ICOM_DEFINE(IEnumSTATSTG,IUnknown)
174 #undef ICOM_INTERFACE
175
176 #ifdef ICOM_CINTERFACE
177 /*** IUnknown methods ***/
178 #define IEnumSTATSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
179 #define IEnumSTATSTG_AddRef(p)             ICOM_CALL (AddRef,p)
180 #define IEnumSTATSTG_Release(p)            ICOM_CALL (Release,p)
181 /*** IEnumSTATSTG methods ***/
182 #define IEnumSTATSTG_Next(p,a,b,c)         ICOM_CALL3(Next,p,a,b,c)
183 #define IEnumSTATSTG_Skip(p,a)             ICOM_CALL1(Skip,p,a)
184 #define IEnumSTATSTG_Reset(p)              ICOM_CALL(Reset,p)
185 #define IEnumSTATSTG_Clone(p,a)            ICOM_CALL1(Clone,p,a)
186 #endif
187
188
189 /*****************************************************************************
190  * IFillLockBytes interface
191  */
192 #define ICOM_INTERFACE IFillLockBytes
193 #define IFillLockBytes_METHODS \
194     ICOM_METHOD3(HRESULT,FillAppend,  const void*,pv, ULONG,cb, ULONG*,pcbWritten) \
195     ICOM_METHOD4(HRESULT,FillAt,      ULARGE_INTEGER,ulOffset, const void*,pv, ULONG,cb, ULONG*,pcbWritten) \
196     ICOM_METHOD1(HRESULT,SetFillSize, ULARGE_INTEGER,ulSize) \
197     ICOM_METHOD1(HRESULT,Terminate,   BOOL,bCanceled)
198 #define IFillLockBytes_IMETHODS \
199     IUnknown_IMETHODS \
200     IFillLockBytes_METHODS
201 ICOM_DEFINE(IFillLockBytes,IUnknown)
202 #undef ICOM_INTERFACE
203
204 #ifdef ICOM_CINTERFACE
205 /*** IUnknown methods ***/
206 #define IFillLockBytes_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
207 #define IFillLockBytes_AddRef(p)             ICOM_CALL (AddRef,p)
208 #define IFillLockBytes_Release(p)            ICOM_CALL (Release,p)
209 /*** IFillLockBytes methods ***/
210 #define IFillLockBytes_FillAppend(p,a,b,c) ICOM_CALL3(FillAppend,p,a,b,c)
211 #define IFillLockBytes_FillAt(p,a,b,c,d)   ICOM_CALL4(FillAt,p,a,b,c,d)
212 #define IFillLockBytes_SetFillSize(p,a)    ICOM_CALL1(SetFillSize,p,a)
213 #define IFillLockBytes_Terminate(p,a)      ICOM_CALL1(Terminate,p,a)
214 #endif
215
216
217 /*****************************************************************************
218  * ILayoutStorage interface
219  */
220 #define ICOM_INTERFACE ILayoutStorage
221 #define ILayoutStorage_METHODS \
222     ICOM_METHOD2(HRESULT,LayoutScript,                DWORD,nEntries, DWORD,glfInterleavedFlag) \
223     ICOM_METHOD (HRESULT,BeginMonitor) \
224     ICOM_METHOD (HRESULT,EndMonitor) \
225     ICOM_METHOD1(HRESULT,ReLayoutDocfile,             OLECHAR16*,pwcsNewDfName) \
226     ICOM_METHOD1(HRESULT,ReLayoutDocfileOnILockBytes, ILockBytes*,pILockBytes)
227 #define ILayoutStorage_IMETHODS \
228     IUnknown_IMETHODS \
229     ILayoutStorage_METHODS
230 ICOM_DEFINE(ILayoutStorage,IUnknown)
231 #undef ICOM_INTERFACE
232
233 #ifdef ICOM_CINTERFACE
234 /*** IUnknown methods ***/
235 #define ILayoutStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
236 #define ILayoutStorage_AddRef(p)             ICOM_CALL (AddRef,p)
237 #define ILayoutStorage_Release(p)            ICOM_CALL (Release,p)
238 /*** ILayoutStorage methods ***/
239 #define ILayoutStorage_LayoutScript(p,a,b)              ICOM_CALL2(LayoutScript,p,a,b)
240 #define ILayoutStorage_BeginMonitor(p)                  ICOM_CALL (BeginMonitor,p)
241 #define ILayoutStorage_EndMonitor(p)                    ICOM_CALL (EndMonitor,p)
242 #define ILayoutStorage_ReLayoutDocfile(p,a)             ICOM_CALL1(ReLayoutDocfile,p,a)
243 #define ILayoutStorage_ReLayoutDocfileOnILockBytes(p,a) ICOM_CALL1(ReLayoutDocfileOnILockBytes,p,a)
244 #endif
245
246
247 /*****************************************************************************
248  * ILockBytes interface
249  */
250 #define ICOM_INTERFACE ILockBytes
251 #define ILockBytes_METHODS \
252     ICOM_METHOD4(HRESULT,ReadAt,       ULARGE_INTEGER,ulOffset, void*,pv, ULONG,cb, ULONG*,pcbRead) \
253     ICOM_METHOD4(HRESULT,WriteAt,      ULARGE_INTEGER,ulOffset, const void*,pv, ULONG,cb, ULONG*,pcbWritten) \
254     ICOM_METHOD (HRESULT,Flush) \
255     ICOM_METHOD1(HRESULT,SetSize,      ULARGE_INTEGER,cb) \
256     ICOM_METHOD3(HRESULT,LockRegion,   ULARGE_INTEGER,libOffset, ULARGE_INTEGER,cb, DWORD,dwLockType) \
257     ICOM_METHOD3(HRESULT,UnlockRegion, ULARGE_INTEGER,libOffset, ULARGE_INTEGER,cb, DWORD,dwLockType) \
258     ICOM_METHOD2(HRESULT,Stat,         STATSTG*,pstatstg, DWORD,grfStatFlag)
259 #define ILockBytes_IMETHODS \
260     IUnknown_IMETHODS \
261     ILockBytes_METHODS
262 ICOM_DEFINE(ILockBytes,IUnknown)
263 #undef ICOM_INTERFACE
264
265 #ifdef ICOM_CINTERFACE
266 /*** IUnknown methods ***/
267 #define ILockBytes_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
268 #define ILockBytes_AddRef(p)             ICOM_CALL (AddRef,p)
269 #define ILockBytes_Release(p)            ICOM_CALL (Release,p)
270 /*** ILockBytes methods ***/
271 #define ILockBytes_ReadAt(p,a,b,c,d)     ICOM_CALL4(ReadAt,p,a,b,c,d)
272 #define ILockBytes_WriteAt(p,a,b,c,d)    ICOM_CALL4(WriteAt,p,a,b,c,d)
273 #define ILockBytes_Flush(p)              ICOM_CALL (Flush,p)
274 #define ILockBytes_SetSize(p,a)          ICOM_CALL1(SetSize,p,a)
275 #define ILockBytes_LockRegion(p,a,b,c)   ICOM_CALL3(LockRegion,p,a,b,c)
276 #define ILockBytes_UnlockRegion(p,a,b,c) ICOM_CALL3(UnlockRegion,p,a,b,c)
277 #define ILockBytes_Stat(p,a,b)           ICOM_CALL2(Stat,p,a,b)
278 #endif
279
280
281 /*****************************************************************************
282  * IPersist interface
283  */
284 #define ICOM_INTERFACE IPersist
285 #define IPersist_METHODS \
286     ICOM_CMETHOD1(HRESULT,GetClassID, CLSID*,pClassID)
287 #define IPersist_IMETHODS \
288     IUnknown_IMETHODS \
289     IPersist_METHODS
290 ICOM_DEFINE(IPersist,IUnknown)
291 #undef ICOM_INTERFACE
292
293 #ifdef ICOM_CINTERFACE
294 /*** IUnknown methods ***/
295 #define IPersist_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
296 #define IPersist_AddRef(p)             ICOM_CALL (AddRef,p)
297 #define IPersist_Release(p)            ICOM_CALL (Release,p)
298 /*** IPersist methods ***/
299 #define IPersist_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
300 #endif
301
302
303 /*****************************************************************************
304  * IPersistFile interface
305  */
306 #define ICOM_INTERFACE IPersistFile
307 #define IPersistFile_METHODS \
308     ICOM_CMETHOD (HRESULT,IsDirty) \
309     ICOM_METHOD2 (HRESULT,Load,          LPCOLESTR,pszFileName, DWORD,dwMode) \
310     ICOM_METHOD2 (HRESULT,Save,          LPCOLESTR,pszFileName, BOOL,fRemember) \
311     ICOM_METHOD1 (HRESULT,SaveCompleted, LPCOLESTR,pszFileName) \
312     ICOM_CMETHOD1(HRESULT,GetCurFile,    LPOLESTR*,ppszFileName)
313 #define IPersistFile_IMETHODS \
314     IPersist_IMETHODS \
315     IPersistFile_METHODS
316 ICOM_DEFINE(IPersistFile,IPersist)
317 #undef ICOM_INTERFACE
318
319 #ifdef ICOM_CINTERFACE
320 /*** IUnknown methods ***/
321 #define IPersistFile_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
322 #define IPersistFile_AddRef(p)             ICOM_CALL (AddRef,p)
323 #define IPersistFile_Release(p)            ICOM_CALL (Release,p)
324 /*** IPersist methods ***/
325 #define IPersistFile_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
326 /*** IPersistFile methods ***/
327 #define IPersistFile_IsDirty(p)         ICOM_CALL(IsDirty,p)
328 #define IPersistFile_Load(p,a,b)        ICOM_CALL2(Load,p,a,b)
329 #define IPersistFile_Save(p,a,b)        ICOM_CALL2(Save,p,a,b)
330 #define IPersistFile_SaveCompleted(p,a) ICOM_CALL1(SaveCompleted,p,a)
331 #define IPersistFile_GetCurFile(p,a)    ICOM_CALL1(GetCurFile,p,a)
332 #endif
333
334
335 /*****************************************************************************
336  * IPersistStorage interface
337  */
338 #define ICOM_INTERFACE IPersistStorage
339 #define IPersistStorage_METHODS \
340     ICOM_METHOD (HRESULT,IsDirty) \
341     ICOM_METHOD1(HRESULT,InitNew,        IStorage*,pStg) \
342     ICOM_METHOD1(HRESULT,Load,           IStorage*,pStg) \
343     ICOM_METHOD2(HRESULT,Save,           IStorage*,pStg, BOOL,fSameAsLoad) \
344     ICOM_METHOD1(HRESULT,SaveCompleted,  IStorage*,pStgNew) \
345                 ICOM_METHOD (HRESULT,HandsOffStorage)
346 #define IPersistStorage_IMETHODS \
347     IPersist_IMETHODS \
348     IPersistStorage_METHODS
349 ICOM_DEFINE(IPersistStorage,IPersist)
350 #undef ICOM_INTERFACE
351
352 #ifdef ICOM_CINTERFACE
353 /*** IUnknown methods ***/
354 #define IPersistStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
355 #define IPersistStorage_AddRef(p)             ICOM_CALL (AddRef,p)
356 #define IPersistStorage_Release(p)            ICOM_CALL (Release,p)
357 /*** IPersist methods ***/
358 #define IPersistStorage_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
359 /*** IPersistStorage methods ***/
360 #define IPersistStorage_IsDirty(p)         ICOM_CALL (IsDirty,p)
361 #define IPersistStorage_InitNew(p,a)                     ICOM_CALL1(InitNew,p,a)
362 #define IPersistStorage_Load(p,a)          ICOM_CALL1(Load,p,a)
363 #define IPersistStorage_Save(p,a,b)        ICOM_CALL2(Save,p,a,b)
364 #define IPersistStorage_SaveCompleted(p,a) ICOM_CALL1(SaveCompleted,p,a)
365 #define IPersistStorage_HandsOffStorage(p) ICOM_CALL (HandsOffStorage,p)
366 #endif
367
368
369 /*****************************************************************************
370  * IPersistStream interface
371  */
372 #define ICOM_INTERFACE IPersistStream
373 #define IPersistStream_METHODS \
374     ICOM_METHOD (HRESULT,IsDirty) \
375     ICOM_METHOD1(HRESULT,Load,       IStream*,pStm) \
376     ICOM_METHOD2(HRESULT,Save,       IStream*,pStm, BOOL,fClearDirty) \
377     ICOM_METHOD1(HRESULT,GetSizeMax, ULARGE_INTEGER*,pcbSize)
378 #define IPersistStream_IMETHODS \
379     IPersist_IMETHODS \
380     IPersistStream_METHODS
381 ICOM_DEFINE(IPersistStream,IPersist)
382 #undef ICOM_INTERFACE
383
384 #ifdef ICOM_CINTERFACE
385 /*** IUnknown methods ***/
386 #define IPersistStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
387 #define IPersistStream_AddRef(p)             ICOM_CALL (AddRef,p)
388 #define IPersistStream_Release(p)            ICOM_CALL (Release,p)
389 /*** IPersist methods ***/
390 #define IPersistStream_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
391 /*** IPersistStream methods ***/
392 #define IPersistStream_IsDirty(p)      ICOM_CALL (IsDirty,p)
393 #define IPersistStream_Load(p,a)       ICOM_CALL1(Load,p,a)
394 #define IPersistStream_Save(p,a,b)     ICOM_CALL2(Save,p,a,b)
395 #define IPersistStream_GetSizeMax(p,a) ICOM_CALL1(GetSizeMax,p,a)
396 #endif
397
398
399 /*****************************************************************************
400  * IProgressNotify interface
401  */
402 #define ICOM_INTERFACE IProgressNotify
403 #define IProgressNotify_METHODS \
404     ICOM_METHOD4(HRESULT,OnProgress, DWORD,dwProgressCurrent, DWORD,dwProgressMaximum, BOOL,fAccurate, BOOL,fOwner)
405 #define IProgressNotify_IMETHODS \
406     IUnknown_IMETHODS \
407     IProgressNotify_METHODS
408 ICOM_DEFINE(IProgressNotify,IUnknown)
409 #undef ICOM_INTERFACE
410
411 #ifdef ICOM_CINTERFACE
412 /*** IUnknown methods ***/
413 #define IProgressNotify_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
414 #define IProgressNotify_AddRef(p)             ICOM_CALL (AddRef,p)
415 #define IProgressNotify_Release(p)            ICOM_CALL (Release,p)
416 /*** IProgressNotify methods ***/
417 #define IProgressNotify_OnProgress(p,a,b,c,d) ICOM_CALL4(OnProgress,p,a,b,c,d)
418 #endif
419
420
421 /*****************************************************************************
422  * IRootStorage interface
423  */
424 #define ICOM_INTERFACE IRootStorage
425 #define IRootStorage_METHODS \
426     ICOM_METHOD1(HRESULT,SwitchToFile, LPOLESTR,pszFile)
427 #define IRootStorage_IMETHODS \
428     IUnknown_IMETHODS \
429     IRootStorage_METHODS
430 ICOM_DEFINE(IRootStorage,IUnknown)
431 #undef ICOM_INTERFACE
432
433 #ifdef ICOM_CINTERFACE
434 /*** IUnknown methods ***/
435 #define IRootStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
436 #define IRootStorage_AddRef(p)             ICOM_CALL (AddRef,p)
437 #define IRootStorage_Release(p)            ICOM_CALL (Release,p)
438 /*** IRootStorage methods ***/
439 #define IRootStorage_SwitchToFile(p,a) ICOM_CALLSwitchToFile(,p,a)
440 #endif
441
442
443 /*****************************************************************************
444  * ISequentialStream interface
445  */
446 #define ICOM_INTERFACE ISequentialStream
447 #define ISequentialStream_METHODS \
448     ICOM_METHOD3(HRESULT,Read,  void*,pv, ULONG,cb, ULONG*,pcbRead) \
449     ICOM_METHOD3(HRESULT,Write, const void*,pv, ULONG,cb, ULONG*,pcbWritten)
450 #define ISequentialStream_IMETHODS \
451     IUnknown_IMETHODS \
452     ISequentialStream_METHODS
453 ICOM_DEFINE(ISequentialStream,IUnknown)
454 #undef ICOM_INTERFACE
455
456 #ifdef ICOM_CINTERFACE
457 /*** IUnknown methods ***/
458 #define ISequentialStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
459 #define ISequentialStream_AddRef(p)             ICOM_CALL (AddRef,p)
460 #define ISequentialStream_Release(p)            ICOM_CALL (Release,p)
461 /*** ISequentialStream methods ***/
462 #define ISequentialStream_Read(p,a,b,c)  ICOM_CALL3(Read,p,a,b,c)
463 #define ISequentialStream_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c)
464 #endif
465
466
467 /*****************************************************************************
468  * IStorage interface
469  */
470 #define ICOM_INTERFACE IStorage16
471 #define IStorage16_METHODS \
472     ICOM_METHOD5(HRESULT,CreateStream,   LPCOLESTR16,pwcsName, DWORD,grfMode, DWORD,reserved1, DWORD,reserved2, IStream16**,ppstm) \
473     ICOM_METHOD5(HRESULT,OpenStream,     LPCOLESTR16,pwcsName, void*,reserved1, DWORD,grfMode, DWORD,reserved2, IStream16**,ppstm) \
474     ICOM_METHOD5(HRESULT,CreateStorage,  LPCOLESTR16,pwcsName, DWORD,grfMode, DWORD,dwStgFmt, DWORD,reserved2, IStorage16**,ppstg) \
475     ICOM_METHOD6(HRESULT,OpenStorage,    LPCOLESTR16,pwcsName, IStorage16*,pstgPriority, DWORD,grfMode, SNB16,snb16Exclude, DWORD,reserved, IStorage16**,ppstg) \
476     ICOM_METHOD4(HRESULT,CopyTo,         DWORD,ciidExclude, const IID*,rgiidExclude, SNB16,snb16Exclude, IStorage16*,pstgDest) \
477     ICOM_METHOD4(HRESULT,MoveElementTo,  LPCOLESTR16,pwcsName, IStorage16*,pstgDest, LPCOLESTR16,pwcsNewName, DWORD,grfFlags) \
478     ICOM_METHOD1(HRESULT,Commit,         DWORD,grfCommitFlags) \
479     ICOM_METHOD (HRESULT,Revert) \
480     ICOM_METHOD4(HRESULT,EnumElements,   DWORD,reserved1, void*,reserved2, DWORD,reserved3, IEnumSTATSTG**,ppenum) \
481     ICOM_METHOD1(HRESULT,DestroyElement, LPCOLESTR16,pwcsName) \
482     ICOM_METHOD2(HRESULT,RenameElement,  LPCOLESTR16,pwcsOldName, LPOLESTR16,pwcsNewName) \
483     ICOM_METHOD4(HRESULT,SetElementTimes,LPCOLESTR16,pwcsName, const FILETIME*,pctime, const FILETIME*,patime, const FILETIME*,pmtime) \
484     ICOM_METHOD1(HRESULT,SetClass,       REFCLSID,clsid) \
485     ICOM_METHOD2(HRESULT,SetStateBits,   DWORD,grfStateBits, DWORD,grfMask) \
486     ICOM_METHOD2(HRESULT,Stat,           STATSTG*,pstatstg, DWORD,grfStatFlag)
487 #define IStorage16_IMETHODS \
488     IUnknown_IMETHODS \
489     IStorage16_METHODS
490 ICOM_DEFINE(IStorage16,IUnknown)
491 #undef ICOM_INTERFACE
492
493 #ifdef ICOM_CINTERFACE
494 /*** IUnknown methods ***/
495 #define IStorage16_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
496 #define IStorage16_AddRef(p)             ICOM_CALL (AddRef,p)
497 #define IStorage16_Release(p)            ICOM_CALL (Release,p)
498 /*** IStorage16 methods ***/
499 #define IStorage16_CreateStream(p,a,b,c,d,e)  ICOM_CALL5(CreateStream,p,a,b,c,d,e)
500 #define IStorage16_OpenStream(p,a,b,c,d,e)    ICOM_CALL5(OpenStream,p,a,b,c,d,e)
501 #define IStorage16_CreateStorage(p,a,b,c,d,e) ICOM_CALL5(CreateStorage,p,a,b,c,d,e)
502 #define IStorage16_OpenStorage(p,a,b,c,d,e,f) ICOM_CALL6(OpenStorage,p,a,b,c,d,e,f)
503 #define IStorage16_CopyTo(p,a,b,c,d)          ICOM_CALL4(CopyTo,p,a,b,c,d)
504 #define IStorage16_MoveElementTo(p,a,b,c,d)   ICOM_CALL4(MoveElementTo,p,a,b,c,d)
505 #define IStorage16_Commit(p,a)                ICOM_CALL1(Commit,p,a)
506 #define IStorage16_Revert(p)                  ICOM_CALL (Revert,p)
507 #define IStorage16_EnumElements(p,a,b,c,d)    ICOM_CALL4(EnumElements,p,a,b,c,d)
508 #define IStorage16_DestroyElement(p,a)        ICOM_CALL1(DestroyElement,p,a)
509 #define IStorage16_RenameElement(p,a,b)       ICOM_CALL2(RenameElement,p,a,b)
510 #define IStorage16_SetElementTimes(p,a,b,c,d) ICOM_CALL4(SetElementTimes,p,a,b,c,d)
511 #define IStorage16_SetClass(p,a)              ICOM_CALL1(SetClass,p,a)
512 #define IStorage16_SetStateBits(p,a,b)        ICOM_CALL2(SetStateBits,p,a,b)
513 #define IStorage16_Stat(p,a,b)                ICOM_CALL2(Stat,p,a,b)
514 #endif
515
516
517 #define ICOM_INTERFACE IStorage
518 #define IStorage_METHODS \
519     ICOM_METHOD5(HRESULT,CreateStream,   LPCOLESTR,pwcsName, DWORD,grfMode, DWORD,reserved1, DWORD,reserved2, IStream**,ppstm) \
520     ICOM_METHOD5(HRESULT,OpenStream,     LPCOLESTR,pwcsName, void*,reserved1, DWORD,grfMode, DWORD,reserved2, IStream**,ppstm) \
521     ICOM_METHOD5(HRESULT,CreateStorage,  LPCOLESTR,pwcsName, DWORD,grfMode, DWORD,dwStgFmt, DWORD,reserved2, IStorage**,ppstg) \
522     ICOM_METHOD6(HRESULT,OpenStorage,    LPCOLESTR,pwcsName, IStorage*,pstgPriority, DWORD,grfMode, SNB,snb16Exclude, DWORD,reserved, IStorage**,ppstg) \
523     ICOM_METHOD4(HRESULT,CopyTo,         DWORD,ciidExclude, const IID*,rgiidExclude, SNB,snb16Exclude, IStorage*,pstgDest) \
524     ICOM_METHOD4(HRESULT,MoveElementTo,  LPCOLESTR,pwcsName, IStorage*,pstgDest, LPCOLESTR,pwcsNewName, DWORD,grfFlags) \
525     ICOM_METHOD1(HRESULT,Commit,         DWORD,grfCommitFlags) \
526     ICOM_METHOD (HRESULT,Revert) \
527     ICOM_METHOD4(HRESULT,EnumElements,   DWORD,reserved1, void*,reserved2, DWORD,reserved3, IEnumSTATSTG**,ppenum) \
528     ICOM_METHOD1(HRESULT,DestroyElement, LPCOLESTR,pwcsName) \
529     ICOM_METHOD2(HRESULT,RenameElement,  LPCOLESTR,pwcsOldName, LPCOLESTR,pwcsNewName) \
530     ICOM_METHOD4(HRESULT,SetElementTimes,LPCOLESTR,pwcsName, const FILETIME*,pctime, const FILETIME*,patime, const FILETIME*,pmtime) \
531     ICOM_METHOD1(HRESULT,SetClass,       REFCLSID,clsid) \
532     ICOM_METHOD2(HRESULT,SetStateBits,   DWORD,grfStateBits, DWORD,grfMask) \
533     ICOM_METHOD2(HRESULT,Stat,           STATSTG*,pstatstg, DWORD,grfStatFlag)
534 #define IStorage_IMETHODS \
535     IUnknown_IMETHODS \
536     IStorage_METHODS
537 ICOM_DEFINE(IStorage,IUnknown)
538 #undef ICOM_INTERFACE
539
540 #ifdef ICOM_CINTERFACE
541 /*** IUnknown methods ***/
542 #define IStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
543 #define IStorage_AddRef(p)             ICOM_CALL (AddRef,p)
544 #define IStorage_Release(p)            ICOM_CALL (Release,p)
545 /*** IStorage32 methods ***/
546 #define IStorage_CreateStream(p,a,b,c,d,e)  ICOM_CALL5(CreateStream,p,a,b,c,d,e)
547 #define IStorage_OpenStream(p,a,b,c,d,e)    ICOM_CALL5(OpenStream,p,a,b,c,d,e)
548 #define IStorage_CreateStorage(p,a,b,c,d,e) ICOM_CALL5(CreateStorage,p,a,b,c,d,e)
549 #define IStorage_OpenStorage(p,a,b,c,d,e,f) ICOM_CALL6(OpenStorage,p,a,b,c,d,e,f)
550 #define IStorage_CopyTo(p,a,b,c,d)          ICOM_CALL4(CopyTo,p,a,b,c,d)
551 #define IStorage_MoveElementTo(p,a,b,c,d)   ICOM_CALL4(MoveElementTo,p,a,b,c,d)
552 #define IStorage_Commit(p,a)                ICOM_CALL1(Commit,p,a)
553 #define IStorage_Revert(p)                  ICOM_CALL (Revert,p)
554 #define IStorage_EnumElements(p,a,b,c,d)    ICOM_CALL4(EnumElements,p,a,b,c,d)
555 #define IStorage_DestroyElement(p,a)        ICOM_CALL1(DestroyElement,p,a)
556 #define IStorage_RenameElement(p,a,b)       ICOM_CALL2(RenameElement,p,a,b)
557 #define IStorage_SetElementTimes(p,a,b,c,d) ICOM_CALL4(SetElementTimes,p,a,b,c,d)
558 #define IStorage_SetClass(p,a)              ICOM_CALL1(SetClass,p,a)
559 #define IStorage_SetStateBits(p,a,b)        ICOM_CALL2(SetStateBits,p,a,b)
560 #define IStorage_Stat(p,a,b)                ICOM_CALL2(Stat,p,a,b)
561
562 #ifndef __WINE__
563 /* Duplicated for WINELIB */
564 /*** IUnknown methods ***/
565 #define IStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
566 #define IStorage_AddRef(p)             ICOM_CALL (AddRef,p)
567 #define IStorage_Release(p)            ICOM_CALL (Release,p)
568 /*** IStorage methods ***/
569 #define IStorage_CreateStream(p,a,b,c,d,e)  ICOM_CALL5(CreateStream,p,a,b,c,d,e)
570 #define IStorage_OpenStream(p,a,b,c,d,e)    ICOM_CALL5(OpenStream,p,a,b,c,d,e)
571 #define IStorage_CreateStorage(p,a,b,c,d,e) ICOM_CALL5(CreateStorage,p,a,b,c,d,e)
572 #define IStorage_OpenStorage(p,a,b,c,d,e,f) ICOM_CALL6(OpenStorage,p,a,b,c,d,e,f)
573 #define IStorage_CopyTo(p,a,b,c,d)          ICOM_CALL4(CopyTo,p,a,b,c,d)
574 #define IStorage_MoveElementTo(p,a,b,c,d)   ICOM_CALL4(MoveElementTo,p,a,b,c,d)
575 #define IStorage_Commit(p,a)                ICOM_CALL1(Commit,p,a)
576 #define IStorage_Revert(p)                  ICOM_CALL (Revert,p)
577 #define IStorage_EnumElements(p,a,b,c,d)    ICOM_CALL4(EnumElements,p,a,b,c,d)
578 #define IStorage_DestroyElement(p,a)        ICOM_CALL1(DestroyElement,p,a)
579 #define IStorage_RenameElement(p,a,b)       ICOM_CALL2(RenameElement,p,a,b)
580 #define IStorage_SetElementTimes(p,a,b,c,d) ICOM_CALL4(SetElementTimes,p,a,b,c,d)
581 #define IStorage_SetClass(p,a)              ICOM_CALL1(SetClass,p,a)
582 #define IStorage_SetStateBits(p,a,b)        ICOM_CALL2(SetStateBits,p,a,b)
583 #define IStorage_Stat(p,a,b)                ICOM_CALL2(Stat,p,a,b)
584 #endif
585 #endif
586
587
588 /*****************************************************************************
589  * IStream interface
590  */
591 #define ICOM_INTERFACE IStream16
592 #define IStream16_METHODS \
593     ICOM_METHOD3(HRESULT,Seek,        LARGE_INTEGER,dlibMove, DWORD,dwOrigin, ULARGE_INTEGER*,plibNewPosition) \
594     ICOM_METHOD1(HRESULT,SetSize,     ULARGE_INTEGER,libNewSize) \
595     ICOM_METHOD4(HRESULT,CopyTo,      IStream16*,pstm, ULARGE_INTEGER,cb, ULARGE_INTEGER*,pcbRead, ULARGE_INTEGER*,pcbWritten) \
596     ICOM_METHOD1(HRESULT,Commit,      DWORD,grfCommitFlags) \
597     ICOM_METHOD (HRESULT,Revert) \
598     ICOM_METHOD3(HRESULT,LockRegion,  ULARGE_INTEGER,libOffset, ULARGE_INTEGER,cb, DWORD,dwLockType) \
599     ICOM_METHOD3(HRESULT,UnlockRegion,ULARGE_INTEGER,libOffset, ULARGE_INTEGER,cb, DWORD,dwLockType) \
600     ICOM_METHOD2(HRESULT,Stat,        STATSTG*,pstatstg, DWORD,grfStatFlag) \
601     ICOM_METHOD1(HRESULT,Clone,       IStream16**,ppstm)
602 #define IStream16_IMETHODS \
603     ISequentialStream_IMETHODS \
604     IStream16_METHODS
605 ICOM_DEFINE(IStream16,ISequentialStream)
606 #undef ICOM_INTERFACE
607
608 #ifdef ICOM_CINTERFACE
609 /*** IUnknown methods ***/
610 #define IStream16_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
611 #define IStream16_AddRef(p)             ICOM_CALL (AddRef,p)
612 #define IStream16_Release(p)            ICOM_CALL (Release,p)
613 /*** ISequentialStream methods ***/
614 #define IStream16_Read(p,a,b,c)  ICOM_CALL3(Read,p,a,b,c)
615 #define IStream16_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c)
616 /*** IStream16 methods ***/
617 #define IStream16_Seek(p)               ICOM_CALL3(Seek,p)
618 #define IStream16_SetSize(p,a,b)        ICOM_CALL1(SetSize,p,a,b)
619 #define IStream16_CopyTo(pa,b,c,d)      ICOM_CALL4(CopyTo,pa,b,c,d)
620 #define IStream16_Commit(p,a)           ICOM_CALL1(Commit,p,a)
621 #define IStream16_Revert(p)             ICOM_CALL (Revert,p)
622 #define IStream16_LockRegion(pa,b,c)    ICOM_CALL3(LockRegion,pa,b,c)
623 #define IStream16_UnlockRegion(p,a,b,c) ICOM_CALL3(UnlockRegion,p,a,b,c)
624 #define IStream16_Stat(p,a,b)           ICOM_CALL2(Stat,p,a,b)
625 #define IStream16_Clone(p,a)            ICOM_CALL1(Clone,p,a)
626 #endif
627
628
629 #define ICOM_INTERFACE IStream
630 #define IStream_METHODS \
631     ICOM_METHOD3(HRESULT,Seek,        LARGE_INTEGER,dlibMove, DWORD,dwOrigin, ULARGE_INTEGER*,plibNewPosition) \
632     ICOM_METHOD1(HRESULT,SetSize,     ULARGE_INTEGER,libNewSize) \
633     ICOM_METHOD4(HRESULT,CopyTo,      IStream*,pstm, ULARGE_INTEGER,cb, ULARGE_INTEGER*,pcbRead, ULARGE_INTEGER*,pcbWritten) \
634     ICOM_METHOD1(HRESULT,Commit,      DWORD,grfCommitFlags) \
635     ICOM_METHOD (HRESULT,Revert) \
636     ICOM_METHOD3(HRESULT,LockRegion,  ULARGE_INTEGER,libOffset, ULARGE_INTEGER,cb, DWORD,dwLockType) \
637     ICOM_METHOD3(HRESULT,UnlockRegion,ULARGE_INTEGER,libOffset, ULARGE_INTEGER,cb, DWORD,dwLockType) \
638     ICOM_METHOD2(HRESULT,Stat,        STATSTG*,pstatstg, DWORD,grfStatFlag) \
639     ICOM_METHOD1(HRESULT,Clone,       IStream**,ppstm)
640 #define IStream_IMETHODS \
641     ISequentialStream_IMETHODS \
642     IStream_METHODS
643 ICOM_DEFINE(IStream,ISequentialStream)
644 #undef ICOM_INTERFACE
645
646 #ifdef ICOM_CINTERFACE
647 /*** IUnknown methods ***/
648 #define IStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
649 #define IStream_AddRef(p)             ICOM_CALL (AddRef,p)
650 #define IStream_Release(p)            ICOM_CALL (Release,p)
651 /*** ISequentialStream methods ***/
652 #define IStream_Read(p,a,b,c)  ICOM_CALL3(Read,p,a,b,c)
653 #define IStream_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c)
654 /*** IStream32 methods ***/
655 #define IStream_Seek(p,a,b,c)         ICOM_CALL3(Seek,p,a,b,c)
656 #define IStream_SetSize(p,a)          ICOM_CALL1(SetSize,p,a)
657 #define IStream_CopyTo(p,a,b,c,d)     ICOM_CALL4(CopyTo,p,a,b,c,d)
658 #define IStream_Commit(p,a)           ICOM_CALL1(Commit,p,a)
659 #define IStream_Revert(p)             ICOM_CALL (Revert,p)
660 #define IStream_LockRegion(p,a,b,c)   ICOM_CALL3(LockRegion,p,a,b,c)
661 #define IStream_UnlockRegion(p,a,b,c) ICOM_CALL3(UnlockRegion,p,a,b,c)
662 #define IStream_Stat(p,a,b)           ICOM_CALL2(Stat,p,a,b)
663 #define IStream_Clone(p,a)            ICOM_CALL1(Clone,p,a)
664
665 #ifndef __WINE__
666 /* Duplicated for WINELIB */
667 /*** IUnknown methods ***/
668 #define IStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
669 #define IStream_AddRef(p)             ICOM_CALL (AddRef,p)
670 #define IStream_Release(p)            ICOM_CALL (Release,p)
671 /*** ISequentialStream methods ***/
672 #define IStream_Read(p,a,b,c)  ICOM_CALL3(Read,p,a,b,c)
673 #define IStream_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c)
674 /*** IStream methods ***/
675 #define IStream_Seek(p,a,b,c)         ICOM_CALL3(Seek,p,a,b,c)
676 #define IStream_SetSize(p,a)          ICOM_CALL1(SetSize,p,a)
677 #define IStream_CopyTo(p,a,b,c,d)     ICOM_CALL4(CopyTo,p,a,b,c,d)
678 #define IStream_Commit(p,a)           ICOM_CALL1(Commit,p,a)
679 #define IStream_Revert(p)             ICOM_CALL (Revert,p)
680 #define IStream_LockRegion(p,a,b,c)   ICOM_CALL3(LockRegion,p,a,b,c)
681 #define IStream_UnlockRegion(p,a,b,c) ICOM_CALL3(UnlockRegion,p,a,b,c)
682 #define IStream_Stat(p,a,b)           ICOM_CALL2(Stat,p,a,b)
683 #define IStream_Clone(p,a)            ICOM_CALL1(Clone,p,a)
684 #endif
685 #endif
686
687
688 /*****************************************************************************
689  * StgXXX API
690  */
691 /* FIXME: many functions are missing */
692 HRESULT WINAPI StgCreateDocFile16(LPCOLESTR16 pwcsName,DWORD grfMode,DWORD reserved,IStorage16 **ppstgOpen);
693 HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName,DWORD grfMode,DWORD reserved,IStorage **ppstgOpen);
694
695 HRESULT WINAPI StgIsStorageFile16(LPCOLESTR16 fn);
696 HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn);
697 HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt);
698
699 HRESULT WINAPI StgOpenStorage16(const OLECHAR16* pwcsName,IStorage16* pstgPriority,DWORD grfMode,SNB16 snbExclude,DWORD reserved,IStorage16**ppstgOpen);
700 HRESULT WINAPI StgOpenStorage(const OLECHAR* pwcsName,IStorage* pstgPriority,DWORD grfMode,SNB snbExclude,DWORD reserved,IStorage**ppstgOpen);
701
702 HRESULT WINAPI WriteClassStg(IStorage* pStg, REFCLSID rclsid);
703 HRESULT WINAPI ReadClassStg(IStorage *pstg,CLSID *pclsid);
704
705 HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt,DWORD grfMode, DWORD reserved, IStorage** ppstgOpen);
706 HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen);
707
708 /*****************************************************************************
709  * Other storage API
710  */
711
712 /* FIXME: not implemented */
713 BOOL WINAPI CoDosDateTimeToFileTime(WORD nDosDate, WORD nDosTime, FILETIME* lpFileTime);
714
715 /* FIXME: not implemented */
716 BOOL WINAPI CoFileTimeToDosDateTime(FILETIME* lpFileTime, WORD* lpDosDate, WORD* lpDosTime);
717
718 #ifdef __cplusplus
719 } /* extern "C" */
720 #endif /* defined(__cplusplus) */
721
722 #endif /* __WINE_WINE_OBJ_STORAGE_H */