1999-01-30 13:24:23 +00:00
|
|
|
/*
|
|
|
|
* Compound Storage (32 bit version)
|
|
|
|
*
|
|
|
|
* Implemented using the documentation of the LAOLA project at
|
|
|
|
* <URL:http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/index.html>
|
|
|
|
* (Thanks to Martin Schwartz <schwartz@cs.tu-berlin.de>)
|
|
|
|
*
|
|
|
|
* This include file contains definitions of types and function
|
|
|
|
* prototypes that are used in the many files implementing the
|
|
|
|
* storage functionality
|
|
|
|
*
|
|
|
|
* Copyright 1998,1999 Francis Beaudet
|
|
|
|
* Copyright 1998,1999 Thuy Nguyen
|
2002-03-09 23:29:33 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-01-30 13:24:23 +00:00
|
|
|
*/
|
|
|
|
#ifndef __STORAGE32_H__
|
|
|
|
#define __STORAGE32_H__
|
|
|
|
|
1999-08-18 18:35:57 +00:00
|
|
|
#include "wtypes.h"
|
|
|
|
#include "winnt.h"
|
2000-09-26 00:00:55 +00:00
|
|
|
#include "wine/obj_base.h"
|
1999-08-18 18:35:57 +00:00
|
|
|
#include "wine/obj_storage.h"
|
|
|
|
|
1999-01-30 13:24:23 +00:00
|
|
|
/*
|
|
|
|
* Definitions for the file format offsets.
|
|
|
|
*/
|
|
|
|
static const ULONG OFFSET_BIGBLOCKSIZEBITS = 0x0000001e;
|
|
|
|
static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020;
|
|
|
|
static const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C;
|
|
|
|
static const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030;
|
|
|
|
static const ULONG OFFSET_SBDEPOTSTART = 0x0000003C;
|
|
|
|
static const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044;
|
|
|
|
static const ULONG OFFSET_EXTBBDEPOTCOUNT = 0x00000048;
|
|
|
|
static const ULONG OFFSET_BBDEPOTSTART = 0x0000004C;
|
1999-02-05 09:21:51 +00:00
|
|
|
static const ULONG OFFSET_PS_NAME = 0x00000000;
|
|
|
|
static const ULONG OFFSET_PS_NAMELENGTH = 0x00000040;
|
|
|
|
static const ULONG OFFSET_PS_PROPERTYTYPE = 0x00000042;
|
|
|
|
static const ULONG OFFSET_PS_PREVIOUSPROP = 0x00000044;
|
|
|
|
static const ULONG OFFSET_PS_NEXTPROP = 0x00000048;
|
|
|
|
static const ULONG OFFSET_PS_DIRPROP = 0x0000004C;
|
|
|
|
static const ULONG OFFSET_PS_GUID = 0x00000050;
|
|
|
|
static const ULONG OFFSET_PS_TSS1 = 0x00000064;
|
|
|
|
static const ULONG OFFSET_PS_TSD1 = 0x00000068;
|
|
|
|
static const ULONG OFFSET_PS_TSS2 = 0x0000006C;
|
|
|
|
static const ULONG OFFSET_PS_TSD2 = 0x00000070;
|
|
|
|
static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074;
|
|
|
|
static const ULONG OFFSET_PS_SIZE = 0x00000078;
|
1999-01-30 13:24:23 +00:00
|
|
|
static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009;
|
|
|
|
static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006;
|
|
|
|
static const WORD DEF_BIG_BLOCK_SIZE = 0x0200;
|
|
|
|
static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040;
|
1999-02-24 10:36:34 +00:00
|
|
|
static const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC;
|
|
|
|
static const ULONG BLOCK_SPECIAL = 0xFFFFFFFD;
|
|
|
|
static const ULONG BLOCK_END_OF_CHAIN = 0xFFFFFFFE;
|
|
|
|
static const ULONG BLOCK_UNUSED = 0xFFFFFFFF;
|
1999-01-30 13:24:23 +00:00
|
|
|
static const ULONG PROPERTY_NULL = 0xFFFFFFFF;
|
|
|
|
|
|
|
|
#define PROPERTY_NAME_MAX_LEN 0x20
|
|
|
|
#define PROPERTY_NAME_BUFFER_LEN 0x40
|
|
|
|
|
|
|
|
#define PROPSET_BLOCK_SIZE 0x00000080
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Property type of relation
|
|
|
|
*/
|
|
|
|
#define PROPERTY_RELATION_PREVIOUS 0
|
|
|
|
#define PROPERTY_RELATION_NEXT 1
|
|
|
|
#define PROPERTY_RELATION_DIR 2
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Property type constants
|
|
|
|
*/
|
|
|
|
#define PROPTYPE_STORAGE 0x01
|
|
|
|
#define PROPTYPE_STREAM 0x02
|
|
|
|
#define PROPTYPE_ROOT 0x05
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These defines assume a hardcoded blocksize. The code will assert
|
|
|
|
* if the blocksize is different. Some changes will have to be done if it
|
|
|
|
* becomes the case.
|
|
|
|
*/
|
|
|
|
#define BIG_BLOCK_SIZE 0x200
|
|
|
|
#define COUNT_BBDEPOTINHEADER 109
|
|
|
|
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
|
1999-02-24 10:36:34 +00:00
|
|
|
#define NUM_BLOCKS_PER_DEPOT_BLOCK 128
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* These are signatures to detect the type of Document file.
|
|
|
|
*/
|
|
|
|
static const BYTE STORAGE_magic[8] ={0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1};
|
|
|
|
static const BYTE STORAGE_oldmagic[8] ={0xd0,0xcf,0x11,0xe0,0x0e,0x11,0xfc,0x0d};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Forward declarations of all the structures used by the storage
|
|
|
|
* module.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
typedef struct StorageBaseImpl StorageBaseImpl;
|
|
|
|
typedef struct StorageImpl StorageImpl;
|
|
|
|
typedef struct StorageInternalImpl StorageInternalImpl;
|
1999-01-30 13:24:23 +00:00
|
|
|
typedef struct BlockChainStream BlockChainStream;
|
|
|
|
typedef struct SmallBlockChainStream SmallBlockChainStream;
|
|
|
|
typedef struct IEnumSTATSTGImpl IEnumSTATSTGImpl;
|
|
|
|
typedef struct StgProperty StgProperty;
|
|
|
|
typedef struct StgStreamImpl StgStreamImpl;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This utility structure is used to read/write the information in a storage
|
|
|
|
* property.
|
|
|
|
*/
|
|
|
|
struct StgProperty
|
|
|
|
{
|
|
|
|
WCHAR name[PROPERTY_NAME_MAX_LEN];
|
|
|
|
WORD sizeOfNameString;
|
|
|
|
BYTE propertyType;
|
|
|
|
ULONG previousProperty;
|
|
|
|
ULONG nextProperty;
|
|
|
|
ULONG dirProperty;
|
|
|
|
GUID propertyUniqueID;
|
|
|
|
ULONG timeStampS1;
|
|
|
|
ULONG timeStampD1;
|
|
|
|
ULONG timeStampS2;
|
|
|
|
ULONG timeStampD2;
|
|
|
|
ULONG startingBlock;
|
|
|
|
ULARGE_INTEGER size;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* Big Block File support
|
|
|
|
*
|
|
|
|
* The big block file is an abstraction of a flat file separated in
|
|
|
|
* same sized blocks. The implementation for the methods described in
|
|
|
|
* this section appear in stg_bigblockfile.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Declaration of the data structures
|
|
|
|
*/
|
|
|
|
typedef struct BigBlockFile BigBlockFile,*LPBIGBLOCKFILE;
|
|
|
|
typedef struct MappedPage MappedPage,*LPMAPPEDPAGE;
|
|
|
|
|
|
|
|
struct BigBlockFile
|
|
|
|
{
|
1999-05-08 10:05:08 +00:00
|
|
|
BOOL fileBased;
|
1999-01-30 13:24:23 +00:00
|
|
|
ULARGE_INTEGER filesize;
|
|
|
|
ULONG blocksize;
|
1999-02-26 11:11:13 +00:00
|
|
|
HANDLE hfile;
|
|
|
|
HANDLE hfilemap;
|
1999-02-18 15:55:53 +00:00
|
|
|
DWORD flProtect;
|
2000-03-17 15:08:25 +00:00
|
|
|
MappedPage *maplist;
|
|
|
|
MappedPage *victimhead, *victimtail;
|
|
|
|
ULONG num_victim_pages;
|
1999-05-08 10:05:08 +00:00
|
|
|
ILockBytes *pLkbyt;
|
|
|
|
HGLOBAL hbytearray;
|
|
|
|
LPVOID pbytearray;
|
1999-01-30 13:24:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Declaration of the functions used to manipulate the BigBlockFile
|
|
|
|
* data structure.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile,
|
1999-05-08 10:05:08 +00:00
|
|
|
ILockBytes* pLkByt,
|
1999-02-18 15:55:53 +00:00
|
|
|
DWORD openFlags,
|
1999-05-08 10:05:08 +00:00
|
|
|
ULONG blocksize,
|
|
|
|
BOOL fileBased);
|
1999-01-30 13:24:23 +00:00
|
|
|
void BIGBLOCKFILE_Destructor(LPBIGBLOCKFILE This);
|
|
|
|
void* BIGBLOCKFILE_GetBigBlock(LPBIGBLOCKFILE This, ULONG index);
|
|
|
|
void* BIGBLOCKFILE_GetROBigBlock(LPBIGBLOCKFILE This, ULONG index);
|
|
|
|
void BIGBLOCKFILE_ReleaseBigBlock(LPBIGBLOCKFILE This, void *pBlock);
|
|
|
|
void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize);
|
|
|
|
ULARGE_INTEGER BIGBLOCKFILE_GetSize(LPBIGBLOCKFILE This);
|
|
|
|
|
2000-03-24 21:19:02 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Ole Convert support
|
|
|
|
*/
|
|
|
|
|
|
|
|
void OLECONVERT_CreateOleStream(LPSTORAGE pStorage);
|
|
|
|
HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName);
|
|
|
|
|
1999-01-30 13:24:23 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* Storage32BaseImpl definitions.
|
|
|
|
*
|
2002-01-31 21:01:35 +00:00
|
|
|
* This structure defines the base information contained in all implementations
|
|
|
|
* of IStorage32 contained in this file storage implementation.
|
1999-01-30 13:24:23 +00:00
|
|
|
*
|
|
|
|
* In OOP terms, this is the base class for all the IStorage32 implementations
|
|
|
|
* contained in this file.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
struct StorageBaseImpl
|
1999-01-30 13:24:23 +00:00
|
|
|
{
|
2002-01-31 21:01:35 +00:00
|
|
|
ICOM_VFIELD(IStorage); /* Needs to be the first item in the struct
|
1999-10-31 01:59:23 +00:00
|
|
|
* since we want to cast this in a Storage32 pointer */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Reference count of this object
|
|
|
|
*/
|
|
|
|
ULONG ref;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Ancestor storage (top level)
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* ancestorStorage;
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Index of the property for the root of
|
|
|
|
* this storage
|
|
|
|
*/
|
|
|
|
ULONG rootPropertySetIndex;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* virtual Destructor method.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
void (*v_destructor)(StorageBaseImpl*);
|
1999-01-30 13:24:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Prototypes for the methods of the Storage32BaseImpl class.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_QueryInterface(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG WINAPI StorageBaseImpl_AddRef(
|
|
|
|
IStorage* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG WINAPI StorageBaseImpl_Release(
|
|
|
|
IStorage* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_OpenStream(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName, /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
void* reserved1, /* [unique][in] */
|
|
|
|
DWORD grfMode, /* [in] */
|
|
|
|
DWORD reserved2, /* [in] */
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream** ppstm); /* [out] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_OpenStorage(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName, /* [string][unique][in] */
|
|
|
|
IStorage* pstgPriority, /* [unique][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfMode, /* [in] */
|
1999-02-26 11:11:13 +00:00
|
|
|
SNB snbExclude, /* [unique][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD reserved, /* [in] */
|
1999-02-26 11:11:13 +00:00
|
|
|
IStorage** ppstg); /* [out] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_EnumElements(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD reserved1, /* [in] */
|
|
|
|
void* reserved2, /* [size_is][unique][in] */
|
|
|
|
DWORD reserved3, /* [in] */
|
|
|
|
IEnumSTATSTG** ppenum); /* [out] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_Stat(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
STATSTG* pstatstg, /* [out] */
|
|
|
|
DWORD grfStatFlag); /* [in] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_RenameElement(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsOldName, /* [string][in] */
|
|
|
|
const OLECHAR* pwcsNewName); /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_CreateStream(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName, /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfMode, /* [in] */
|
|
|
|
DWORD reserved1, /* [in] */
|
|
|
|
DWORD reserved2, /* [in] */
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream** ppstm); /* [out] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageBaseImpl_SetClass(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
REFCLSID clsid); /* [in] */
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Storage32Impl definitions.
|
|
|
|
*
|
|
|
|
* This implementation of the IStorage32 interface represents a root
|
|
|
|
* storage. Basically, a document file.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
struct StorageImpl
|
1999-01-30 13:24:23 +00:00
|
|
|
{
|
2002-01-31 21:01:35 +00:00
|
|
|
ICOM_VFIELD(IStorage); /* Needs to be the first item in the struct
|
|
|
|
* since we want to cast this in a Storage32 pointer */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Declare the member of the Storage32BaseImpl class to allow
|
|
|
|
* casting as a Storage32BaseImpl
|
|
|
|
*/
|
|
|
|
ULONG ref;
|
1999-02-26 11:11:13 +00:00
|
|
|
struct StorageImpl* ancestorStorage;
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG rootPropertySetIndex;
|
1999-02-26 11:11:13 +00:00
|
|
|
void (*v_destructor)(struct StorageImpl*);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The following data members are specific to the Storage32Impl
|
|
|
|
* class
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
HANDLE hFile; /* Physical support for the Docfile */
|
2002-01-01 00:13:32 +00:00
|
|
|
LPOLESTR pwcsName; /* Full path of the document file */
|
|
|
|
|
2002-01-31 21:01:35 +00:00
|
|
|
/* FIXME: should this be in Storage32BaseImpl ? */
|
|
|
|
WCHAR filename[PROPERTY_NAME_BUFFER_LEN];
|
|
|
|
|
1999-01-30 13:24:23 +00:00
|
|
|
/*
|
|
|
|
* File header
|
|
|
|
*/
|
|
|
|
WORD bigBlockSizeBits;
|
|
|
|
WORD smallBlockSizeBits;
|
|
|
|
ULONG bigBlockSize;
|
|
|
|
ULONG smallBlockSize;
|
|
|
|
ULONG bigBlockDepotCount;
|
|
|
|
ULONG rootStartBlock;
|
|
|
|
ULONG smallBlockDepotStart;
|
|
|
|
ULONG extBigBlockDepotStart;
|
|
|
|
ULONG extBigBlockDepotCount;
|
|
|
|
ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER];
|
1999-02-24 10:36:34 +00:00
|
|
|
|
|
|
|
ULONG blockDepotCached[NUM_BLOCKS_PER_DEPOT_BLOCK];
|
|
|
|
ULONG indexBlockDepotCached;
|
1999-03-09 17:40:00 +00:00
|
|
|
ULONG prevFreeBlock;
|
1999-02-24 10:36:34 +00:00
|
|
|
|
1999-01-30 13:24:23 +00:00
|
|
|
/*
|
|
|
|
* Abstraction of the big block chains for the chains of the header.
|
|
|
|
*/
|
|
|
|
BlockChainStream* rootBlockChain;
|
|
|
|
BlockChainStream* smallBlockDepotChain;
|
|
|
|
BlockChainStream* smallBlockRootChain;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pointer to the big block file abstraction
|
|
|
|
*/
|
|
|
|
BigBlockFile* bigBlockFile;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Method declaration for the Storage32Impl class
|
|
|
|
*/
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_CreateStorage(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName, /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfMode, /* [in] */
|
|
|
|
DWORD dwStgFmt, /* [in] */
|
|
|
|
DWORD reserved2, /* [in] */
|
1999-02-26 11:11:13 +00:00
|
|
|
IStorage** ppstg); /* [out] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_CopyTo(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD ciidExclude, /* [in] */
|
|
|
|
const IID* rgiidExclude, /* [size_is][unique][in] */
|
1999-02-26 11:11:13 +00:00
|
|
|
SNB snbExclude, /* [unique][in] */
|
|
|
|
IStorage* pstgDest); /* [unique][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_MoveElementTo(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName, /* [string][in] */
|
|
|
|
IStorage* pstgDest, /* [unique][in] */
|
|
|
|
const OLECHAR* pwcsNewName, /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfFlags); /* [in] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_Commit(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfCommitFlags); /* [in] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_Revert(
|
|
|
|
IStorage* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_DestroyElement(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName); /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_SetElementTimes(
|
|
|
|
IStorage* iface,
|
|
|
|
const OLECHAR* pwcsName, /* [string][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
const FILETIME* pctime, /* [in] */
|
|
|
|
const FILETIME* patime, /* [in] */
|
|
|
|
const FILETIME* pmtime); /* [in] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageImpl_SetStateBits(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfStateBits, /* [in] */
|
|
|
|
DWORD grfMask); /* [in] */
|
2002-01-01 00:13:32 +00:00
|
|
|
|
|
|
|
HRESULT WINAPI StorageImpl_Stat(IStorage* iface,
|
|
|
|
STATSTG* pstatstg, /* [out] */
|
|
|
|
DWORD grfStatFlag); /* [in] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void StorageImpl_Destroy(
|
|
|
|
StorageImpl* This);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT StorageImpl_Construct(
|
2000-02-25 20:58:25 +00:00
|
|
|
StorageImpl* This,
|
|
|
|
HANDLE hFile,
|
2002-01-01 00:13:32 +00:00
|
|
|
LPCOLESTR pwcsName,
|
2000-02-25 20:58:25 +00:00
|
|
|
ILockBytes* pLkbyt,
|
|
|
|
DWORD openFlags,
|
|
|
|
BOOL fileBased,
|
|
|
|
BOOL fileCreate);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL StorageImpl_ReadBigBlock(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex,
|
|
|
|
void* buffer);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL StorageImpl_WriteBigBlock(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex,
|
|
|
|
void* buffer);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void* StorageImpl_GetROBigBlock(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void* StorageImpl_GetBigBlock(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void StorageImpl_ReleaseBigBlock(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
void* pBigBlock);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG StorageImpl_GetNextFreeBigBlock(
|
|
|
|
StorageImpl* This);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void StorageImpl_FreeBigBlock(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG StorageImpl_GetNextBlockInChain(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void StorageImpl_SetNextBlockInChain(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG blockIndex,
|
|
|
|
ULONG nextBlock);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT StorageImpl_LoadFileHeader(
|
|
|
|
StorageImpl* This);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void StorageImpl_SaveFileHeader(
|
|
|
|
StorageImpl* This);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL StorageImpl_ReadProperty(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG index,
|
|
|
|
StgProperty* buffer);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL StorageImpl_WriteProperty(
|
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG index,
|
|
|
|
StgProperty* buffer);
|
|
|
|
|
1999-02-13 12:10:15 +00:00
|
|
|
BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* This,
|
1999-02-13 12:10:15 +00:00
|
|
|
SmallBlockChainStream** ppsbChain);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG Storage32Impl_GetNextExtendedBlock(StorageImpl* This,
|
1999-02-24 10:36:34 +00:00
|
|
|
ULONG blockIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void Storage32Impl_AddBlockDepot(StorageImpl* This,
|
1999-02-24 10:36:34 +00:00
|
|
|
ULONG blockIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG Storage32Impl_AddExtBlockDepot(StorageImpl* This);
|
1999-02-24 10:36:34 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
ULONG Storage32Impl_GetExtDepotBlock(StorageImpl* This,
|
1999-02-24 10:36:34 +00:00
|
|
|
ULONG depotIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void Storage32Impl_SetExtDepotBlock(StorageImpl* This,
|
1999-02-24 10:36:34 +00:00
|
|
|
ULONG depotIndex,
|
|
|
|
ULONG blockIndex);
|
1999-01-30 13:24:23 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* Storage32InternalImpl definitions.
|
|
|
|
*
|
|
|
|
* Definition of the implementation structure for the IStorage32 interface.
|
|
|
|
* This one implements the IStorage32 interface for storage that are
|
|
|
|
* inside another storage.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
struct StorageInternalImpl
|
1999-01-30 13:24:23 +00:00
|
|
|
{
|
2002-01-31 21:01:35 +00:00
|
|
|
ICOM_VFIELD(IStorage); /* Needs to be the first item in the struct
|
1999-10-31 01:59:23 +00:00
|
|
|
* since we want to cast this in a Storage32 pointer */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Declare the member of the Storage32BaseImpl class to allow
|
|
|
|
* casting as a Storage32BaseImpl
|
|
|
|
*/
|
|
|
|
ULONG ref;
|
1999-02-26 11:11:13 +00:00
|
|
|
struct StorageImpl* ancestorStorage;
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG rootPropertySetIndex;
|
1999-02-26 11:11:13 +00:00
|
|
|
void (*v_destructor)(struct StorageInternalImpl*);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* There is no specific data for this class.
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Method definitions for the Storage32InternalImpl class.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageInternalImpl* StorageInternalImpl_Construct(
|
|
|
|
StorageImpl* ancestorStorage,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG rootTropertyIndex);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
void StorageInternalImpl_Destroy(
|
|
|
|
StorageInternalImpl* This);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageInternalImpl_Commit(
|
|
|
|
IStorage* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfCommitFlags); /* [in] */
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI StorageInternalImpl_Revert(
|
|
|
|
IStorage* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* IEnumSTATSTGImpl definitions.
|
|
|
|
*
|
|
|
|
* Definition of the implementation structure for the IEnumSTATSTGImpl interface.
|
|
|
|
* This class allows iterating through the content of a storage and to find
|
|
|
|
* specific items inside it.
|
|
|
|
*/
|
|
|
|
struct IEnumSTATSTGImpl
|
|
|
|
{
|
2002-01-31 21:01:35 +00:00
|
|
|
ICOM_VFIELD(IEnumSTATSTG); /* Needs to be the first item in the struct
|
1999-01-30 13:24:23 +00:00
|
|
|
* since we want to cast this in a IEnumSTATSTG pointer */
|
|
|
|
|
|
|
|
ULONG ref; /* Reference count */
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* parentStorage; /* Reference to the parent storage */
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG firstPropertyNode; /* Index of the root of the storage to enumerate */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The current implementation of the IEnumSTATSTGImpl class uses a stack
|
|
|
|
* to walk the property sets to get the content of a storage. This stack
|
|
|
|
* is implemented by the following 3 data members
|
|
|
|
*/
|
|
|
|
ULONG stackSize;
|
|
|
|
ULONG stackMaxSize;
|
|
|
|
ULONG* stackToVisit;
|
|
|
|
|
|
|
|
#define ENUMSTATSGT_SIZE_INCREMENT 10
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Method definitions for the IEnumSTATSTGImpl class.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject);
|
|
|
|
|
|
|
|
ULONG WINAPI IEnumSTATSTGImpl_AddRef(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
ULONG WINAPI IEnumSTATSTGImpl_Release(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
HRESULT WINAPI IEnumSTATSTGImpl_Next(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG celt,
|
|
|
|
STATSTG* rgelt,
|
|
|
|
ULONG* pceltFetched);
|
|
|
|
|
|
|
|
HRESULT WINAPI IEnumSTATSTGImpl_Skip(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG celt);
|
|
|
|
|
|
|
|
HRESULT WINAPI IEnumSTATSTGImpl_Reset(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
HRESULT WINAPI IEnumSTATSTGImpl_Clone(
|
1999-02-18 13:26:22 +00:00
|
|
|
IEnumSTATSTG* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
IEnumSTATSTG** ppenum);
|
|
|
|
|
|
|
|
IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* This,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG firstPropertyNode);
|
|
|
|
|
|
|
|
void IEnumSTATSTGImpl_Destroy(
|
|
|
|
IEnumSTATSTGImpl* This);
|
|
|
|
|
|
|
|
void IEnumSTATSTGImpl_PushSearchNode(
|
|
|
|
IEnumSTATSTGImpl* This,
|
|
|
|
ULONG nodeToPush);
|
|
|
|
|
|
|
|
ULONG IEnumSTATSTGImpl_PopSearchNode(
|
|
|
|
IEnumSTATSTGImpl* This,
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL remove);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
ULONG IEnumSTATSTGImpl_FindProperty(
|
|
|
|
IEnumSTATSTGImpl* This,
|
1999-02-26 11:11:13 +00:00
|
|
|
const OLECHAR* lpszPropName,
|
1999-01-30 13:24:23 +00:00
|
|
|
StgProperty* buffer);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
INT IEnumSTATSTGImpl_FindParentProperty(
|
1999-01-30 13:24:23 +00:00
|
|
|
IEnumSTATSTGImpl *This,
|
|
|
|
ULONG childProperty,
|
|
|
|
StgProperty *currentProperty,
|
|
|
|
ULONG *propertyId);
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* StgStreamImpl definitions.
|
|
|
|
*
|
|
|
|
* This class imlements the IStream32 inteface and represents a stream
|
|
|
|
* located inside a storage object.
|
|
|
|
*/
|
|
|
|
struct StgStreamImpl
|
|
|
|
{
|
2002-01-31 21:01:35 +00:00
|
|
|
ICOM_VFIELD(IStream); /* Needs to be the first item in the struct
|
1999-01-30 13:24:23 +00:00
|
|
|
* since we want to cast this in a IStream pointer */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reference count
|
|
|
|
*/
|
|
|
|
ULONG ref;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Storage that is the parent(owner) of the stream
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageBaseImpl* parentStorage;
|
1999-01-30 13:24:23 +00:00
|
|
|
|
2000-02-25 20:58:25 +00:00
|
|
|
/*
|
|
|
|
* Access mode of this stream.
|
|
|
|
*/
|
|
|
|
DWORD grfMode;
|
|
|
|
|
1999-01-30 13:24:23 +00:00
|
|
|
/*
|
|
|
|
* Index of the property that owns (points to) this stream.
|
|
|
|
*/
|
|
|
|
ULONG ownerProperty;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Helper variable that contains the size of the stream
|
|
|
|
*/
|
|
|
|
ULARGE_INTEGER streamSize;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the current position of the cursor in the stream
|
|
|
|
*/
|
|
|
|
ULARGE_INTEGER currentPosition;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The information in the stream is represented by a chain of small blocks
|
|
|
|
* or a chain of large blocks. Depending on the case, one of the two
|
|
|
|
* following variabled points to that information.
|
|
|
|
*/
|
|
|
|
BlockChainStream* bigBlockChain;
|
|
|
|
SmallBlockChainStream* smallBlockChain;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Method definition for the StgStreamImpl class.
|
|
|
|
*/
|
|
|
|
StgStreamImpl* StgStreamImpl_Construct(
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageBaseImpl* parentStorage,
|
2000-02-25 20:58:25 +00:00
|
|
|
DWORD grfMode,
|
|
|
|
ULONG ownerProperty);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
void StgStreamImpl_Destroy(
|
|
|
|
StgStreamImpl* This);
|
|
|
|
|
|
|
|
void StgStreamImpl_OpenBlockChain(
|
|
|
|
StgStreamImpl* This);
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_QueryInterface(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
REFIID riid, /* [in] */
|
|
|
|
void** ppvObject); /* [iid_is][out] */
|
|
|
|
|
|
|
|
ULONG WINAPI StgStreamImpl_AddRef(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
ULONG WINAPI StgStreamImpl_Release(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Read(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
void* pv, /* [length_is][size_is][out] */
|
|
|
|
ULONG cb, /* [in] */
|
|
|
|
ULONG* pcbRead); /* [out] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Write(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
const void* pv, /* [size_is][in] */
|
|
|
|
ULONG cb, /* [in] */
|
|
|
|
ULONG* pcbWritten); /* [out] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Seek(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
LARGE_INTEGER dlibMove, /* [in] */
|
|
|
|
DWORD dwOrigin, /* [in] */
|
|
|
|
ULARGE_INTEGER* plibNewPosition); /* [out] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_SetSize(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULARGE_INTEGER libNewSize); /* [in] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_CopyTo(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
|
|
|
IStream* pstm, /* [unique][in] */
|
1999-01-30 13:24:23 +00:00
|
|
|
ULARGE_INTEGER cb, /* [in] */
|
|
|
|
ULARGE_INTEGER* pcbRead, /* [out] */
|
|
|
|
ULARGE_INTEGER* pcbWritten); /* [out] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Commit(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
DWORD grfCommitFlags); /* [in] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Revert(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface);
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_LockRegion(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULARGE_INTEGER libOffset, /* [in] */
|
|
|
|
ULARGE_INTEGER cb, /* [in] */
|
|
|
|
DWORD dwLockType); /* [in] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_UnlockRegion(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULARGE_INTEGER libOffset, /* [in] */
|
|
|
|
ULARGE_INTEGER cb, /* [in] */
|
|
|
|
DWORD dwLockType); /* [in] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Stat(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
1999-01-30 13:24:23 +00:00
|
|
|
STATSTG* pstatstg, /* [out] */
|
|
|
|
DWORD grfStatFlag); /* [in] */
|
|
|
|
|
|
|
|
HRESULT WINAPI StgStreamImpl_Clone(
|
1999-02-26 11:11:13 +00:00
|
|
|
IStream* iface,
|
|
|
|
IStream** ppstm); /* [out] */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
/********************************************************************************
|
|
|
|
* The StorageUtl_ functions are miscelaneous utility functions. Most of which are
|
|
|
|
* abstractions used to read values from file buffers without having to worry
|
|
|
|
* about bit order
|
|
|
|
*/
|
|
|
|
void StorageUtl_ReadWord(void* buffer, ULONG offset, WORD* value);
|
|
|
|
void StorageUtl_WriteWord(void* buffer, ULONG offset, WORD value);
|
|
|
|
void StorageUtl_ReadDWord(void* buffer, ULONG offset, DWORD* value);
|
|
|
|
void StorageUtl_WriteDWord(void* buffer, ULONG offset, DWORD value);
|
|
|
|
void StorageUtl_ReadGUID(void* buffer, ULONG offset, GUID* value);
|
|
|
|
void StorageUtl_WriteGUID(void* buffer, ULONG offset, GUID* value);
|
|
|
|
void StorageUtl_CopyPropertyToSTATSTG(STATSTG* destination,
|
|
|
|
StgProperty* source,
|
|
|
|
int statFlags);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* BlockChainStream definitions.
|
|
|
|
*
|
|
|
|
* The BlockChainStream class is a utility class that is used to create an
|
|
|
|
* abstraction of the big block chains in the storage file.
|
|
|
|
*/
|
|
|
|
struct BlockChainStream
|
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* parentStorage;
|
1999-03-12 17:06:46 +00:00
|
|
|
ULONG* headOfStreamPlaceHolder;
|
|
|
|
ULONG ownerPropertyIndex;
|
|
|
|
ULONG lastBlockNoInSequence;
|
|
|
|
ULONG lastBlockNoInSequenceIndex;
|
|
|
|
ULONG tailIndex;
|
|
|
|
ULONG numBlocks;
|
1999-01-30 13:24:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Methods for the BlockChainStream class.
|
|
|
|
*/
|
|
|
|
BlockChainStream* BlockChainStream_Construct(
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* parentStorage,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG* headOfStreamPlaceHolder,
|
|
|
|
ULONG propertyIndex);
|
|
|
|
|
|
|
|
void BlockChainStream_Destroy(
|
|
|
|
BlockChainStream* This);
|
|
|
|
|
|
|
|
ULONG BlockChainStream_GetHeadOfChain(
|
|
|
|
BlockChainStream* This);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL BlockChainStream_ReadAt(
|
1999-01-30 13:24:23 +00:00
|
|
|
BlockChainStream* This,
|
|
|
|
ULARGE_INTEGER offset,
|
|
|
|
ULONG size,
|
|
|
|
void* buffer,
|
|
|
|
ULONG* bytesRead);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL BlockChainStream_WriteAt(
|
1999-01-30 13:24:23 +00:00
|
|
|
BlockChainStream* This,
|
|
|
|
ULARGE_INTEGER offset,
|
|
|
|
ULONG size,
|
|
|
|
const void* buffer,
|
|
|
|
ULONG* bytesWritten);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL BlockChainStream_SetSize(
|
1999-01-30 13:24:23 +00:00
|
|
|
BlockChainStream* This,
|
|
|
|
ULARGE_INTEGER newSize);
|
|
|
|
|
|
|
|
ULARGE_INTEGER BlockChainStream_GetSize(
|
|
|
|
BlockChainStream* This);
|
|
|
|
|
|
|
|
ULONG BlockChainStream_GetCount(
|
|
|
|
BlockChainStream* This);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* SmallBlockChainStream definitions.
|
|
|
|
*
|
|
|
|
* The SmallBlockChainStream class is a utility class that is used to create an
|
|
|
|
* abstraction of the small block chains in the storage file.
|
|
|
|
*/
|
|
|
|
struct SmallBlockChainStream
|
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* parentStorage;
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG ownerPropertyIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Methods of the SmallBlockChainStream class.
|
|
|
|
*/
|
|
|
|
SmallBlockChainStream* SmallBlockChainStream_Construct(
|
1999-02-26 11:11:13 +00:00
|
|
|
StorageImpl* parentStorage,
|
1999-01-30 13:24:23 +00:00
|
|
|
ULONG propertyIndex);
|
|
|
|
|
|
|
|
void SmallBlockChainStream_Destroy(
|
|
|
|
SmallBlockChainStream* This);
|
|
|
|
|
|
|
|
ULONG SmallBlockChainStream_GetHeadOfChain(
|
|
|
|
SmallBlockChainStream* This);
|
|
|
|
|
|
|
|
ULONG SmallBlockChainStream_GetNextBlockInChain(
|
|
|
|
SmallBlockChainStream* This,
|
|
|
|
ULONG blockIndex);
|
|
|
|
|
|
|
|
void SmallBlockChainStream_SetNextBlockInChain(
|
|
|
|
SmallBlockChainStream* This,
|
|
|
|
ULONG blockIndex,
|
|
|
|
ULONG nextBlock);
|
|
|
|
|
|
|
|
void SmallBlockChainStream_FreeBlock(
|
|
|
|
SmallBlockChainStream* This,
|
|
|
|
ULONG blockIndex);
|
|
|
|
|
|
|
|
ULONG SmallBlockChainStream_GetNextFreeBlock(
|
|
|
|
SmallBlockChainStream* This);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL SmallBlockChainStream_ReadAt(
|
1999-01-30 13:24:23 +00:00
|
|
|
SmallBlockChainStream* This,
|
|
|
|
ULARGE_INTEGER offset,
|
|
|
|
ULONG size,
|
|
|
|
void* buffer,
|
|
|
|
ULONG* bytesRead);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL SmallBlockChainStream_WriteAt(
|
1999-01-30 13:24:23 +00:00
|
|
|
SmallBlockChainStream* This,
|
|
|
|
ULARGE_INTEGER offset,
|
|
|
|
ULONG size,
|
|
|
|
const void* buffer,
|
|
|
|
ULONG* bytesWritten);
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL SmallBlockChainStream_SetSize(
|
1999-01-30 13:24:23 +00:00
|
|
|
SmallBlockChainStream* This,
|
|
|
|
ULARGE_INTEGER newSize);
|
|
|
|
|
|
|
|
ULARGE_INTEGER SmallBlockChainStream_GetSize(
|
|
|
|
SmallBlockChainStream* This);
|
|
|
|
|
|
|
|
ULONG SmallBlockChainStream_GetCount(
|
|
|
|
SmallBlockChainStream* This);
|
|
|
|
|
|
|
|
|
1999-04-22 16:27:50 +00:00
|
|
|
#endif /* __STORAGE32_H__ */
|
1999-01-30 13:24:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|