30#ifndef __STORAGE32_H__
31#define __STORAGE32_H__
88#define DIRENTRY_NAME_MAX_LEN 0x20
89#define DIRENTRY_NAME_BUFFER_LEN 0x40
91#define RAW_DIRENTRY_SIZE 0x00000080
93#define HEADER_SIZE 512
95#define MIN_BIG_BLOCK_SIZE 0x200
96#define MAX_BIG_BLOCK_SIZE 0x1000
101#define DIRENTRY_RELATION_PREVIOUS 0
102#define DIRENTRY_RELATION_NEXT 1
103#define DIRENTRY_RELATION_DIR 2
108#define STGTY_ROOT 0x05
110#define COUNT_BBDEPOTINHEADER 109
113#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
115#define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f)
116#define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0)
117#define STGM_CREATE_MODE(stgm) ((stgm)&0x0f000)
119#define STGM_KNOWN_FLAGS (0xf0ff | \
120 STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \
121 STGM_NOSNAPSHOT | STGM_DIRECT_SWMR | STGM_DELETEONRELEASE | STGM_SIMPLE)
363#define BLOCKCHAIN_CACHE_SIZE 4
497#define RANGELOCK_UNK1_FIRST 0x7ffffe00
498#define RANGELOCK_UNK1_LAST 0x7fffff57
499#define RANGELOCK_PRIORITY1_FIRST 0x7fffff58
500#define RANGELOCK_PRIORITY1_LAST 0x7fffff6b
501#define RANGELOCK_NOSNAPSHOT_FIRST 0x7fffff6c
502#define RANGELOCK_NOSNAPSHOT_LAST 0x7fffff7f
503#define RANGELOCK_COMMIT 0x7fffff80
504#define RANGELOCK_PRIORITY2_FIRST 0x7fffff81
505#define RANGELOCK_PRIORITY2_LAST 0x7fffff91
506#define RANGELOCK_CHECKLOCKS 0x7fffff92
507#define RANGELOCK_READ_FIRST 0x7fffff93
508#define RANGELOCK_READ_LAST 0x7fffffa6
509#define RANGELOCK_WRITE_FIRST 0x7fffffa7
510#define RANGELOCK_WRITE_LAST 0x7fffffba
511#define RANGELOCK_DENY_READ_FIRST 0x7fffffbb
512#define RANGELOCK_DENY_READ_LAST 0x7fffffce
513#define RANGELOCK_DENY_WRITE_FIRST 0x7fffffcf
514#define RANGELOCK_DENY_WRITE_LAST 0x7fffffe2
515#define RANGELOCK_UNK2_FIRST 0x7fffffe3
516#define RANGELOCK_UNK2_LAST 0x7fffffff
517#define RANGELOCK_TRANSACTION_FIRST RANGELOCK_COMMIT
518#define RANGELOCK_TRANSACTION_LAST RANGELOCK_CHECKLOCKS
519#define RANGELOCK_FIRST RANGELOCK_UNK1_FIRST
520#define RANGELOCK_LAST RANGELOCK_UNK2_LAST
523#define WINE_LOCK_READ 0x80000000
529#ifdef WORDS_BIGENDIAN
532#define htole32(x) RtlUlongByteSwap(x)
535#define htole16(x) RtlUshortByteSwap(x)
537#define lendian32toh(x) RtlUlongByteSwap(x)
538#define lendian16toh(x) RtlUshortByteSwap(x)
543#define htole32(x) (x)
546#define htole16(x) (x)
548#define lendian32toh(x) (x)
549#define lendian16toh(x) (x)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLsizei GLuint GLint * bytesWritten
struct _ULARGE_INTEGER ULARGE_INTEGER
interface IStorage * LPSTORAGE
static HRESULT StorageBaseImpl_DestroyDirEntry(StorageBaseImpl *This, DirRef index)
static HRESULT StorageBaseImpl_GetFilename(StorageBaseImpl *This, LPWSTR *result)
static const WORD MIN_BIG_BLOCK_SIZE_BITS
static const ULONG OFFSET_BIGBLOCKSIZEBITS
static HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER newsize)
static const ULONG OFFSET_MAJORVERSION
static const ULONG OFFSET_PS_CTIMELOW
static StgStreamImpl * impl_from_IStream(IStream *iface)
static const ULONG OFFSET_MINORVERSION
static const WORD DEF_BIG_BLOCK_SIZE
static HRESULT StorageBaseImpl_CreateDirEntry(StorageBaseImpl *This, const DirEntry *newData, DirRef *index)
static const ULONG OFFSET_PS_STGTYPE
static const ULONG OFFSET_DIRSECTORCOUNT
static void StorageBaseImpl_Invalidate(StorageBaseImpl *This)
static HRESULT StorageBaseImpl_WriteDirEntry(StorageBaseImpl *This, DirRef index, const DirEntry *data)
static const ULONG OFFSET_PS_LEFTCHILD
void StorageUtl_WriteWord(BYTE *buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN
static const ULONG OFFSET_SMALLBLOCKLIMIT
HRESULT STORAGE_CreateOleStream(IStorage *, DWORD) DECLSPEC_HIDDEN
static HRESULT StorageBaseImpl_StreamLink(StorageBaseImpl *This, DirRef dst, DirRef src)
static HRESULT StorageBaseImpl_LockTransaction(StorageBaseImpl *This, BOOL write)
static const ULONG OFFSET_PS_MTIMELOW
static HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
void StorageBaseImpl_AddStream(StorageBaseImpl *stg, StgStreamImpl *strm) DECLSPEC_HIDDEN
static const ULONG OFFSET_EXTBBDEPOTCOUNT
static const WORD DEF_SMALL_BLOCK_SIZE_BITS
HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName) DECLSPEC_HIDDEN
static const ULONG BLOCK_UNUSED
void StorageUtl_ReadULargeInteger(const BYTE *buffer, ULONG offset, ULARGE_INTEGER *value) DECLSPEC_HIDDEN
static const ULONG DIRENTRY_NULL
#define DIRENTRY_NAME_MAX_LEN
static const ULONG OFFSET_SBDEPOTSTART
static const ULONG OFFSET_PS_MTIMEHIGH
void StorageUtl_WriteULargeInteger(BYTE *buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN
static const WORD DEF_BIG_BLOCK_SIZE_BITS
static const ULONG OFFSET_BBDEPOTSTART
#define MAX_BIG_BLOCK_SIZE
static const ULONG OFFSET_ROOTSTARTBLOCK
static const ULONG BLOCK_EXTBBDEPOT
static const ULONG OFFSET_EXTBBDEPOTSTART
#define BLOCKCHAIN_CACHE_SIZE
static void StorageBaseImpl_Destroy(StorageBaseImpl *This)
static const ULONG OFFSET_PS_CTIMEHIGH
static const ULONG BLOCK_SPECIAL
static const ULONG OFFSET_PS_SIZE_HIGH
static const WORD DEF_SMALL_BLOCK_SIZE
static const ULONG OFFSET_PS_DIRROOT
static const ULONG OFFSET_TRANSACTIONSIG
static const ULONG OFFSET_PS_NAME
static const ULONG OFFSET_SMALLBLOCKSIZEBITS
static HRESULT StorageBaseImpl_GetTransactionSig(StorageBaseImpl *This, ULONG *result, BOOL refresh)
static HRESULT StorageBaseImpl_Flush(StorageBaseImpl *This)
static const ULONG OFFSET_BBDEPOTCOUNT
void StorageUtl_WriteGUID(BYTE *buffer, ULONG offset, const GUID *value) DECLSPEC_HIDDEN
static HRESULT StorageBaseImpl_SetTransactionSig(StorageBaseImpl *This, ULONG value)
void StorageUtl_ReadDWord(const BYTE *buffer, ULONG offset, DWORD *value) DECLSPEC_HIDDEN
void StorageUtl_WriteDWord(BYTE *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN
static const ULONG BLOCK_END_OF_CHAIN
static const ULONG OFFSET_PS_NAMELENGTH
HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN
static const ULONG OFFSET_SBDEPOTCOUNT
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage, STATSTG *destination, const DirEntry *source, int statFlags) DECLSPEC_HIDDEN
static const WORD MAX_BIG_BLOCK_SIZE_BITS
static const ULONG OFFSET_PS_SIZE
static const ULONG BLOCK_FIRST_SPECIAL
void StorageBaseImpl_RemoveStream(StorageBaseImpl *stg, StgStreamImpl *strm) DECLSPEC_HIDDEN
static HRESULT StorageBaseImpl_ReadDirEntry(StorageBaseImpl *This, DirRef index, DirEntry *data)
void StorageUtl_ReadGUID(const BYTE *buffer, ULONG offset, GUID *value) DECLSPEC_HIDDEN
static const ULONG OFFSET_BYTEORDERMARKER
static HRESULT StorageBaseImpl_UnlockTransaction(StorageBaseImpl *This, BOOL write)
void StorageUtl_ReadWord(const BYTE *buffer, ULONG offset, WORD *value) DECLSPEC_HIDDEN
static const ULONG OFFSET_PS_RIGHTCHILD
#define COUNT_BBDEPOTINHEADER
static const ULONG OFFSET_PS_STARTBLOCK
static const ULONG OFFSET_PS_GUID
StgStreamImpl * StgStreamImpl_Construct(StorageBaseImpl *parentStorage, DWORD grfMode, DirRef dirEntry) DECLSPEC_HIDDEN
struct list StrmListEntry
StorageBaseImpl * parentStorage
ULARGE_INTEGER currentPosition
HRESULT(* StreamLink)(StorageBaseImpl *, DirRef, DirRef)
HRESULT(* ReadDirEntry)(StorageBaseImpl *, DirRef, DirEntry *)
HRESULT(* Flush)(StorageBaseImpl *)
HRESULT(* StreamWriteAt)(StorageBaseImpl *, DirRef, ULARGE_INTEGER, ULONG, const void *, ULONG *)
HRESULT(* WriteDirEntry)(StorageBaseImpl *, DirRef, const DirEntry *)
HRESULT(* UnlockTransaction)(StorageBaseImpl *, BOOL)
HRESULT(* GetTransactionSig)(StorageBaseImpl *, ULONG *, BOOL)
HRESULT(* SetTransactionSig)(StorageBaseImpl *, ULONG)
HRESULT(* CreateDirEntry)(StorageBaseImpl *, const DirEntry *, DirRef *)
void(* Invalidate)(StorageBaseImpl *)
HRESULT(* StreamSetSize)(StorageBaseImpl *, DirRef, ULARGE_INTEGER)
HRESULT(* StreamReadAt)(StorageBaseImpl *, DirRef, ULARGE_INTEGER, ULONG, void *, ULONG *)
void(* Destroy)(StorageBaseImpl *)
HRESULT(* GetFilename)(StorageBaseImpl *, LPWSTR *)
HRESULT(* DestroyDirEntry)(StorageBaseImpl *, DirRef)
HRESULT(* LockTransaction)(StorageBaseImpl *, BOOL)
enum swmr_mode lockingrole
IPropertySetStorage IPropertySetStorage_iface
IDirectWriterLock IDirectWriterLock_iface
StorageBaseImpl * transactedChild
const StorageBaseImplVtbl * baseVtbl
ULONG * extBigBlockDepotLocations
ULONG smallBlockDepotStart
ULONG extBigBlockDepotStart
ULONG extBigBlockDepotCount
BlockChainStream * smallBlockDepotChain
ULONG firstFreeSmallBlock
ULONG indexBlockDepotCached
BlockChainStream * smallBlockRootChain
ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER]
BlockChainStream * rootBlockChain
ULONG extBigBlockDepotLocationsSize
BlockChainStream * blockChainCache[BLOCKCHAIN_CACHE_SIZE]
ULONG blockDepotCached[MAX_BIG_BLOCK_SIZE/4]
ULONG extBlockDepotCached[MAX_BIG_BLOCK_SIZE/4]
ULONG indexExtBlockDepotCached
#define CONTAINING_RECORD(address, type, field)