Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenstorage32.h
Go to the documentation of this file.
00001 /* 00002 * Compound Storage (32 bit version) 00003 * 00004 * Implemented using the documentation of the LAOLA project at 00005 * <URL:http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/index.html> 00006 * (Thanks to Martin Schwartz <schwartz@cs.tu-berlin.de>) 00007 * 00008 * This include file contains definitions of types and function 00009 * prototypes that are used in the many files implementing the 00010 * storage functionality 00011 * 00012 * Copyright 1998,1999 Francis Beaudet 00013 * Copyright 1998,1999 Thuy Nguyen 00014 * Copyright 2010 Vincent Povirk for CodeWeavers 00015 * 00016 * This library is free software; you can redistribute it and/or 00017 * modify it under the terms of the GNU Lesser General Public 00018 * License as published by the Free Software Foundation; either 00019 * version 2.1 of the License, or (at your option) any later version. 00020 * 00021 * This library is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 * Lesser General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU Lesser General Public 00027 * License along with this library; if not, write to the Free Software 00028 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00029 */ 00030 #ifndef __STORAGE32_H__ 00031 #define __STORAGE32_H__ 00032 00033 #include <stdarg.h> 00034 00035 #include "windef.h" 00036 #include "winbase.h" 00037 #include "winnt.h" 00038 #include "objbase.h" 00039 #include "winreg.h" 00040 #include "winternl.h" 00041 #include "wine/list.h" 00042 00043 /* 00044 * Definitions for the file format offsets. 00045 */ 00046 static const ULONG OFFSET_MINORVERSION = 0x00000018; 00047 static const ULONG OFFSET_MAJORVERSION = 0x0000001a; 00048 static const ULONG OFFSET_BYTEORDERMARKER = 0x0000001c; 00049 static const ULONG OFFSET_BIGBLOCKSIZEBITS = 0x0000001e; 00050 static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020; 00051 static const ULONG OFFSET_DIRSECTORCOUNT = 0x00000028; 00052 static const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C; 00053 static const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030; 00054 static const ULONG OFFSET_SMALLBLOCKLIMIT = 0x00000038; 00055 static const ULONG OFFSET_SBDEPOTSTART = 0x0000003C; 00056 static const ULONG OFFSET_SBDEPOTCOUNT = 0x00000040; 00057 static const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044; 00058 static const ULONG OFFSET_EXTBBDEPOTCOUNT = 0x00000048; 00059 static const ULONG OFFSET_BBDEPOTSTART = 0x0000004C; 00060 static const ULONG OFFSET_PS_NAME = 0x00000000; 00061 static const ULONG OFFSET_PS_NAMELENGTH = 0x00000040; 00062 static const ULONG OFFSET_PS_STGTYPE = 0x00000042; 00063 static const ULONG OFFSET_PS_LEFTCHILD = 0x00000044; 00064 static const ULONG OFFSET_PS_RIGHTCHILD = 0x00000048; 00065 static const ULONG OFFSET_PS_DIRROOT = 0x0000004C; 00066 static const ULONG OFFSET_PS_GUID = 0x00000050; 00067 static const ULONG OFFSET_PS_CTIMELOW = 0x00000064; 00068 static const ULONG OFFSET_PS_CTIMEHIGH = 0x00000068; 00069 static const ULONG OFFSET_PS_MTIMELOW = 0x0000006C; 00070 static const ULONG OFFSET_PS_MTIMEHIGH = 0x00000070; 00071 static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074; 00072 static const ULONG OFFSET_PS_SIZE = 0x00000078; 00073 static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009; 00074 static const WORD MIN_BIG_BLOCK_SIZE_BITS = 0x0009; 00075 static const WORD MAX_BIG_BLOCK_SIZE_BITS = 0x000c; 00076 static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006; 00077 static const WORD DEF_BIG_BLOCK_SIZE = 0x0200; 00078 static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040; 00079 static const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC; 00080 static const ULONG BLOCK_SPECIAL = 0xFFFFFFFD; 00081 static const ULONG BLOCK_END_OF_CHAIN = 0xFFFFFFFE; 00082 static const ULONG BLOCK_UNUSED = 0xFFFFFFFF; 00083 static const ULONG DIRENTRY_NULL = 0xFFFFFFFF; 00084 00085 #define DIRENTRY_NAME_MAX_LEN 0x20 00086 #define DIRENTRY_NAME_BUFFER_LEN 0x40 00087 00088 #define RAW_DIRENTRY_SIZE 0x00000080 00089 00090 #define HEADER_SIZE 512 00091 00092 #define MIN_BIG_BLOCK_SIZE 0x200 00093 #define MAX_BIG_BLOCK_SIZE 0x1000 00094 00095 /* 00096 * Type of child entry link 00097 */ 00098 #define DIRENTRY_RELATION_PREVIOUS 0 00099 #define DIRENTRY_RELATION_NEXT 1 00100 #define DIRENTRY_RELATION_DIR 2 00101 00102 /* 00103 * type constant used in files for the root storage 00104 */ 00105 #define STGTY_ROOT 0x05 00106 00107 #define COUNT_BBDEPOTINHEADER 109 00108 00109 /* FIXME: This value is stored in the header, but we hard-code it to 0x1000. */ 00110 #define LIMIT_TO_USE_SMALL_BLOCK 0x1000 00111 00112 #define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f) 00113 #define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0) 00114 #define STGM_CREATE_MODE(stgm) ((stgm)&0x0f000) 00115 00116 #define STGM_KNOWN_FLAGS (0xf0ff | \ 00117 STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \ 00118 STGM_NOSNAPSHOT | STGM_DIRECT_SWMR | STGM_DELETEONRELEASE | STGM_SIMPLE) 00119 00120 /* 00121 * Forward declarations of all the structures used by the storage 00122 * module. 00123 */ 00124 typedef struct StorageBaseImpl StorageBaseImpl; 00125 typedef struct StorageBaseImplVtbl StorageBaseImplVtbl; 00126 typedef struct StorageImpl StorageImpl; 00127 typedef struct BlockChainStream BlockChainStream; 00128 typedef struct SmallBlockChainStream SmallBlockChainStream; 00129 typedef struct IEnumSTATSTGImpl IEnumSTATSTGImpl; 00130 typedef struct DirEntry DirEntry; 00131 typedef struct StgStreamImpl StgStreamImpl; 00132 00133 /* 00134 * A reference to a directory entry in the file or a transacted cache. 00135 */ 00136 typedef ULONG DirRef; 00137 00138 /* 00139 * This utility structure is used to read/write the information in a directory 00140 * entry. 00141 */ 00142 struct DirEntry 00143 { 00144 WCHAR name[DIRENTRY_NAME_MAX_LEN]; 00145 WORD sizeOfNameString; 00146 BYTE stgType; 00147 DirRef leftChild; 00148 DirRef rightChild; 00149 DirRef dirRootEntry; 00150 GUID clsid; 00151 FILETIME ctime; 00152 FILETIME mtime; 00153 ULONG startingBlock; 00154 ULARGE_INTEGER size; 00155 }; 00156 00157 HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN; 00158 00159 /************************************************************************* 00160 * Ole Convert support 00161 */ 00162 00163 void OLECONVERT_CreateOleStream(LPSTORAGE pStorage) DECLSPEC_HIDDEN; 00164 HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName) DECLSPEC_HIDDEN; 00165 00166 00167 /**************************************************************************** 00168 * Storage32BaseImpl definitions. 00169 * 00170 * This structure defines the base information contained in all implementations 00171 * of IStorage32 contained in this file storage implementation. 00172 * 00173 * In OOP terms, this is the base class for all the IStorage32 implementations 00174 * contained in this file. 00175 */ 00176 struct StorageBaseImpl 00177 { 00178 const IStorageVtbl *lpVtbl; /* Needs to be the first item in the struct 00179 * since we want to cast this in a Storage32 pointer */ 00180 00181 const IPropertySetStorageVtbl *pssVtbl; /* interface for adding a properties stream */ 00182 00183 /* 00184 * Stream tracking list 00185 */ 00186 00187 struct list strmHead; 00188 00189 /* 00190 * Storage tracking list 00191 */ 00192 struct list storageHead; 00193 00194 /* 00195 * Reference count of this object 00196 */ 00197 LONG ref; 00198 00199 /* 00200 * TRUE if this object has been invalidated 00201 */ 00202 int reverted; 00203 00204 /* 00205 * Index of the directory entry of this storage 00206 */ 00207 DirRef storageDirEntry; 00208 00209 /* 00210 * virtual methods. 00211 */ 00212 const StorageBaseImplVtbl *baseVtbl; 00213 00214 /* 00215 * flags that this storage was opened or created with 00216 */ 00217 DWORD openFlags; 00218 00219 /* 00220 * State bits appear to only be preserved while running. No in the stream 00221 */ 00222 DWORD stateBits; 00223 00224 BOOL create; /* Was the storage created or opened. 00225 The behaviour of STGM_SIMPLE depends on this */ 00226 /* 00227 * If this storage was opened in transacted mode, the object that implements 00228 * the transacted snapshot or cache. 00229 */ 00230 StorageBaseImpl *transactedChild; 00231 }; 00232 00233 /* virtual methods for StorageBaseImpl objects */ 00234 struct StorageBaseImplVtbl { 00235 void (*Destroy)(StorageBaseImpl*); 00236 void (*Invalidate)(StorageBaseImpl*); 00237 HRESULT (*Flush)(StorageBaseImpl*); 00238 HRESULT (*GetFilename)(StorageBaseImpl*,LPWSTR*); 00239 HRESULT (*CreateDirEntry)(StorageBaseImpl*,const DirEntry*,DirRef*); 00240 HRESULT (*WriteDirEntry)(StorageBaseImpl*,DirRef,const DirEntry*); 00241 HRESULT (*ReadDirEntry)(StorageBaseImpl*,DirRef,DirEntry*); 00242 HRESULT (*DestroyDirEntry)(StorageBaseImpl*,DirRef); 00243 HRESULT (*StreamReadAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,void*,ULONG*); 00244 HRESULT (*StreamWriteAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,const void*,ULONG*); 00245 HRESULT (*StreamSetSize)(StorageBaseImpl*,DirRef,ULARGE_INTEGER); 00246 HRESULT (*StreamLink)(StorageBaseImpl*,DirRef,DirRef); 00247 }; 00248 00249 static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This) 00250 { 00251 This->baseVtbl->Destroy(This); 00252 } 00253 00254 static inline void StorageBaseImpl_Invalidate(StorageBaseImpl *This) 00255 { 00256 This->baseVtbl->Invalidate(This); 00257 } 00258 00259 static inline HRESULT StorageBaseImpl_Flush(StorageBaseImpl *This) 00260 { 00261 return This->baseVtbl->Flush(This); 00262 } 00263 00264 static inline HRESULT StorageBaseImpl_GetFilename(StorageBaseImpl *This, LPWSTR *result) 00265 { 00266 return This->baseVtbl->GetFilename(This, result); 00267 } 00268 00269 static inline HRESULT StorageBaseImpl_CreateDirEntry(StorageBaseImpl *This, 00270 const DirEntry *newData, DirRef *index) 00271 { 00272 return This->baseVtbl->CreateDirEntry(This, newData, index); 00273 } 00274 00275 static inline HRESULT StorageBaseImpl_WriteDirEntry(StorageBaseImpl *This, 00276 DirRef index, const DirEntry *data) 00277 { 00278 return This->baseVtbl->WriteDirEntry(This, index, data); 00279 } 00280 00281 static inline HRESULT StorageBaseImpl_ReadDirEntry(StorageBaseImpl *This, 00282 DirRef index, DirEntry *data) 00283 { 00284 return This->baseVtbl->ReadDirEntry(This, index, data); 00285 } 00286 00287 static inline HRESULT StorageBaseImpl_DestroyDirEntry(StorageBaseImpl *This, 00288 DirRef index) 00289 { 00290 return This->baseVtbl->DestroyDirEntry(This, index); 00291 } 00292 00293 /* Read up to size bytes from this directory entry's stream at the given offset. */ 00294 static inline HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This, 00295 DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead) 00296 { 00297 return This->baseVtbl->StreamReadAt(This, index, offset, size, buffer, bytesRead); 00298 } 00299 00300 /* Write size bytes to this directory entry's stream at the given offset, 00301 * growing the stream if necessary. */ 00302 static inline HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, 00303 DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) 00304 { 00305 return This->baseVtbl->StreamWriteAt(This, index, offset, size, buffer, bytesWritten); 00306 } 00307 00308 static inline HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This, 00309 DirRef index, ULARGE_INTEGER newsize) 00310 { 00311 return This->baseVtbl->StreamSetSize(This, index, newsize); 00312 } 00313 00314 /* Make dst point to the same stream that src points to. Other stream operations 00315 * will not work properly for entries that point to the same stream, so this 00316 * must be a very temporary state, and only one entry pointing to a given stream 00317 * may be reachable at any given time. */ 00318 static inline HRESULT StorageBaseImpl_StreamLink(StorageBaseImpl *This, 00319 DirRef dst, DirRef src) 00320 { 00321 return This->baseVtbl->StreamLink(This, dst, src); 00322 } 00323 00324 /**************************************************************************** 00325 * StorageBaseImpl stream list handlers 00326 */ 00327 00328 void StorageBaseImpl_AddStream(StorageBaseImpl * stg, StgStreamImpl * strm) DECLSPEC_HIDDEN; 00329 void StorageBaseImpl_RemoveStream(StorageBaseImpl * stg, StgStreamImpl * strm) DECLSPEC_HIDDEN; 00330 00331 /* Number of BlockChainStream objects to cache in a StorageImpl */ 00332 #define BLOCKCHAIN_CACHE_SIZE 4 00333 00334 /**************************************************************************** 00335 * Storage32Impl definitions. 00336 * 00337 * This implementation of the IStorage32 interface represents a root 00338 * storage. Basically, a document file. 00339 */ 00340 struct StorageImpl 00341 { 00342 struct StorageBaseImpl base; 00343 00344 /* 00345 * File header 00346 */ 00347 WORD bigBlockSizeBits; 00348 WORD smallBlockSizeBits; 00349 ULONG bigBlockSize; 00350 ULONG smallBlockSize; 00351 ULONG bigBlockDepotCount; 00352 ULONG rootStartBlock; 00353 ULONG smallBlockLimit; 00354 ULONG smallBlockDepotStart; 00355 ULONG extBigBlockDepotStart; 00356 ULONG *extBigBlockDepotLocations; 00357 ULONG extBigBlockDepotLocationsSize; 00358 ULONG extBigBlockDepotCount; 00359 ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER]; 00360 00361 ULONG extBlockDepotCached[MAX_BIG_BLOCK_SIZE / 4]; 00362 ULONG indexExtBlockDepotCached; 00363 00364 ULONG blockDepotCached[MAX_BIG_BLOCK_SIZE / 4]; 00365 ULONG indexBlockDepotCached; 00366 ULONG prevFreeBlock; 00367 00368 /* All small blocks before this one are known to be in use. */ 00369 ULONG firstFreeSmallBlock; 00370 00371 /* 00372 * Abstraction of the big block chains for the chains of the header. 00373 */ 00374 BlockChainStream* rootBlockChain; 00375 BlockChainStream* smallBlockDepotChain; 00376 BlockChainStream* smallBlockRootChain; 00377 00378 /* Cache of block chain streams objects for directory entries */ 00379 BlockChainStream* blockChainCache[BLOCKCHAIN_CACHE_SIZE]; 00380 UINT blockChainToEvict; 00381 00382 ILockBytes* lockBytes; 00383 }; 00384 00385 HRESULT StorageImpl_ReadRawDirEntry( 00386 StorageImpl *This, 00387 ULONG index, 00388 BYTE *buffer) DECLSPEC_HIDDEN; 00389 00390 void UpdateRawDirEntry( 00391 BYTE *buffer, 00392 const DirEntry *newData) DECLSPEC_HIDDEN; 00393 00394 HRESULT StorageImpl_WriteRawDirEntry( 00395 StorageImpl *This, 00396 ULONG index, 00397 const BYTE *buffer) DECLSPEC_HIDDEN; 00398 00399 HRESULT StorageImpl_ReadDirEntry( 00400 StorageImpl* This, 00401 DirRef index, 00402 DirEntry* buffer) DECLSPEC_HIDDEN; 00403 00404 HRESULT StorageImpl_WriteDirEntry( 00405 StorageImpl* This, 00406 DirRef index, 00407 const DirEntry* buffer) DECLSPEC_HIDDEN; 00408 00409 BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks( 00410 StorageImpl* This, 00411 SmallBlockChainStream** ppsbChain) DECLSPEC_HIDDEN; 00412 00413 SmallBlockChainStream* Storage32Impl_BigBlocksToSmallBlocks( 00414 StorageImpl* This, 00415 BlockChainStream** ppbbChain, 00416 ULARGE_INTEGER newSize) DECLSPEC_HIDDEN; 00417 00418 /**************************************************************************** 00419 * StgStreamImpl definitions. 00420 * 00421 * This class implements the IStream32 interface and represents a stream 00422 * located inside a storage object. 00423 */ 00424 struct StgStreamImpl 00425 { 00426 const IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct 00427 * since we want to cast this to an IStream pointer */ 00428 00429 /* 00430 * We are an entry in the storage object's stream handler list 00431 */ 00432 00433 struct list StrmListEntry; 00434 00435 /* 00436 * Reference count 00437 */ 00438 LONG ref; 00439 00440 /* 00441 * Storage that is the parent(owner) of the stream 00442 */ 00443 StorageBaseImpl* parentStorage; 00444 00445 /* 00446 * Access mode of this stream. 00447 */ 00448 DWORD grfMode; 00449 00450 /* 00451 * Index of the directory entry that owns (points to) this stream. 00452 */ 00453 DirRef dirEntry; 00454 00455 /* 00456 * This is the current position of the cursor in the stream 00457 */ 00458 ULARGE_INTEGER currentPosition; 00459 }; 00460 00461 /* 00462 * Method definition for the StgStreamImpl class. 00463 */ 00464 StgStreamImpl* StgStreamImpl_Construct( 00465 StorageBaseImpl* parentStorage, 00466 DWORD grfMode, 00467 DirRef dirEntry) DECLSPEC_HIDDEN; 00468 00469 00470 /****************************************************************************** 00471 * Endian conversion macros 00472 */ 00473 #ifdef WORDS_BIGENDIAN 00474 00475 #define htole32(x) RtlUlongByteSwap(x) 00476 #define htole16(x) RtlUshortByteSwap(x) 00477 #define lendian32toh(x) RtlUlongByteSwap(x) 00478 #define lendian16toh(x) RtlUshortByteSwap(x) 00479 00480 #else 00481 00482 #define htole32(x) (x) 00483 #define htole16(x) (x) 00484 #define lendian32toh(x) (x) 00485 #define lendian16toh(x) (x) 00486 00487 #endif 00488 00489 /****************************************************************************** 00490 * The StorageUtl_ functions are miscellaneous utility functions. Most of which 00491 * are abstractions used to read values from file buffers without having to 00492 * worry about bit order 00493 */ 00494 void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN; 00495 void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; 00496 void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN; 00497 void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; 00498 void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, 00499 ULARGE_INTEGER* value) DECLSPEC_HIDDEN; 00500 void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, 00501 const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; 00502 void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; 00503 void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; 00504 void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination, 00505 const DirEntry* source, int statFlags) DECLSPEC_HIDDEN; 00506 00507 /**************************************************************************** 00508 * BlockChainStream definitions. 00509 * 00510 * The BlockChainStream class is a utility class that is used to create an 00511 * abstraction of the big block chains in the storage file. 00512 */ 00513 struct BlockChainRun 00514 { 00515 /* This represents a range of blocks that happen reside in consecutive sectors. */ 00516 ULONG firstSector; 00517 ULONG firstOffset; 00518 ULONG lastOffset; 00519 }; 00520 00521 typedef struct BlockChainBlock 00522 { 00523 ULONG index; 00524 ULONG sector; 00525 int read; 00526 int dirty; 00527 BYTE data[MAX_BIG_BLOCK_SIZE]; 00528 } BlockChainBlock; 00529 00530 struct BlockChainStream 00531 { 00532 StorageImpl* parentStorage; 00533 ULONG* headOfStreamPlaceHolder; 00534 DirRef ownerDirEntry; 00535 struct BlockChainRun* indexCache; 00536 ULONG indexCacheLen; 00537 ULONG indexCacheSize; 00538 BlockChainBlock cachedBlocks[2]; 00539 ULONG blockToEvict; 00540 ULONG tailIndex; 00541 ULONG numBlocks; 00542 }; 00543 00544 /* 00545 * Methods for the BlockChainStream class. 00546 */ 00547 BlockChainStream* BlockChainStream_Construct( 00548 StorageImpl* parentStorage, 00549 ULONG* headOfStreamPlaceHolder, 00550 DirRef dirEntry) DECLSPEC_HIDDEN; 00551 00552 void BlockChainStream_Destroy( 00553 BlockChainStream* This) DECLSPEC_HIDDEN; 00554 00555 HRESULT BlockChainStream_ReadAt( 00556 BlockChainStream* This, 00557 ULARGE_INTEGER offset, 00558 ULONG size, 00559 void* buffer, 00560 ULONG* bytesRead) DECLSPEC_HIDDEN; 00561 00562 HRESULT BlockChainStream_WriteAt( 00563 BlockChainStream* This, 00564 ULARGE_INTEGER offset, 00565 ULONG size, 00566 const void* buffer, 00567 ULONG* bytesWritten) DECLSPEC_HIDDEN; 00568 00569 BOOL BlockChainStream_SetSize( 00570 BlockChainStream* This, 00571 ULARGE_INTEGER newSize) DECLSPEC_HIDDEN; 00572 00573 HRESULT BlockChainStream_Flush( 00574 BlockChainStream* This) DECLSPEC_HIDDEN; 00575 00576 /**************************************************************************** 00577 * SmallBlockChainStream definitions. 00578 * 00579 * The SmallBlockChainStream class is a utility class that is used to create an 00580 * abstraction of the small block chains in the storage file. 00581 */ 00582 struct SmallBlockChainStream 00583 { 00584 StorageImpl* parentStorage; 00585 DirRef ownerDirEntry; 00586 ULONG* headOfStreamPlaceHolder; 00587 }; 00588 00589 /* 00590 * Methods of the SmallBlockChainStream class. 00591 */ 00592 SmallBlockChainStream* SmallBlockChainStream_Construct( 00593 StorageImpl* parentStorage, 00594 ULONG* headOfStreamPlaceHolder, 00595 DirRef dirEntry) DECLSPEC_HIDDEN; 00596 00597 void SmallBlockChainStream_Destroy( 00598 SmallBlockChainStream* This) DECLSPEC_HIDDEN; 00599 00600 HRESULT SmallBlockChainStream_ReadAt( 00601 SmallBlockChainStream* This, 00602 ULARGE_INTEGER offset, 00603 ULONG size, 00604 void* buffer, 00605 ULONG* bytesRead) DECLSPEC_HIDDEN; 00606 00607 HRESULT SmallBlockChainStream_WriteAt( 00608 SmallBlockChainStream* This, 00609 ULARGE_INTEGER offset, 00610 ULONG size, 00611 const void* buffer, 00612 ULONG* bytesWritten) DECLSPEC_HIDDEN; 00613 00614 BOOL SmallBlockChainStream_SetSize( 00615 SmallBlockChainStream* This, 00616 ULARGE_INTEGER newSize) DECLSPEC_HIDDEN; 00617 00618 00619 #endif /* __STORAGE32_H__ */ Generated on Sat May 26 2012 04:24:14 for ReactOS by
1.7.6.1
|