ole32/tests: Use proper helpers for iface calls.
[wine] / dlls / ole32 / storage32.h
1 /*
2  * Compound Storage (32 bit version)
3  *
4  * Implemented using the documentation of the LAOLA project at
5  * <URL:http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/index.html>
6  * (Thanks to Martin Schwartz <schwartz@cs.tu-berlin.de>)
7  *
8  * This include file contains definitions of types and function
9  * prototypes that are used in the many files implementing the
10  * storage functionality
11  *
12  * Copyright 1998,1999 Francis Beaudet
13  * Copyright 1998,1999 Thuy Nguyen
14  * Copyright 2010 Vincent Povirk for CodeWeavers
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29  */
30 #ifndef __STORAGE32_H__
31 #define __STORAGE32_H__
32
33 #include <stdarg.h>
34
35 #include "windef.h"
36 #include "winbase.h"
37 #include "winnt.h"
38 #include "objbase.h"
39 #include "winreg.h"
40 #include "winternl.h"
41 #include "wine/list.h"
42
43 /*
44  * Definitions for the file format offsets.
45  */
46 static const ULONG OFFSET_MINORVERSION       = 0x00000018;
47 static const ULONG OFFSET_MAJORVERSION       = 0x0000001a;
48 static const ULONG OFFSET_BYTEORDERMARKER    = 0x0000001c;
49 static const ULONG OFFSET_BIGBLOCKSIZEBITS   = 0x0000001e;
50 static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020;
51 static const ULONG OFFSET_DIRSECTORCOUNT     = 0x00000028;
52 static const ULONG OFFSET_BBDEPOTCOUNT       = 0x0000002C;
53 static const ULONG OFFSET_ROOTSTARTBLOCK     = 0x00000030;
54 static const ULONG OFFSET_SMALLBLOCKLIMIT    = 0x00000038;
55 static const ULONG OFFSET_SBDEPOTSTART       = 0x0000003C;
56 static const ULONG OFFSET_SBDEPOTCOUNT       = 0x00000040;
57 static const ULONG OFFSET_EXTBBDEPOTSTART    = 0x00000044;
58 static const ULONG OFFSET_EXTBBDEPOTCOUNT    = 0x00000048;
59 static const ULONG OFFSET_BBDEPOTSTART       = 0x0000004C;
60 static const ULONG OFFSET_PS_NAME            = 0x00000000;
61 static const ULONG OFFSET_PS_NAMELENGTH      = 0x00000040;
62 static const ULONG OFFSET_PS_STGTYPE         = 0x00000042;
63 static const ULONG OFFSET_PS_LEFTCHILD       = 0x00000044;
64 static const ULONG OFFSET_PS_RIGHTCHILD      = 0x00000048;
65 static const ULONG OFFSET_PS_DIRROOT         = 0x0000004C;
66 static const ULONG OFFSET_PS_GUID            = 0x00000050;
67 static const ULONG OFFSET_PS_CTIMELOW        = 0x00000064;
68 static const ULONG OFFSET_PS_CTIMEHIGH       = 0x00000068;
69 static const ULONG OFFSET_PS_MTIMELOW        = 0x0000006C;
70 static const ULONG OFFSET_PS_MTIMEHIGH       = 0x00000070;
71 static const ULONG OFFSET_PS_STARTBLOCK      = 0x00000074;
72 static const ULONG OFFSET_PS_SIZE            = 0x00000078;
73 static const WORD  DEF_BIG_BLOCK_SIZE_BITS   = 0x0009;
74 static const WORD  MIN_BIG_BLOCK_SIZE_BITS   = 0x0009;
75 static const WORD  MAX_BIG_BLOCK_SIZE_BITS   = 0x000c;
76 static const WORD  DEF_SMALL_BLOCK_SIZE_BITS = 0x0006;
77 static const WORD  DEF_BIG_BLOCK_SIZE        = 0x0200;
78 static const WORD  DEF_SMALL_BLOCK_SIZE      = 0x0040;
79 static const ULONG BLOCK_EXTBBDEPOT          = 0xFFFFFFFC;
80 static const ULONG BLOCK_SPECIAL             = 0xFFFFFFFD;
81 static const ULONG BLOCK_END_OF_CHAIN        = 0xFFFFFFFE;
82 static const ULONG BLOCK_UNUSED              = 0xFFFFFFFF;
83 static const ULONG DIRENTRY_NULL             = 0xFFFFFFFF;
84
85 #define DIRENTRY_NAME_MAX_LEN    0x20
86 #define DIRENTRY_NAME_BUFFER_LEN 0x40
87
88 #define RAW_DIRENTRY_SIZE 0x00000080
89
90 #define HEADER_SIZE 512
91
92 #define MIN_BIG_BLOCK_SIZE 0x200
93 #define MAX_BIG_BLOCK_SIZE 0x1000
94
95 /*
96  * Type of child entry link
97  */
98 #define DIRENTRY_RELATION_PREVIOUS 0
99 #define DIRENTRY_RELATION_NEXT     1
100 #define DIRENTRY_RELATION_DIR      2
101
102 /*
103  * type constant used in files for the root storage
104  */
105 #define STGTY_ROOT 0x05
106
107 #define COUNT_BBDEPOTINHEADER    109
108
109 /* FIXME: This value is stored in the header, but we hard-code it to 0x1000. */
110 #define LIMIT_TO_USE_SMALL_BLOCK 0x1000
111
112 #define STGM_ACCESS_MODE(stgm)   ((stgm)&0x0000f)
113 #define STGM_SHARE_MODE(stgm)    ((stgm)&0x000f0)
114 #define STGM_CREATE_MODE(stgm)   ((stgm)&0x0f000)
115
116 #define STGM_KNOWN_FLAGS (0xf0ff | \
117      STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \
118      STGM_NOSNAPSHOT | STGM_DIRECT_SWMR | STGM_DELETEONRELEASE | STGM_SIMPLE)
119
120 /*
121  * Forward declarations of all the structures used by the storage
122  * module.
123  */
124 typedef struct StorageBaseImpl     StorageBaseImpl;
125 typedef struct StorageBaseImplVtbl StorageBaseImplVtbl;
126 typedef struct StorageImpl         StorageImpl;
127 typedef struct BlockChainStream      BlockChainStream;
128 typedef struct SmallBlockChainStream SmallBlockChainStream;
129 typedef struct IEnumSTATSTGImpl      IEnumSTATSTGImpl;
130 typedef struct DirEntry              DirEntry;
131 typedef struct StgStreamImpl         StgStreamImpl;
132
133 /*
134  * A reference to a directory entry in the file or a transacted cache.
135  */
136 typedef ULONG DirRef;
137
138 /*
139  * This utility structure is used to read/write the information in a directory
140  * entry.
141  */
142 struct DirEntry
143 {
144   WCHAR          name[DIRENTRY_NAME_MAX_LEN];
145   WORD           sizeOfNameString;
146   BYTE           stgType;
147   DirRef         leftChild;
148   DirRef         rightChild;
149   DirRef         dirRootEntry;
150   GUID           clsid;
151   FILETIME       ctime;
152   FILETIME       mtime;
153   ULONG          startingBlock;
154   ULARGE_INTEGER size;
155 };
156
157 HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN;
158
159 /*************************************************************************
160  * Ole Convert support
161  */
162
163 HRESULT STORAGE_CreateOleStream(IStorage*, DWORD) DECLSPEC_HIDDEN;
164 HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName) DECLSPEC_HIDDEN;
165
166
167 /****************************************************************************
168  * StorageBaseImpl definitions.
169  *
170  * This structure defines the base information contained in all implementations
171  * of IStorage contained in this file storage implementation.
172  *
173  * In OOP terms, this is the base class for all the IStorage implementations
174  * contained in this file.
175  */
176 struct StorageBaseImpl
177 {
178   IStorage IStorage_iface;
179   IPropertySetStorage IPropertySetStorage_iface; /* interface for adding a properties stream */
180   LONG ref;
181
182   /*
183    * Stream tracking list
184    */
185
186   struct list strmHead;
187
188   /*
189    * Storage tracking list
190    */
191   struct list storageHead;
192
193   /*
194    * TRUE if this object has been invalidated
195    */
196   int reverted;
197
198   /*
199    * Index of the directory entry of this storage
200    */
201   DirRef storageDirEntry;
202
203   /*
204    * virtual methods.
205    */
206   const StorageBaseImplVtbl *baseVtbl;
207
208   /*
209    * flags that this storage was opened or created with
210    */
211   DWORD openFlags;
212
213   /*
214    * State bits appear to only be preserved while running. No in the stream
215    */
216   DWORD stateBits;
217
218   BOOL             create;     /* Was the storage created or opened.
219                                   The behaviour of STGM_SIMPLE depends on this */
220   /*
221    * If this storage was opened in transacted mode, the object that implements
222    * the transacted snapshot or cache.
223    */
224   StorageBaseImpl *transactedChild;
225 };
226
227 /* virtual methods for StorageBaseImpl objects */
228 struct StorageBaseImplVtbl {
229   void (*Destroy)(StorageBaseImpl*);
230   void (*Invalidate)(StorageBaseImpl*);
231   HRESULT (*Flush)(StorageBaseImpl*);
232   HRESULT (*GetFilename)(StorageBaseImpl*,LPWSTR*);
233   HRESULT (*CreateDirEntry)(StorageBaseImpl*,const DirEntry*,DirRef*);
234   HRESULT (*WriteDirEntry)(StorageBaseImpl*,DirRef,const DirEntry*);
235   HRESULT (*ReadDirEntry)(StorageBaseImpl*,DirRef,DirEntry*);
236   HRESULT (*DestroyDirEntry)(StorageBaseImpl*,DirRef);
237   HRESULT (*StreamReadAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,void*,ULONG*);
238   HRESULT (*StreamWriteAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,const void*,ULONG*);
239   HRESULT (*StreamSetSize)(StorageBaseImpl*,DirRef,ULARGE_INTEGER);
240   HRESULT (*StreamLink)(StorageBaseImpl*,DirRef,DirRef);
241 };
242
243 static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This)
244 {
245   This->baseVtbl->Destroy(This);
246 }
247
248 static inline void StorageBaseImpl_Invalidate(StorageBaseImpl *This)
249 {
250   This->baseVtbl->Invalidate(This);
251 }
252
253 static inline HRESULT StorageBaseImpl_Flush(StorageBaseImpl *This)
254 {
255   return This->baseVtbl->Flush(This);
256 }
257
258 static inline HRESULT StorageBaseImpl_GetFilename(StorageBaseImpl *This, LPWSTR *result)
259 {
260   return This->baseVtbl->GetFilename(This, result);
261 }
262
263 static inline HRESULT StorageBaseImpl_CreateDirEntry(StorageBaseImpl *This,
264   const DirEntry *newData, DirRef *index)
265 {
266   return This->baseVtbl->CreateDirEntry(This, newData, index);
267 }
268
269 static inline HRESULT StorageBaseImpl_WriteDirEntry(StorageBaseImpl *This,
270   DirRef index, const DirEntry *data)
271 {
272   return This->baseVtbl->WriteDirEntry(This, index, data);
273 }
274
275 static inline HRESULT StorageBaseImpl_ReadDirEntry(StorageBaseImpl *This,
276   DirRef index, DirEntry *data)
277 {
278   return This->baseVtbl->ReadDirEntry(This, index, data);
279 }
280
281 static inline HRESULT StorageBaseImpl_DestroyDirEntry(StorageBaseImpl *This,
282   DirRef index)
283 {
284   return This->baseVtbl->DestroyDirEntry(This, index);
285 }
286
287 /* Read up to size bytes from this directory entry's stream at the given offset. */
288 static inline HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This,
289   DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
290 {
291   return This->baseVtbl->StreamReadAt(This, index, offset, size, buffer, bytesRead);
292 }
293
294 /* Write size bytes to this directory entry's stream at the given offset,
295  * growing the stream if necessary. */
296 static inline HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This,
297   DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
298 {
299   return This->baseVtbl->StreamWriteAt(This, index, offset, size, buffer, bytesWritten);
300 }
301
302 static inline HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This,
303   DirRef index, ULARGE_INTEGER newsize)
304 {
305   return This->baseVtbl->StreamSetSize(This, index, newsize);
306 }
307
308 /* Make dst point to the same stream that src points to. Other stream operations
309  * will not work properly for entries that point to the same stream, so this
310  * must be a very temporary state, and only one entry pointing to a given stream
311  * may be reachable at any given time. */
312 static inline HRESULT StorageBaseImpl_StreamLink(StorageBaseImpl *This,
313   DirRef dst, DirRef src)
314 {
315   return This->baseVtbl->StreamLink(This, dst, src);
316 }
317
318 /****************************************************************************
319  * StorageBaseImpl stream list handlers
320  */
321
322 void StorageBaseImpl_AddStream(StorageBaseImpl * stg, StgStreamImpl * strm) DECLSPEC_HIDDEN;
323 void StorageBaseImpl_RemoveStream(StorageBaseImpl * stg, StgStreamImpl * strm) DECLSPEC_HIDDEN;
324
325 /* Number of BlockChainStream objects to cache in a StorageImpl */
326 #define BLOCKCHAIN_CACHE_SIZE 4
327
328 /****************************************************************************
329  * Storage32Impl definitions.
330  *
331  * This implementation of the IStorage32 interface represents a root
332  * storage. Basically, a document file.
333  */
334 struct StorageImpl
335 {
336   struct StorageBaseImpl base;
337
338   /*
339    * File header
340    */
341   WORD  bigBlockSizeBits;
342   WORD  smallBlockSizeBits;
343   ULONG bigBlockSize;
344   ULONG smallBlockSize;
345   ULONG bigBlockDepotCount;
346   ULONG rootStartBlock;
347   ULONG smallBlockLimit;
348   ULONG smallBlockDepotStart;
349   ULONG extBigBlockDepotStart;
350   ULONG *extBigBlockDepotLocations;
351   ULONG extBigBlockDepotLocationsSize;
352   ULONG extBigBlockDepotCount;
353   ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER];
354
355   ULONG extBlockDepotCached[MAX_BIG_BLOCK_SIZE / 4];
356   ULONG indexExtBlockDepotCached;
357
358   ULONG blockDepotCached[MAX_BIG_BLOCK_SIZE / 4];
359   ULONG indexBlockDepotCached;
360   ULONG prevFreeBlock;
361
362   /* All small blocks before this one are known to be in use. */
363   ULONG firstFreeSmallBlock;
364
365   /*
366    * Abstraction of the big block chains for the chains of the header.
367    */
368   BlockChainStream* rootBlockChain;
369   BlockChainStream* smallBlockDepotChain;
370   BlockChainStream* smallBlockRootChain;
371
372   /* Cache of block chain streams objects for directory entries */
373   BlockChainStream* blockChainCache[BLOCKCHAIN_CACHE_SIZE];
374   UINT blockChainToEvict;
375
376   ILockBytes* lockBytes;
377 };
378
379 HRESULT StorageImpl_ReadRawDirEntry(
380             StorageImpl *This,
381             ULONG index,
382             BYTE *buffer) DECLSPEC_HIDDEN;
383
384 void UpdateRawDirEntry(
385     BYTE *buffer,
386     const DirEntry *newData) DECLSPEC_HIDDEN;
387
388 HRESULT StorageImpl_WriteRawDirEntry(
389             StorageImpl *This,
390             ULONG index,
391             const BYTE *buffer) DECLSPEC_HIDDEN;
392
393 HRESULT StorageImpl_ReadDirEntry(
394             StorageImpl*    This,
395             DirRef          index,
396             DirEntry*       buffer) DECLSPEC_HIDDEN;
397
398 HRESULT StorageImpl_WriteDirEntry(
399             StorageImpl*        This,
400             DirRef              index,
401             const DirEntry*     buffer) DECLSPEC_HIDDEN;
402
403 BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
404                       StorageImpl* This,
405                       SmallBlockChainStream** ppsbChain) DECLSPEC_HIDDEN;
406
407 SmallBlockChainStream* Storage32Impl_BigBlocksToSmallBlocks(
408                       StorageImpl* This,
409                       BlockChainStream** ppbbChain,
410                       ULARGE_INTEGER newSize) DECLSPEC_HIDDEN;
411
412 /****************************************************************************
413  * StgStreamImpl definitions.
414  *
415  * This class implements the IStream interface and represents a stream
416  * located inside a storage object.
417  */
418 struct StgStreamImpl
419 {
420   IStream IStream_iface;
421   LONG ref;
422
423   /*
424    * We are an entry in the storage object's stream handler list
425    */
426   struct list StrmListEntry;
427
428   /*
429    * Storage that is the parent(owner) of the stream
430    */
431   StorageBaseImpl* parentStorage;
432
433   /*
434    * Access mode of this stream.
435    */
436   DWORD grfMode;
437
438   /*
439    * Index of the directory entry that owns (points to) this stream.
440    */
441   DirRef             dirEntry;
442
443   /*
444    * This is the current position of the cursor in the stream
445    */
446   ULARGE_INTEGER     currentPosition;
447 };
448
449 static inline StgStreamImpl *impl_from_IStream( IStream *iface )
450 {
451     return CONTAINING_RECORD(iface, StgStreamImpl, IStream_iface);
452 }
453
454 /*
455  * Method definition for the StgStreamImpl class.
456  */
457 StgStreamImpl* StgStreamImpl_Construct(
458                 StorageBaseImpl* parentStorage,
459     DWORD            grfMode,
460     DirRef           dirEntry) DECLSPEC_HIDDEN;
461
462
463 /******************************************************************************
464  * Endian conversion macros
465  */
466 #ifdef WORDS_BIGENDIAN
467
468 #define htole32(x) RtlUlongByteSwap(x)
469 #define htole16(x) RtlUshortByteSwap(x)
470 #define lendian32toh(x) RtlUlongByteSwap(x)
471 #define lendian16toh(x) RtlUshortByteSwap(x)
472
473 #else
474
475 #define htole32(x) (x)
476 #define htole16(x) (x)
477 #define lendian32toh(x) (x)
478 #define lendian16toh(x) (x)
479
480 #endif
481
482 /******************************************************************************
483  * The StorageUtl_ functions are miscellaneous utility functions. Most of which
484  * are abstractions used to read values from file buffers without having to
485  * worry about bit order
486  */
487 void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN;
488 void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN;
489 void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN;
490 void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN;
491 void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
492  ULARGE_INTEGER* value) DECLSPEC_HIDDEN;
493 void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
494  const ULARGE_INTEGER *value) DECLSPEC_HIDDEN;
495 void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN;
496 void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN;
497 void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
498  const DirEntry* source, int statFlags) DECLSPEC_HIDDEN;
499
500 /****************************************************************************
501  * BlockChainStream definitions.
502  *
503  * The BlockChainStream class is a utility class that is used to create an
504  * abstraction of the big block chains in the storage file.
505  */
506 struct BlockChainRun
507 {
508   /* This represents a range of blocks that happen reside in consecutive sectors. */
509   ULONG firstSector;
510   ULONG firstOffset;
511   ULONG lastOffset;
512 };
513
514 typedef struct BlockChainBlock
515 {
516   ULONG index;
517   ULONG sector;
518   int read;
519   int dirty;
520   BYTE data[MAX_BIG_BLOCK_SIZE];
521 } BlockChainBlock;
522
523 struct BlockChainStream
524 {
525   StorageImpl* parentStorage;
526   ULONG*       headOfStreamPlaceHolder;
527   DirRef       ownerDirEntry;
528   struct BlockChainRun* indexCache;
529   ULONG        indexCacheLen;
530   ULONG        indexCacheSize;
531   BlockChainBlock cachedBlocks[2];
532   ULONG        blockToEvict;
533   ULONG        tailIndex;
534   ULONG        numBlocks;
535 };
536
537 /*
538  * Methods for the BlockChainStream class.
539  */
540 BlockChainStream* BlockChainStream_Construct(
541                 StorageImpl* parentStorage,
542                 ULONG*         headOfStreamPlaceHolder,
543                 DirRef         dirEntry) DECLSPEC_HIDDEN;
544
545 void BlockChainStream_Destroy(
546                 BlockChainStream* This) DECLSPEC_HIDDEN;
547
548 HRESULT BlockChainStream_ReadAt(
549                 BlockChainStream* This,
550                 ULARGE_INTEGER offset,
551                 ULONG          size,
552                 void*          buffer,
553                 ULONG*         bytesRead) DECLSPEC_HIDDEN;
554
555 HRESULT BlockChainStream_WriteAt(
556                 BlockChainStream* This,
557                 ULARGE_INTEGER offset,
558                 ULONG          size,
559                 const void*    buffer,
560                 ULONG*         bytesWritten) DECLSPEC_HIDDEN;
561
562 BOOL BlockChainStream_SetSize(
563                 BlockChainStream* This,
564                 ULARGE_INTEGER    newSize) DECLSPEC_HIDDEN;
565
566 HRESULT BlockChainStream_Flush(
567                 BlockChainStream* This) DECLSPEC_HIDDEN;
568
569 /****************************************************************************
570  * SmallBlockChainStream definitions.
571  *
572  * The SmallBlockChainStream class is a utility class that is used to create an
573  * abstraction of the small block chains in the storage file.
574  */
575 struct SmallBlockChainStream
576 {
577   StorageImpl* parentStorage;
578   DirRef         ownerDirEntry;
579   ULONG*         headOfStreamPlaceHolder;
580 };
581
582 /*
583  * Methods of the SmallBlockChainStream class.
584  */
585 SmallBlockChainStream* SmallBlockChainStream_Construct(
586            StorageImpl*   parentStorage,
587            ULONG*         headOfStreamPlaceHolder,
588            DirRef         dirEntry) DECLSPEC_HIDDEN;
589
590 void SmallBlockChainStream_Destroy(
591                SmallBlockChainStream* This) DECLSPEC_HIDDEN;
592
593 HRESULT SmallBlockChainStream_ReadAt(
594                SmallBlockChainStream* This,
595                ULARGE_INTEGER offset,
596                ULONG          size,
597                void*          buffer,
598                ULONG*         bytesRead) DECLSPEC_HIDDEN;
599
600 HRESULT SmallBlockChainStream_WriteAt(
601                SmallBlockChainStream* This,
602                ULARGE_INTEGER offset,
603                ULONG          size,
604                const void*    buffer,
605                ULONG*         bytesWritten) DECLSPEC_HIDDEN;
606
607 BOOL SmallBlockChainStream_SetSize(
608                SmallBlockChainStream* This,
609                ULARGE_INTEGER          newSize) DECLSPEC_HIDDEN;
610
611
612 #endif /* __STORAGE32_H__ */