2 * Compound Storage (32 bit version)
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>)
8 * This include file contains definitions of types and function
9 * prototypes that are used in the many files implementing the
10 * storage functionality
12 * Copyright 1998,1999 Francis Beaudet
13 * Copyright 1998,1999 Thuy Nguyen
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef __STORAGE32_H__
30 #define __STORAGE32_H__
40 * Definitions for the file format offsets.
42 static const ULONG OFFSET_BIGBLOCKSIZEBITS = 0x0000001e;
43 static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020;
44 static const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C;
45 static const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030;
46 static const ULONG OFFSET_SBDEPOTSTART = 0x0000003C;
47 static const ULONG OFFSET_SBDEPOTCOUNT = 0x00000040;
48 static const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044;
49 static const ULONG OFFSET_EXTBBDEPOTCOUNT = 0x00000048;
50 static const ULONG OFFSET_BBDEPOTSTART = 0x0000004C;
51 static const ULONG OFFSET_PS_NAME = 0x00000000;
52 static const ULONG OFFSET_PS_NAMELENGTH = 0x00000040;
53 static const ULONG OFFSET_PS_PROPERTYTYPE = 0x00000042;
54 static const ULONG OFFSET_PS_PREVIOUSPROP = 0x00000044;
55 static const ULONG OFFSET_PS_NEXTPROP = 0x00000048;
56 static const ULONG OFFSET_PS_DIRPROP = 0x0000004C;
57 static const ULONG OFFSET_PS_GUID = 0x00000050;
58 static const ULONG OFFSET_PS_TSS1 = 0x00000064;
59 static const ULONG OFFSET_PS_TSD1 = 0x00000068;
60 static const ULONG OFFSET_PS_TSS2 = 0x0000006C;
61 static const ULONG OFFSET_PS_TSD2 = 0x00000070;
62 static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074;
63 static const ULONG OFFSET_PS_SIZE = 0x00000078;
64 static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009;
65 static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006;
66 static const WORD DEF_BIG_BLOCK_SIZE = 0x0200;
67 static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040;
68 static const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC;
69 static const ULONG BLOCK_SPECIAL = 0xFFFFFFFD;
70 static const ULONG BLOCK_END_OF_CHAIN = 0xFFFFFFFE;
71 static const ULONG BLOCK_UNUSED = 0xFFFFFFFF;
72 static const ULONG PROPERTY_NULL = 0xFFFFFFFF;
74 #define PROPERTY_NAME_MAX_LEN 0x20
75 #define PROPERTY_NAME_BUFFER_LEN 0x40
77 #define PROPSET_BLOCK_SIZE 0x00000080
80 * Property type of relation
82 #define PROPERTY_RELATION_PREVIOUS 0
83 #define PROPERTY_RELATION_NEXT 1
84 #define PROPERTY_RELATION_DIR 2
87 * Property type constants
89 #define PROPTYPE_STORAGE 0x01
90 #define PROPTYPE_STREAM 0x02
91 #define PROPTYPE_ROOT 0x05
94 * These defines assume a hardcoded blocksize. The code will assert
95 * if the blocksize is different. Some changes will have to be done if it
98 #define BIG_BLOCK_SIZE 0x200
99 #define COUNT_BBDEPOTINHEADER 109
100 #define LIMIT_TO_USE_SMALL_BLOCK 0x1000
101 #define NUM_BLOCKS_PER_DEPOT_BLOCK 128
103 #define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f)
104 #define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0)
105 #define STGM_CREATE_MODE(stgm) ((stgm)&0x0f000)
107 #define STGM_KNOWN_FLAGS (0xf0ff | \
108 STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \
109 STGM_NOSNAPSHOT | STGM_DIRECT_SWMR | STGM_DELETEONRELEASE | STGM_SIMPLE)
112 * These are signatures to detect the type of Document file.
114 static const BYTE STORAGE_magic[8] ={0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1};
115 static const BYTE STORAGE_oldmagic[8] ={0xd0,0xcf,0x11,0xe0,0x0e,0x11,0xfc,0x0d};
118 * Forward declarations of all the structures used by the storage
121 typedef struct StorageBaseImpl StorageBaseImpl;
122 typedef struct StorageImpl StorageImpl;
123 typedef struct StorageInternalImpl StorageInternalImpl;
124 typedef struct BlockChainStream BlockChainStream;
125 typedef struct SmallBlockChainStream SmallBlockChainStream;
126 typedef struct IEnumSTATSTGImpl IEnumSTATSTGImpl;
127 typedef struct StgProperty StgProperty;
128 typedef struct StgStreamImpl StgStreamImpl;
131 * This utility structure is used to read/write the information in a storage
136 WCHAR name[PROPERTY_NAME_MAX_LEN];
137 WORD sizeOfNameString;
139 ULONG previousProperty;
142 GUID propertyUniqueID;
151 /*************************************************************************
152 * Big Block File support
154 * The big block file is an abstraction of a flat file separated in
155 * same sized blocks. The implementation for the methods described in
156 * this section appear in stg_bigblockfile.c
160 * Declaration of the data structures
162 typedef struct BigBlockFile BigBlockFile,*LPBIGBLOCKFILE;
163 typedef struct MappedPage MappedPage,*LPMAPPEDPAGE;
168 ULARGE_INTEGER filesize;
174 MappedPage *victimhead, *victimtail;
175 ULONG num_victim_pages;
182 * Declaration of the functions used to manipulate the BigBlockFile
185 BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile,
190 void BIGBLOCKFILE_Destructor(LPBIGBLOCKFILE This);
191 void* BIGBLOCKFILE_GetBigBlock(LPBIGBLOCKFILE This, ULONG index);
192 void* BIGBLOCKFILE_GetROBigBlock(LPBIGBLOCKFILE This, ULONG index);
193 void BIGBLOCKFILE_ReleaseBigBlock(LPBIGBLOCKFILE This, void *pBlock);
194 void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize);
195 ULARGE_INTEGER BIGBLOCKFILE_GetSize(LPBIGBLOCKFILE This);
197 /*************************************************************************
198 * Ole Convert support
201 void OLECONVERT_CreateOleStream(LPSTORAGE pStorage);
202 HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName);
204 /****************************************************************************
205 * Storage32BaseImpl definitions.
207 * This structure defines the base information contained in all implementations
208 * of IStorage32 contained in this file storage implementation.
210 * In OOP terms, this is the base class for all the IStorage32 implementations
211 * contained in this file.
213 struct StorageBaseImpl
215 IStorageVtbl *lpVtbl; /* Needs to be the first item in the struct
216 * since we want to cast this in a Storage32 pointer */
218 IPropertySetStorageVtbl *pssVtbl; /* interface for adding a properties stream */
221 * Reference count of this object
226 * Ancestor storage (top level)
228 StorageImpl* ancestorStorage;
231 * Index of the property for the root of
234 ULONG rootPropertySetIndex;
237 * virtual Destructor method.
239 void (*v_destructor)(StorageBaseImpl*);
244 * Prototypes for the methods of the Storage32BaseImpl class.
246 HRESULT WINAPI StorageBaseImpl_QueryInterface(
251 ULONG WINAPI StorageBaseImpl_AddRef(
254 ULONG WINAPI StorageBaseImpl_Release(
257 HRESULT WINAPI StorageBaseImpl_OpenStream(
259 const OLECHAR* pwcsName, /* [string][in] */
260 void* reserved1, /* [unique][in] */
261 DWORD grfMode, /* [in] */
262 DWORD reserved2, /* [in] */
263 IStream** ppstm); /* [out] */
265 HRESULT WINAPI StorageBaseImpl_OpenStorage(
267 const OLECHAR* pwcsName, /* [string][unique][in] */
268 IStorage* pstgPriority, /* [unique][in] */
269 DWORD grfMode, /* [in] */
270 SNB snbExclude, /* [unique][in] */
271 DWORD reserved, /* [in] */
272 IStorage** ppstg); /* [out] */
274 HRESULT WINAPI StorageBaseImpl_EnumElements(
276 DWORD reserved1, /* [in] */
277 void* reserved2, /* [size_is][unique][in] */
278 DWORD reserved3, /* [in] */
279 IEnumSTATSTG** ppenum); /* [out] */
281 HRESULT WINAPI StorageBaseImpl_Stat(
283 STATSTG* pstatstg, /* [out] */
284 DWORD grfStatFlag); /* [in] */
286 HRESULT WINAPI StorageBaseImpl_RenameElement(
288 const OLECHAR* pwcsOldName, /* [string][in] */
289 const OLECHAR* pwcsNewName); /* [string][in] */
291 HRESULT WINAPI StorageBaseImpl_CreateStream(
293 const OLECHAR* pwcsName, /* [string][in] */
294 DWORD grfMode, /* [in] */
295 DWORD reserved1, /* [in] */
296 DWORD reserved2, /* [in] */
297 IStream** ppstm); /* [out] */
299 HRESULT WINAPI StorageBaseImpl_SetClass(
301 REFCLSID clsid); /* [in] */
303 /****************************************************************************
304 * Storage32Impl definitions.
306 * This implementation of the IStorage32 interface represents a root
307 * storage. Basically, a document file.
311 struct StorageBaseImpl base;
314 * The following data members are specific to the Storage32Impl
317 HANDLE hFile; /* Physical support for the Docfile */
318 LPOLESTR pwcsName; /* Full path of the document file */
320 /* FIXME: should this be in Storage32BaseImpl ? */
321 WCHAR filename[PROPERTY_NAME_BUFFER_LEN];
326 WORD bigBlockSizeBits;
327 WORD smallBlockSizeBits;
329 ULONG smallBlockSize;
330 ULONG bigBlockDepotCount;
331 ULONG rootStartBlock;
332 ULONG smallBlockDepotStart;
333 ULONG extBigBlockDepotStart;
334 ULONG extBigBlockDepotCount;
335 ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER];
337 ULONG blockDepotCached[NUM_BLOCKS_PER_DEPOT_BLOCK];
338 ULONG indexBlockDepotCached;
342 * Abstraction of the big block chains for the chains of the header.
344 BlockChainStream* rootBlockChain;
345 BlockChainStream* smallBlockDepotChain;
346 BlockChainStream* smallBlockRootChain;
349 * Pointer to the big block file abstraction
351 BigBlockFile* bigBlockFile;
355 * Method declaration for the Storage32Impl class
358 HRESULT WINAPI StorageImpl_CreateStorage(
360 const OLECHAR* pwcsName, /* [string][in] */
361 DWORD grfMode, /* [in] */
362 DWORD dwStgFmt, /* [in] */
363 DWORD reserved2, /* [in] */
364 IStorage** ppstg); /* [out] */
366 HRESULT WINAPI StorageImpl_CopyTo(
368 DWORD ciidExclude, /* [in] */
369 const IID* rgiidExclude, /* [size_is][unique][in] */
370 SNB snbExclude, /* [unique][in] */
371 IStorage* pstgDest); /* [unique][in] */
373 HRESULT WINAPI StorageImpl_MoveElementTo(
375 const OLECHAR* pwcsName, /* [string][in] */
376 IStorage* pstgDest, /* [unique][in] */
377 const OLECHAR* pwcsNewName, /* [string][in] */
378 DWORD grfFlags); /* [in] */
380 HRESULT WINAPI StorageImpl_Commit(
382 DWORD grfCommitFlags); /* [in] */
384 HRESULT WINAPI StorageImpl_Revert(
387 HRESULT WINAPI StorageImpl_DestroyElement(
389 const OLECHAR* pwcsName); /* [string][in] */
391 HRESULT WINAPI StorageImpl_SetElementTimes(
393 const OLECHAR* pwcsName, /* [string][in] */
394 const FILETIME* pctime, /* [in] */
395 const FILETIME* patime, /* [in] */
396 const FILETIME* pmtime); /* [in] */
398 HRESULT WINAPI StorageImpl_SetStateBits(
400 DWORD grfStateBits, /* [in] */
401 DWORD grfMask); /* [in] */
403 HRESULT WINAPI StorageImpl_Stat(IStorage* iface,
404 STATSTG* pstatstg, /* [out] */
405 DWORD grfStatFlag); /* [in] */
407 void StorageImpl_Destroy(
408 StorageBaseImpl* This);
410 HRESULT StorageImpl_Construct(
419 BOOL StorageImpl_ReadBigBlock(
424 BOOL StorageImpl_WriteBigBlock(
429 void* StorageImpl_GetROBigBlock(
433 void* StorageImpl_GetBigBlock(
437 void StorageImpl_ReleaseBigBlock(
441 ULONG StorageImpl_GetNextFreeBigBlock(
444 void StorageImpl_FreeBigBlock(
448 HRESULT StorageImpl_GetNextBlockInChain(
451 ULONG* nextBlockIndex);
453 void StorageImpl_SetNextBlockInChain(
458 HRESULT StorageImpl_LoadFileHeader(
461 void StorageImpl_SaveFileHeader(
464 BOOL StorageImpl_ReadProperty(
467 StgProperty* buffer);
469 BOOL StorageImpl_WriteProperty(
472 StgProperty* buffer);
474 BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
476 SmallBlockChainStream** ppsbChain);
478 ULONG Storage32Impl_GetNextExtendedBlock(StorageImpl* This,
481 void Storage32Impl_AddBlockDepot(StorageImpl* This,
484 ULONG Storage32Impl_AddExtBlockDepot(StorageImpl* This);
486 ULONG Storage32Impl_GetExtDepotBlock(StorageImpl* This,
489 void Storage32Impl_SetExtDepotBlock(StorageImpl* This,
492 /****************************************************************************
493 * Storage32InternalImpl definitions.
495 * Definition of the implementation structure for the IStorage32 interface.
496 * This one implements the IStorage32 interface for storage that are
497 * inside another storage.
499 struct StorageInternalImpl
501 struct StorageBaseImpl base;
504 * There is no specific data for this class.
509 * Method definitions for the Storage32InternalImpl class.
511 StorageInternalImpl* StorageInternalImpl_Construct(
512 StorageImpl* ancestorStorage,
513 ULONG rootTropertyIndex);
515 void StorageInternalImpl_Destroy(
516 StorageBaseImpl* This);
518 HRESULT WINAPI StorageInternalImpl_Commit(
520 DWORD grfCommitFlags); /* [in] */
522 HRESULT WINAPI StorageInternalImpl_Revert(
526 /****************************************************************************
527 * IEnumSTATSTGImpl definitions.
529 * Definition of the implementation structure for the IEnumSTATSTGImpl interface.
530 * This class allows iterating through the content of a storage and to find
531 * specific items inside it.
533 struct IEnumSTATSTGImpl
535 IEnumSTATSTGVtbl *lpVtbl; /* Needs to be the first item in the struct
536 * since we want to cast this in a IEnumSTATSTG pointer */
538 ULONG ref; /* Reference count */
539 StorageImpl* parentStorage; /* Reference to the parent storage */
540 ULONG firstPropertyNode; /* Index of the root of the storage to enumerate */
543 * The current implementation of the IEnumSTATSTGImpl class uses a stack
544 * to walk the property sets to get the content of a storage. This stack
545 * is implemented by the following 3 data members
551 #define ENUMSTATSGT_SIZE_INCREMENT 10
555 * Method definitions for the IEnumSTATSTGImpl class.
557 HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface(
562 ULONG WINAPI IEnumSTATSTGImpl_AddRef(
563 IEnumSTATSTG* iface);
565 ULONG WINAPI IEnumSTATSTGImpl_Release(
566 IEnumSTATSTG* iface);
568 HRESULT WINAPI IEnumSTATSTGImpl_Next(
572 ULONG* pceltFetched);
574 HRESULT WINAPI IEnumSTATSTGImpl_Skip(
578 HRESULT WINAPI IEnumSTATSTGImpl_Reset(
579 IEnumSTATSTG* iface);
581 HRESULT WINAPI IEnumSTATSTGImpl_Clone(
583 IEnumSTATSTG** ppenum);
585 IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(
587 ULONG firstPropertyNode);
589 void IEnumSTATSTGImpl_Destroy(
590 IEnumSTATSTGImpl* This);
592 void IEnumSTATSTGImpl_PushSearchNode(
593 IEnumSTATSTGImpl* This,
596 ULONG IEnumSTATSTGImpl_PopSearchNode(
597 IEnumSTATSTGImpl* This,
600 ULONG IEnumSTATSTGImpl_FindProperty(
601 IEnumSTATSTGImpl* This,
602 const OLECHAR* lpszPropName,
603 StgProperty* buffer);
605 INT IEnumSTATSTGImpl_FindParentProperty(
606 IEnumSTATSTGImpl *This,
608 StgProperty *currentProperty,
612 /****************************************************************************
613 * StgStreamImpl definitions.
615 * This class imlements the IStream32 inteface and represents a stream
616 * located inside a storage object.
620 IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct
621 * since we want to cast this in a IStream pointer */
629 * Storage that is the parent(owner) of the stream
631 StorageBaseImpl* parentStorage;
634 * Access mode of this stream.
639 * Index of the property that owns (points to) this stream.
644 * Helper variable that contains the size of the stream
646 ULARGE_INTEGER streamSize;
649 * This is the current position of the cursor in the stream
651 ULARGE_INTEGER currentPosition;
654 * The information in the stream is represented by a chain of small blocks
655 * or a chain of large blocks. Depending on the case, one of the two
656 * following variabled points to that information.
658 BlockChainStream* bigBlockChain;
659 SmallBlockChainStream* smallBlockChain;
663 * Method definition for the StgStreamImpl class.
665 StgStreamImpl* StgStreamImpl_Construct(
666 StorageBaseImpl* parentStorage,
668 ULONG ownerProperty);
670 void StgStreamImpl_Destroy(
671 StgStreamImpl* This);
673 void StgStreamImpl_OpenBlockChain(
674 StgStreamImpl* This);
676 HRESULT WINAPI StgStreamImpl_QueryInterface(
678 REFIID riid, /* [in] */
679 void** ppvObject); /* [iid_is][out] */
681 ULONG WINAPI StgStreamImpl_AddRef(
684 ULONG WINAPI StgStreamImpl_Release(
687 HRESULT WINAPI StgStreamImpl_Read(
689 void* pv, /* [length_is][size_is][out] */
691 ULONG* pcbRead); /* [out] */
693 HRESULT WINAPI StgStreamImpl_Write(
695 const void* pv, /* [size_is][in] */
697 ULONG* pcbWritten); /* [out] */
699 HRESULT WINAPI StgStreamImpl_Seek(
701 LARGE_INTEGER dlibMove, /* [in] */
702 DWORD dwOrigin, /* [in] */
703 ULARGE_INTEGER* plibNewPosition); /* [out] */
705 HRESULT WINAPI StgStreamImpl_SetSize(
707 ULARGE_INTEGER libNewSize); /* [in] */
709 HRESULT WINAPI StgStreamImpl_CopyTo(
711 IStream* pstm, /* [unique][in] */
712 ULARGE_INTEGER cb, /* [in] */
713 ULARGE_INTEGER* pcbRead, /* [out] */
714 ULARGE_INTEGER* pcbWritten); /* [out] */
716 HRESULT WINAPI StgStreamImpl_Commit(
718 DWORD grfCommitFlags); /* [in] */
720 HRESULT WINAPI StgStreamImpl_Revert(
723 HRESULT WINAPI StgStreamImpl_LockRegion(
725 ULARGE_INTEGER libOffset, /* [in] */
726 ULARGE_INTEGER cb, /* [in] */
727 DWORD dwLockType); /* [in] */
729 HRESULT WINAPI StgStreamImpl_UnlockRegion(
731 ULARGE_INTEGER libOffset, /* [in] */
732 ULARGE_INTEGER cb, /* [in] */
733 DWORD dwLockType); /* [in] */
735 HRESULT WINAPI StgStreamImpl_Stat(
737 STATSTG* pstatstg, /* [out] */
738 DWORD grfStatFlag); /* [in] */
740 HRESULT WINAPI StgStreamImpl_Clone(
742 IStream** ppstm); /* [out] */
745 /********************************************************************************
746 * The StorageUtl_ functions are miscelaneous utility functions. Most of which are
747 * abstractions used to read values from file buffers without having to worry
750 void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value);
751 void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value);
752 void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value);
753 void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value);
754 void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value);
755 void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value);
756 void StorageUtl_CopyPropertyToSTATSTG(STATSTG* destination,
760 /****************************************************************************
761 * BlockChainStream definitions.
763 * The BlockChainStream class is a utility class that is used to create an
764 * abstraction of the big block chains in the storage file.
766 struct BlockChainStream
768 StorageImpl* parentStorage;
769 ULONG* headOfStreamPlaceHolder;
770 ULONG ownerPropertyIndex;
771 ULONG lastBlockNoInSequence;
772 ULONG lastBlockNoInSequenceIndex;
778 * Methods for the BlockChainStream class.
780 BlockChainStream* BlockChainStream_Construct(
781 StorageImpl* parentStorage,
782 ULONG* headOfStreamPlaceHolder,
783 ULONG propertyIndex);
785 void BlockChainStream_Destroy(
786 BlockChainStream* This);
788 ULONG BlockChainStream_GetHeadOfChain(
789 BlockChainStream* This);
791 BOOL BlockChainStream_ReadAt(
792 BlockChainStream* This,
793 ULARGE_INTEGER offset,
798 BOOL BlockChainStream_WriteAt(
799 BlockChainStream* This,
800 ULARGE_INTEGER offset,
803 ULONG* bytesWritten);
805 BOOL BlockChainStream_SetSize(
806 BlockChainStream* This,
807 ULARGE_INTEGER newSize);
809 ULARGE_INTEGER BlockChainStream_GetSize(
810 BlockChainStream* This);
812 ULONG BlockChainStream_GetCount(
813 BlockChainStream* This);
815 /****************************************************************************
816 * SmallBlockChainStream definitions.
818 * The SmallBlockChainStream class is a utility class that is used to create an
819 * abstraction of the small block chains in the storage file.
821 struct SmallBlockChainStream
823 StorageImpl* parentStorage;
824 ULONG ownerPropertyIndex;
828 * Methods of the SmallBlockChainStream class.
830 SmallBlockChainStream* SmallBlockChainStream_Construct(
831 StorageImpl* parentStorage,
832 ULONG propertyIndex);
834 void SmallBlockChainStream_Destroy(
835 SmallBlockChainStream* This);
837 ULONG SmallBlockChainStream_GetHeadOfChain(
838 SmallBlockChainStream* This);
840 HRESULT SmallBlockChainStream_GetNextBlockInChain(
841 SmallBlockChainStream* This,
843 ULONG* nextBlockIndex);
845 void SmallBlockChainStream_SetNextBlockInChain(
846 SmallBlockChainStream* This,
850 void SmallBlockChainStream_FreeBlock(
851 SmallBlockChainStream* This,
854 ULONG SmallBlockChainStream_GetNextFreeBlock(
855 SmallBlockChainStream* This);
857 BOOL SmallBlockChainStream_ReadAt(
858 SmallBlockChainStream* This,
859 ULARGE_INTEGER offset,
864 BOOL SmallBlockChainStream_WriteAt(
865 SmallBlockChainStream* This,
866 ULARGE_INTEGER offset,
869 ULONG* bytesWritten);
871 BOOL SmallBlockChainStream_SetSize(
872 SmallBlockChainStream* This,
873 ULARGE_INTEGER newSize);
875 ULARGE_INTEGER SmallBlockChainStream_GetSize(
876 SmallBlockChainStream* This);
878 ULONG SmallBlockChainStream_GetCount(
879 SmallBlockChainStream* This);
882 #endif /* __STORAGE32_H__ */