1 #ifndef __WINE_STORAGE_H
2 #define __WINE_STORAGE_H
6 /* Does this look like a cellar to you? */
8 struct storage_header
{
9 BYTE magic
[8]; /* 00: magic */
10 BYTE unknown1
[36]; /* 08: unknown */
11 DWORD num_of_bbd_blocks
;/* 2C: length of big datablocks */
12 DWORD root_startblock
;/* 30: root storage first big block */
13 DWORD unknown2
[2]; /* 34: unknown */
14 DWORD sbd_startblock
; /* 3C: small block depot first big block */
15 DWORD unknown3
[3]; /* 40: unknown */
16 DWORD bbd_list
[109]; /* 4C: big data block list (up to end of sector)*/
18 struct storage_pps_entry
{
19 WCHAR pps_rawname
[32];/* 00: \0 terminated widechar name */
20 WORD pps_sizeofname
; /* 40: namelength in bytes */
21 BYTE pps_type
; /* 42: flags, 1 storage/dir, 2 stream, 5 root */
22 BYTE pps_unknown0
; /* 43: unknown */
23 DWORD pps_prev
; /* 44: previous pps */
24 DWORD pps_next
; /* 48: next pps */
25 DWORD pps_dir
; /* 4C: directory pps */
26 GUID pps_guid
; /* 50: class ID */
27 DWORD pps_unknown1
; /* 60: unknown */
28 FILETIME pps_ft1
; /* 64: filetime1 */
29 FILETIME pps_ft2
; /* 70: filetime2 */
30 DWORD pps_sb
; /* 74: data startblock */
31 DWORD pps_size
; /* 78: datalength. (<0x1000)?small:big blocks*/
32 DWORD pps_unknown2
; /* 7C: unknown */
35 #define STORAGE_CHAINENTRY_FAT 0xfffffffd
36 #define STORAGE_CHAINENTRY_ENDOFCHAIN 0xfffffffe
37 #define STORAGE_CHAINENTRY_FREE 0xffffffff
39 typedef LPOLESTR16
*SNB16
;
40 typedef LPOLESTR32
*SNB32
;
41 DECL_WINELIB_TYPE(SNB
)
43 typedef struct IStorage16 IStorage16
,*LPSTORAGE16
;
44 typedef struct IStorage32 IStorage32
,*LPSTORAGE32
;
45 typedef struct IStream16 IStream16
,*LPSTREAM16
;
46 typedef struct IStream32 IStream32
,*LPSTREAM32
;
48 typedef struct IEnumSTATSTG IEnumSTATSTG
,*LPENUMSTATSTG
;
53 ULARGE_INTEGER cbSize
;
58 DWORD grfLocksSupported
;
64 #define STGM_DIRECT 0x00000000
65 #define STGM_TRANSACTED 0x00010000
66 #define STGM_SIMPLE 0x08000000
67 #define STGM_READ 0x00000000
68 #define STGM_WRITE 0x00000001
69 #define STGM_READWRITE 0x00000002
70 #define STGM_SHARE_DENY_NONE 0x00000040
71 #define STGM_SHARE_DENY_READ 0x00000030
72 #define STGM_SHARE_DENY_WRITE 0x00000020
73 #define STGM_SHARE_EXCLUSIVE 0x00000010
74 #define STGM_PRIORITY 0x00040000
75 #define STGM_DELETEONRELEASE 0x04000000
76 #define STGM_NOSCRATCH 0x00100000
77 #define STGM_CREATE 0x00001000
78 #define STGM_CONVERT 0x00020000
79 #define STGM_FAILIFTHERE 0x00000000
82 /*****************************************************************************
83 * IStorage16 interface
85 #define ICOM_INTERFACE IStorage16
86 ICOM_BEGIN(IStorage16
,IUnknown
)
87 ICOM_METHOD5(HRESULT
,CreateStream
, LPCOLESTR16
,pwcsName
, DWORD
,grfMode
, DWORD
,reserved1
, DWORD
,reserved2
, IStream16
**,ppstm
)
88 ICOM_METHOD5(HRESULT
,OpenStream
, LPCOLESTR16
,pwcsName
, void*,reserved1
, DWORD
,grfMode
, DWORD
,reserved2
, IStream16
**,ppstm
)
89 ICOM_METHOD5(HRESULT
,CreateStorage
, LPCOLESTR16
,pwcsName
, DWORD
,grfMode
, DWORD
,dwStgFmt
, DWORD
,reserved2
, IStorage16
**,ppstg
)
90 ICOM_METHOD6(HRESULT
,OpenStorage
, LPCOLESTR16
,pwcsName
, IStorage16
*,pstgPriority
, DWORD
,grfMode
, SNB16
,snb16Exclude
, DWORD
,reserved
, IStorage16
**,ppstg
)
91 ICOM_METHOD4(HRESULT
,CopyTo
, DWORD
,ciidExclude
, const IID
*,rgiidExclude
, SNB16
,snb16Exclude
, IStorage16
*,pstgDest
)
92 ICOM_METHOD4(HRESULT
,MoveElementTo
, LPCOLESTR16
,pwcsName
, IStorage16
*,pstgDest
, LPCOLESTR16
,pwcsNewName
, DWORD
,grfFlags
)
93 ICOM_METHOD1(HRESULT
,Commit
, DWORD
,grfCommitFlags
)
94 ICOM_METHOD (HRESULT
,Revert
)
95 ICOM_METHOD4(HRESULT
,EnumElements
, DWORD
,reserved1
, void*,reserved2
, DWORD
,reserved3
, IEnumSTATSTG
**,ppenum
)
96 ICOM_METHOD1(HRESULT
,DestroyElement
, LPCOLESTR16
,pwcsName
)
97 ICOM_METHOD2(HRESULT
,RenameElement
, LPCOLESTR16
,pwcsOldName
, LPCOLESTR16
,pwcsNewName
)
98 ICOM_METHOD4(HRESULT
,SetElementTimes
,LPCOLESTR16
,pwcsName
, const FILETIME
*,pctime
, const FILETIME
*,patime
, const FILETIME
*,pmtime
)
99 ICOM_METHOD1(HRESULT
,SetClass
, REFCLSID
,clsid
)
100 ICOM_METHOD2(HRESULT
,SetStateBits
, DWORD
,grfStateBits
, DWORD
,grfMask
)
101 ICOM_METHOD2(HRESULT
,Stat
, STATSTG
*,pstatstg
, DWORD
,grfStatFlag
)
103 #undef ICOM_INTERFACE
105 #if !defined(__cplusplus) || defined(CINTERFACE)
106 /*** IUnknown methods ***/
107 #define IStorage16_QueryInterface(p,a,b) ICOM_ICALL2(QueryInterface,p,a,b)
108 #define IStorage16_AddRef(p) ICOM_ICALL (AddRef,p)
109 #define IStorage16_Release(p) ICOM_ICALL (Release,p)
110 /*** IStorage16 methods ***/
111 #define IStorage16_CreateStream(p,a,b,c,d,e) ICOM_CALL5(CreateStream,p,a,b,c,d,e)
112 #define IStorage16_OpenStream(p,a,b,c,d,e) ICOM_CALL5(OpenStream,p,a,b,c,d,e)
113 #define IStorage16_CreateStorage(p,a,b,c,d,e) ICOM_CALL5(CreateStorage,p,a,b,c,d,e)
114 #define IStorage16_OpenStorage(p,a,b,c,d,e,f) ICOM_CALL6(OpenStorage,p,a,b,c,d,e,f)
115 #define IStorage16_CopyTo(p,a,b,c,d) ICOM_CALL4(CopyTo,p,a,b,c,d)
116 #define IStorage16_MoveElementTo(p,a,b,c,d) ICOM_CALL4(MoveElementTo,p,a,b,c,d)
117 #define IStorage16_Commit(p,a) ICOM_CALL1(Commit,p,a)
118 #define IStorage16_Revert(p) ICOM_CALL (Revert,p)
119 #define IStorage16_EnumElements(p,a,b,c,d) ICOM_CALL4(EnumElements,p,a,b,c,d)
120 #define IStorage16_DestroyElement(p,a) ICOM_CALL1(DestroyElement,p,a)
121 #define IStorage16_RenameElement(p,a,b) ICOM_CALL2(RenameElement,p,a,b)
122 #define IStorage16_SetElementTimes(p,a,b,c,d) ICOM_CALL4(SetElementTimes,p,a,b,c,d)
123 #define IStorage16_SetClass(p,a) ICOM_CALL1(SetClass,p,a)
124 #define IStorage16_SetStateBits(p,a,b) ICOM_CALL2(SetStateBits,p,a,b)
125 #define IStorage16_Stat(p,a,b) ICOM_CALL2(Stat,p,a,b)
129 /*****************************************************************************
130 * IStorage32 interface
132 #define ICOM_INTERFACE IStorage32
133 ICOM_BEGIN(IStorage32
,IUnknown
)
134 ICOM_METHOD5(HRESULT
,CreateStream
, LPCOLESTR32
,pwcsName
, DWORD
,grfMode
, DWORD
,reserved1
, DWORD
,reserved2
, IStream32
**,ppstm
)
135 ICOM_METHOD5(HRESULT
,OpenStream
, LPCOLESTR32
,pwcsName
, void*,reserved1
, DWORD
,grfMode
, DWORD
,reserved2
, IStream32
**,ppstm
)
136 ICOM_METHOD5(HRESULT
,CreateStorage
, LPCOLESTR32
,pwcsName
, DWORD
,grfMode
, DWORD
,dwStgFmt
, DWORD
,reserved2
, IStorage32
**,ppstg
)
137 ICOM_METHOD6(HRESULT
,OpenStorage
, LPCOLESTR32
,pwcsName
, IStorage32
*,pstgPriority
, DWORD
,grfMode
, SNB32
,snb16Exclude
, DWORD
,reserved
, IStorage32
**,ppstg
)
138 ICOM_METHOD4(HRESULT
,CopyTo
, DWORD
,ciidExclude
, const IID
*,rgiidExclude
, SNB32
,snb16Exclude
, IStorage32
*,pstgDest
)
139 ICOM_METHOD4(HRESULT
,MoveElementTo
, LPCOLESTR32
,pwcsName
, IStorage32
*,pstgDest
, LPCOLESTR32
,pwcsNewName
, DWORD
,grfFlags
)
140 ICOM_METHOD1(HRESULT
,Commit
, DWORD
,grfCommitFlags
)
141 ICOM_METHOD (HRESULT
,Revert
)
142 ICOM_METHOD4(HRESULT
,EnumElements
, DWORD
,reserved1
, void*,reserved2
, DWORD
,reserved3
, IEnumSTATSTG
**,ppenum
)
143 ICOM_METHOD1(HRESULT
,DestroyElement
, LPCOLESTR32
,pwcsName
)
144 ICOM_METHOD2(HRESULT
,RenameElement
, LPCOLESTR32
,pwcsOldName
, LPCOLESTR32
,pwcsNewName
)
145 ICOM_METHOD4(HRESULT
,SetElementTimes
,LPCOLESTR32
,pwcsName
, const FILETIME
*,pctime
, const FILETIME
*,patime
, const FILETIME
*,pmtime
)
146 ICOM_METHOD1(HRESULT
,SetClass
, REFCLSID
,clsid
)
147 ICOM_METHOD2(HRESULT
,SetStateBits
, DWORD
,grfStateBits
, DWORD
,grfMask
)
148 ICOM_METHOD2(HRESULT
,Stat
, STATSTG
*,pstatstg
, DWORD
,grfStatFlag
)
150 #undef ICOM_INTERFACE
152 #if !defined(__cplusplus) || defined(CINTERFACE)
153 /*** IUnknown methods ***/
154 #define IStorage32_QueryInterface(p,a,b) ICOM_ICALL2(QueryInterface,p,a,b)
155 #define IStorage32_AddRef(p) ICOM_ICALL (AddRef,p)
156 #define IStorage32_Release(p) ICOM_ICALL (Release,p)
157 /*** IStorage32 methods ***/
158 #define IStorage32_CreateStream(p,a,b,c,d,e) ICOM_CALL5(CreateStream,p,a,b,c,d,e)
159 #define IStorage32_OpenStream(p,a,b,c,d,e) ICOM_CALL5(OpenStream,p,a,b,c,d,e)
160 #define IStorage32_CreateStorage(p,a,b,c,d,e) ICOM_CALL5(CreateStorage,p,a,b,c,d,e)
161 #define IStorage32_OpenStorage(p,a,b,c,d,e,f) ICOM_CALL6(OpenStorage,p,a,b,c,d,e,f)
162 #define IStorage32_CopyTo(p,a,b,c,d) ICOM_CALL4(CopyTo,p,a,b,c,d)
163 #define IStorage32_MoveElementTo(p,a,b,c,d) ICOM_CALL4(MoveElementTo,p,a,b,c,d)
164 #define IStorage32_Commit(p,a) ICOM_CALL1(Commit,p,a)
165 #define IStorage32_Revert(p) ICOM_CALL (Revert,p)
166 #define IStorage32_EnumElements(p,a,b,c,d) ICOM_CALL4(EnumElements,p,a,b,c,d)
167 #define IStorage32_DestroyElement(p,a) ICOM_CALL1(DestroyElement,p,a)
168 #define IStorage32_RenameElement(p,a,b) ICOM_CALL2(RenameElement,p,a,b)
169 #define IStorage32_SetElementTimes(p,a,b,c,d) ICOM_CALL4(SetElementTimes,p,a,b,c,d)
170 #define IStorage32_SetClass(p,a) ICOM_CALL1(SetClass,p,a)
171 #define IStorage32_SetStateBits(p,a,b) ICOM_CALL2(SetStateBits,p,a,b)
172 #define IStorage32_Stat(p,a,b) ICOM_CALL2(Stat,p,a,b)
176 /*****************************************************************************
177 * IStream16 interface
179 #define ICOM_INTERFACE IStream16
180 ICOM_BEGIN(IStream16
,IUnknown
)
181 ICOM_METHOD3(HRESULT
,Read
, void*,pv
, ULONG
,cb
, ULONG
*,pcbRead
)
182 ICOM_METHOD3(HRESULT
,Write
, const void*,pv
, ULONG
,cb
, ULONG
*,pcbWritten
)
183 ICOM_METHOD3(HRESULT
,Seek
, LARGE_INTEGER
,dlibMove
, DWORD
,dwOrigin
, ULARGE_INTEGER
*,plibNewPosition
)
184 ICOM_METHOD1(HRESULT
,SetSize
, ULARGE_INTEGER
,libNewSize
)
185 ICOM_METHOD4(HRESULT
,CopyTo
, IStream16
*,pstm
, ULARGE_INTEGER
,cb
, ULARGE_INTEGER
*,pcbRead
, ULARGE_INTEGER
*,pcbWritten
)
186 ICOM_METHOD1(HRESULT
,Commit
, DWORD
,grfCommitFlags
)
187 ICOM_METHOD (HRESULT
,Revert
)
188 ICOM_METHOD3(HRESULT
,LockRegion
, ULARGE_INTEGER
,libOffset
, ULARGE_INTEGER
,cb
, DWORD
,dwLockType
)
189 ICOM_METHOD3(HRESULT
,UnlockRegion
,ULARGE_INTEGER
,libOffset
, ULARGE_INTEGER
,cb
, DWORD
,dwLockType
)
190 ICOM_METHOD2(HRESULT
,Stat
, STATSTG
*,pstatstg
, DWORD
,grfStatFlag
)
191 ICOM_METHOD1(HRESULT
,Clone
, IStream16
**,ppstm
)
193 #undef ICOM_INTERFACE
195 #if !defined(__cplusplus) || defined(CINTERFACE)
196 /*** IUnknown methods ***/
197 #define IStream16_QueryInterface(p,a,b) ICOM_ICALL2(QueryInterface,p,a,b)
198 #define IStream16_AddRef(p) ICOM_ICALL (AddRef,p)
199 #define IStream16_Release(p) ICOM_ICALL (Release,p)
200 /*** IStream16 methods ***/
201 #define IStream16_Read(p,a,b,c) ICOM_CALL3(Read,p,a,b,c)
202 #define IStream16_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c)
203 #define IStream16_Seek(p) ICOM_CALL3(Seek,p)
204 #define IStream16_SetSize(p,a,b) ICOM_CALL1(SetSize,p,a,b)
205 #define IStream16_CopyTo(pa,b,c,d) ICOM_CALL4(CopyTo,pa,b,c,d)
206 #define IStream16_Commit(p,a) ICOM_CALL1(Commit,p,a)
207 #define IStream16_Revert(p) ICOM_CALL (Revert,p)
208 #define IStream16_LockRegion(pa,b,c) ICOM_CALL3(LockRegion,pa,b,c)
209 #define IStream16_UnlockRegion(p,a,b,c) ICOM_CALL3(UnlockRegion,p,a,b,c)
210 #define IStream16_Stat(p,a,b) ICOM_CALL2(Stat,p,a,b)
211 #define IStream16_Clone(p,a) ICOM_CALL1(Clone,p,a)
215 /*****************************************************************************
216 * IStream32 interface
218 #define ICOM_INTERFACE IStream32
219 ICOM_BEGIN(IStream32
,IUnknown
)
220 ICOM_METHOD3(HRESULT
,Read
, void*,pv
, ULONG
,cb
, ULONG
*,pcbRead
)
221 ICOM_METHOD3(HRESULT
,Write
, const void*,pv
, ULONG
,cb
, ULONG
*,pcbWritten
)
222 ICOM_METHOD3(HRESULT
,Seek
, LARGE_INTEGER
,dlibMove
, DWORD
,dwOrigin
, ULARGE_INTEGER
*,plibNewPosition
)
223 ICOM_METHOD1(HRESULT
,SetSize
, ULARGE_INTEGER
,libNewSize
)
224 ICOM_METHOD4(HRESULT
,CopyTo
, IStream32
*,pstm
, ULARGE_INTEGER
,cb
, ULARGE_INTEGER
*,pcbRead
, ULARGE_INTEGER
*,pcbWritten
)
225 ICOM_METHOD1(HRESULT
,Commit
, DWORD
,grfCommitFlags
)
226 ICOM_METHOD (HRESULT
,Revert
)
227 ICOM_METHOD3(HRESULT
,LockRegion
, ULARGE_INTEGER
,libOffset
, ULARGE_INTEGER
,cb
, DWORD
,dwLockType
)
228 ICOM_METHOD3(HRESULT
,UnlockRegion
,ULARGE_INTEGER
,libOffset
, ULARGE_INTEGER
,cb
, DWORD
,dwLockType
)
229 ICOM_METHOD2(HRESULT
,Stat
, STATSTG
*,pstatstg
, DWORD
,grfStatFlag
)
230 ICOM_METHOD1(HRESULT
,Clone
, IStream32
**,ppstm
)
232 #undef ICOM_INTERFACE
234 #if !defined(__cplusplus) || defined(CINTERFACE)
235 /*** IUnknown methods ***/
236 #define IStream32_QueryInterface(p,a,b) ICOM_ICALL2(QueryInterface,p,a,b)
237 #define IStream32_AddRef(p) ICOM_ICALL (AddRef,p)
238 #define IStream32_Release(p) ICOM_ICALL (Release,p)
239 /*** IStream32 methods ***/
240 #define IStream32_Read(p,a,b,c) ICOM_CALL3(Read,p,a,b,c)
241 #define IStream32_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c)
242 #define IStream32_Seek(p) ICOM_CALL3(Seek,p)
243 #define IStream32_SetSize(p,a,b) ICOM_CALL1(SetSize,p,a,b)
244 #define IStream32_CopyTo(pa,b,c,d) ICOM_CALL4(CopyTo,pa,b,c,d)
245 #define IStream32_Commit(p,a) ICOM_CALL1(Commit,p,a)
246 #define IStream32_Revert(p) ICOM_CALL (Revert,p)
247 #define IStream32_LockRegion(pa,b,c) ICOM_CALL3(LockRegion,pa,b,c)
248 #define IStream32_UnlockRegion(p,a,b,c) ICOM_CALL3(UnlockRegion,p,a,b,c)
249 #define IStream32_Stat(p,a,b) ICOM_CALL2(Stat,p,a,b)
250 #define IStream32_Clone(p,a) ICOM_CALL1(Clone,p,a)