ole32: Add a DirRef type for references to directory entries.
This commit is contained in:
parent
d3dbc8b1e6
commit
e77e9e45aa
|
@ -962,7 +962,7 @@ static const IStreamVtbl StgStreamImpl_Vtbl =
|
||||||
StgStreamImpl* StgStreamImpl_Construct(
|
StgStreamImpl* StgStreamImpl_Construct(
|
||||||
StorageBaseImpl* parentStorage,
|
StorageBaseImpl* parentStorage,
|
||||||
DWORD grfMode,
|
DWORD grfMode,
|
||||||
ULONG dirEntry)
|
DirRef dirEntry)
|
||||||
{
|
{
|
||||||
StgStreamImpl* newStream;
|
StgStreamImpl* newStream;
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ typedef struct StorageInternalImpl StorageInternalImpl;
|
||||||
|
|
||||||
/* Method definitions for the Storage32InternalImpl class. */
|
/* Method definitions for the Storage32InternalImpl class. */
|
||||||
static StorageInternalImpl* StorageInternalImpl_Construct(StorageImpl* ancestorStorage,
|
static StorageInternalImpl* StorageInternalImpl_Construct(StorageImpl* ancestorStorage,
|
||||||
DWORD openFlags, ULONG rootTropertyIndex);
|
DWORD openFlags, DirRef storageDirEntry);
|
||||||
static void StorageImpl_Destroy(StorageBaseImpl* iface);
|
static void StorageImpl_Destroy(StorageBaseImpl* iface);
|
||||||
static BOOL StorageImpl_ReadBigBlock(StorageImpl* This, ULONG blockIndex, void* buffer);
|
static BOOL StorageImpl_ReadBigBlock(StorageImpl* This, ULONG blockIndex, void* buffer);
|
||||||
static BOOL StorageImpl_WriteBigBlock(StorageImpl* This, ULONG blockIndex, const void* buffer);
|
static BOOL StorageImpl_WriteBigBlock(StorageImpl* This, ULONG blockIndex, const void* buffer);
|
||||||
|
@ -161,18 +161,18 @@ typedef struct
|
||||||
*/
|
*/
|
||||||
static HRESULT deleteStorageContents(
|
static HRESULT deleteStorageContents(
|
||||||
StorageBaseImpl *parentStorage,
|
StorageBaseImpl *parentStorage,
|
||||||
ULONG indexToDelete,
|
DirRef indexToDelete,
|
||||||
DirEntry entryDataToDelete);
|
DirEntry entryDataToDelete);
|
||||||
|
|
||||||
static HRESULT deleteStreamContents(
|
static HRESULT deleteStreamContents(
|
||||||
StorageBaseImpl *parentStorage,
|
StorageBaseImpl *parentStorage,
|
||||||
ULONG indexToDelete,
|
DirRef indexToDelete,
|
||||||
DirEntry entryDataToDelete);
|
DirEntry entryDataToDelete);
|
||||||
|
|
||||||
static HRESULT removeFromTree(
|
static HRESULT removeFromTree(
|
||||||
StorageImpl *This,
|
StorageImpl *This,
|
||||||
ULONG parentStorageIndex,
|
DirRef parentStorageIndex,
|
||||||
ULONG deletedIndex);
|
DirRef deletedIndex);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Declaration of the functions used to manipulate DirEntry
|
* Declaration of the functions used to manipulate DirEntry
|
||||||
|
@ -181,33 +181,33 @@ static HRESULT removeFromTree(
|
||||||
static HRESULT createDirEntry(
|
static HRESULT createDirEntry(
|
||||||
StorageImpl *storage,
|
StorageImpl *storage,
|
||||||
const DirEntry *newData,
|
const DirEntry *newData,
|
||||||
ULONG *index);
|
DirRef *index);
|
||||||
|
|
||||||
static HRESULT destroyDirEntry(
|
static HRESULT destroyDirEntry(
|
||||||
StorageImpl *storage,
|
StorageImpl *storage,
|
||||||
ULONG index);
|
DirRef index);
|
||||||
|
|
||||||
static HRESULT insertIntoTree(
|
static HRESULT insertIntoTree(
|
||||||
StorageImpl *This,
|
StorageImpl *This,
|
||||||
ULONG parentStorageIndex,
|
DirRef parentStorageIndex,
|
||||||
ULONG newEntryIndex);
|
DirRef newEntryIndex);
|
||||||
|
|
||||||
static LONG entryNameCmp(
|
static LONG entryNameCmp(
|
||||||
const OLECHAR *name1,
|
const OLECHAR *name1,
|
||||||
const OLECHAR *name2);
|
const OLECHAR *name2);
|
||||||
|
|
||||||
static ULONG findElement(
|
static DirRef findElement(
|
||||||
StorageImpl *storage,
|
StorageImpl *storage,
|
||||||
ULONG storageEntry,
|
DirRef storageEntry,
|
||||||
const OLECHAR *name,
|
const OLECHAR *name,
|
||||||
DirEntry *data);
|
DirEntry *data);
|
||||||
|
|
||||||
static HRESULT findTreeParent(
|
static HRESULT findTreeParent(
|
||||||
StorageImpl *storage,
|
StorageImpl *storage,
|
||||||
ULONG storageEntry,
|
DirRef storageEntry,
|
||||||
const OLECHAR *childName,
|
const OLECHAR *childName,
|
||||||
DirEntry *parentData,
|
DirEntry *parentData,
|
||||||
ULONG *parentEntry,
|
DirRef *parentEntry,
|
||||||
ULONG *relation);
|
ULONG *relation);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -236,7 +236,7 @@ struct IEnumSTATSTGImpl
|
||||||
|
|
||||||
LONG ref; /* Reference count */
|
LONG ref; /* Reference count */
|
||||||
StorageImpl* parentStorage; /* Reference to the parent storage */
|
StorageImpl* parentStorage; /* Reference to the parent storage */
|
||||||
ULONG storageDirEntry; /* Directory entry of the storage to enumerate */
|
DirRef storageDirEntry; /* Directory entry of the storage to enumerate */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The current implementation of the IEnumSTATSTGImpl class uses a stack
|
* The current implementation of the IEnumSTATSTGImpl class uses a stack
|
||||||
|
@ -245,16 +245,16 @@ struct IEnumSTATSTGImpl
|
||||||
*/
|
*/
|
||||||
ULONG stackSize;
|
ULONG stackSize;
|
||||||
ULONG stackMaxSize;
|
ULONG stackMaxSize;
|
||||||
ULONG* stackToVisit;
|
DirRef* stackToVisit;
|
||||||
|
|
||||||
#define ENUMSTATSGT_SIZE_INCREMENT 10
|
#define ENUMSTATSGT_SIZE_INCREMENT 10
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(StorageImpl* This, ULONG storageDirEntry);
|
static IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(StorageImpl* This, DirRef storageDirEntry);
|
||||||
static void IEnumSTATSTGImpl_Destroy(IEnumSTATSTGImpl* This);
|
static void IEnumSTATSTGImpl_Destroy(IEnumSTATSTGImpl* This);
|
||||||
static void IEnumSTATSTGImpl_PushSearchNode(IEnumSTATSTGImpl* This, ULONG nodeToPush);
|
static void IEnumSTATSTGImpl_PushSearchNode(IEnumSTATSTGImpl* This, DirRef nodeToPush);
|
||||||
static ULONG IEnumSTATSTGImpl_PopSearchNode(IEnumSTATSTGImpl* This, BOOL remove);
|
static DirRef IEnumSTATSTGImpl_PopSearchNode(IEnumSTATSTGImpl* This, BOOL remove);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
** Block Functions
|
** Block Functions
|
||||||
|
@ -396,7 +396,7 @@ static HRESULT WINAPI StorageBaseImpl_OpenStream(
|
||||||
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
||||||
StgStreamImpl* newStream;
|
StgStreamImpl* newStream;
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
ULONG streamEntryRef;
|
DirRef streamEntryRef;
|
||||||
HRESULT res = STG_E_UNKNOWN;
|
HRESULT res = STG_E_UNKNOWN;
|
||||||
|
|
||||||
TRACE("(%p, %s, %p, %x, %d, %p)\n",
|
TRACE("(%p, %s, %p, %x, %d, %p)\n",
|
||||||
|
@ -498,7 +498,7 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage(
|
||||||
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
||||||
StorageInternalImpl* newStorage;
|
StorageInternalImpl* newStorage;
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
ULONG storageEntryRef;
|
DirRef storageEntryRef;
|
||||||
HRESULT res = STG_E_UNKNOWN;
|
HRESULT res = STG_E_UNKNOWN;
|
||||||
|
|
||||||
TRACE("(%p, %s, %p, %x, %p, %d, %p)\n",
|
TRACE("(%p, %s, %p, %x, %p, %d, %p)\n",
|
||||||
|
@ -694,7 +694,7 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
|
||||||
{
|
{
|
||||||
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
ULONG currentEntryRef;
|
DirRef currentEntryRef;
|
||||||
|
|
||||||
TRACE("(%p, %s, %s)\n",
|
TRACE("(%p, %s, %s)\n",
|
||||||
iface, debugstr_w(pwcsOldName), debugstr_w(pwcsNewName));
|
iface, debugstr_w(pwcsOldName), debugstr_w(pwcsNewName));
|
||||||
|
@ -765,7 +765,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
|
||||||
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
StorageBaseImpl *This = (StorageBaseImpl *)iface;
|
||||||
StgStreamImpl* newStream;
|
StgStreamImpl* newStream;
|
||||||
DirEntry currentEntry, newStreamEntry;
|
DirEntry currentEntry, newStreamEntry;
|
||||||
ULONG currentEntryRef, newStreamEntryRef;
|
DirRef currentEntryRef, newStreamEntryRef;
|
||||||
|
|
||||||
TRACE("(%p, %s, %x, %d, %d, %p)\n",
|
TRACE("(%p, %s, %x, %d, %d, %p)\n",
|
||||||
iface, debugstr_w(pwcsName), grfMode,
|
iface, debugstr_w(pwcsName), grfMode,
|
||||||
|
@ -965,8 +965,8 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
|
||||||
|
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
DirEntry newEntry;
|
DirEntry newEntry;
|
||||||
ULONG currentEntryRef;
|
DirRef currentEntryRef;
|
||||||
ULONG newEntryRef;
|
DirRef newEntryRef;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("(%p, %s, %x, %d, %d, %p)\n",
|
TRACE("(%p, %s, %x, %d, %d, %p)\n",
|
||||||
|
@ -1091,7 +1091,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
|
||||||
static HRESULT createDirEntry(
|
static HRESULT createDirEntry(
|
||||||
StorageImpl *storage,
|
StorageImpl *storage,
|
||||||
const DirEntry *newData,
|
const DirEntry *newData,
|
||||||
ULONG *index)
|
DirRef *index)
|
||||||
{
|
{
|
||||||
ULONG currentEntryIndex = 0;
|
ULONG currentEntryIndex = 0;
|
||||||
ULONG newEntryIndex = DIRENTRY_NULL;
|
ULONG newEntryIndex = DIRENTRY_NULL;
|
||||||
|
@ -1200,7 +1200,7 @@ static HRESULT createDirEntry(
|
||||||
*/
|
*/
|
||||||
static HRESULT destroyDirEntry(
|
static HRESULT destroyDirEntry(
|
||||||
StorageImpl *storage,
|
StorageImpl *storage,
|
||||||
ULONG index)
|
DirRef index)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
BYTE emptyData[RAW_DIRENTRY_SIZE];
|
BYTE emptyData[RAW_DIRENTRY_SIZE];
|
||||||
|
@ -1249,8 +1249,8 @@ static LONG entryNameCmp(
|
||||||
*/
|
*/
|
||||||
static HRESULT insertIntoTree(
|
static HRESULT insertIntoTree(
|
||||||
StorageImpl *This,
|
StorageImpl *This,
|
||||||
ULONG parentStorageIndex,
|
DirRef parentStorageIndex,
|
||||||
ULONG newEntryIndex)
|
DirRef newEntryIndex)
|
||||||
{
|
{
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
DirEntry newEntry;
|
DirEntry newEntry;
|
||||||
|
@ -1276,7 +1276,7 @@ static HRESULT insertIntoTree(
|
||||||
* for the appropriate location.
|
* for the appropriate location.
|
||||||
*/
|
*/
|
||||||
BOOL found = 0;
|
BOOL found = 0;
|
||||||
ULONG current, next, previous, currentEntryId;
|
DirRef current, next, previous, currentEntryId;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Keep a reference to the root of the storage's element tree
|
* Keep a reference to the root of the storage's element tree
|
||||||
|
@ -1367,10 +1367,10 @@ static HRESULT insertIntoTree(
|
||||||
*
|
*
|
||||||
* Find and read the element of a storage with the given name.
|
* Find and read the element of a storage with the given name.
|
||||||
*/
|
*/
|
||||||
static ULONG findElement(StorageImpl *storage, ULONG storageEntry,
|
static DirRef findElement(StorageImpl *storage, DirRef storageEntry,
|
||||||
const OLECHAR *name, DirEntry *data)
|
const OLECHAR *name, DirEntry *data)
|
||||||
{
|
{
|
||||||
ULONG currentEntry;
|
DirRef currentEntry;
|
||||||
|
|
||||||
/* Read the storage entry to find the root of the tree. */
|
/* Read the storage entry to find the root of the tree. */
|
||||||
StorageImpl_ReadDirEntry(storage, storageEntry, data);
|
StorageImpl_ReadDirEntry(storage, storageEntry, data);
|
||||||
|
@ -1408,11 +1408,11 @@ static ULONG findElement(StorageImpl *storage, ULONG storageEntry,
|
||||||
* If there is no such element, find a place where it could be inserted and
|
* If there is no such element, find a place where it could be inserted and
|
||||||
* return STG_E_FILENOTFOUND.
|
* return STG_E_FILENOTFOUND.
|
||||||
*/
|
*/
|
||||||
static HRESULT findTreeParent(StorageImpl *storage, ULONG storageEntry,
|
static HRESULT findTreeParent(StorageImpl *storage, DirRef storageEntry,
|
||||||
const OLECHAR *childName, DirEntry *parentData, ULONG *parentEntry,
|
const OLECHAR *childName, DirEntry *parentData, DirRef *parentEntry,
|
||||||
ULONG *relation)
|
ULONG *relation)
|
||||||
{
|
{
|
||||||
ULONG childEntry;
|
DirRef childEntry;
|
||||||
DirEntry childData;
|
DirEntry childData;
|
||||||
|
|
||||||
/* Read the storage entry to find the root of the tree. */
|
/* Read the storage entry to find the root of the tree. */
|
||||||
|
@ -1719,7 +1719,7 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
|
||||||
|
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
DirEntry entryToDelete;
|
DirEntry entryToDelete;
|
||||||
ULONG entryToDeleteRef;
|
DirRef entryToDeleteRef;
|
||||||
|
|
||||||
TRACE("(%p, %s)\n",
|
TRACE("(%p, %s)\n",
|
||||||
iface, debugstr_w(pwcsName));
|
iface, debugstr_w(pwcsName));
|
||||||
|
@ -1841,7 +1841,7 @@ static void StorageBaseImpl_DeleteAll(StorageBaseImpl * stg)
|
||||||
*/
|
*/
|
||||||
static HRESULT deleteStorageContents(
|
static HRESULT deleteStorageContents(
|
||||||
StorageBaseImpl *parentStorage,
|
StorageBaseImpl *parentStorage,
|
||||||
ULONG indexToDelete,
|
DirRef indexToDelete,
|
||||||
DirEntry entryDataToDelete)
|
DirEntry entryDataToDelete)
|
||||||
{
|
{
|
||||||
IEnumSTATSTG *elements = 0;
|
IEnumSTATSTG *elements = 0;
|
||||||
|
@ -1908,7 +1908,7 @@ static HRESULT deleteStorageContents(
|
||||||
*/
|
*/
|
||||||
static HRESULT deleteStreamContents(
|
static HRESULT deleteStreamContents(
|
||||||
StorageBaseImpl *parentStorage,
|
StorageBaseImpl *parentStorage,
|
||||||
ULONG indexToDelete,
|
DirRef indexToDelete,
|
||||||
DirEntry entryDataToDelete)
|
DirEntry entryDataToDelete)
|
||||||
{
|
{
|
||||||
IStream *pis;
|
IStream *pis;
|
||||||
|
@ -1944,7 +1944,7 @@ static HRESULT deleteStreamContents(
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setEntryLink(DirEntry *entry, ULONG relation, ULONG new_target)
|
static void setEntryLink(DirEntry *entry, ULONG relation, DirRef new_target)
|
||||||
{
|
{
|
||||||
switch (relation)
|
switch (relation)
|
||||||
{
|
{
|
||||||
|
@ -1971,14 +1971,14 @@ static void setEntryLink(DirEntry *entry, ULONG relation, ULONG new_target)
|
||||||
*/
|
*/
|
||||||
static HRESULT removeFromTree(
|
static HRESULT removeFromTree(
|
||||||
StorageImpl *This,
|
StorageImpl *This,
|
||||||
ULONG parentStorageIndex,
|
DirRef parentStorageIndex,
|
||||||
ULONG deletedIndex)
|
DirRef deletedIndex)
|
||||||
{
|
{
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
BOOL res = TRUE;
|
BOOL res = TRUE;
|
||||||
DirEntry entryToDelete;
|
DirEntry entryToDelete;
|
||||||
DirEntry parentEntry;
|
DirEntry parentEntry;
|
||||||
ULONG parentEntryRef;
|
DirRef parentEntryRef;
|
||||||
ULONG typeOfRelation;
|
ULONG typeOfRelation;
|
||||||
|
|
||||||
res = StorageImpl_ReadDirEntry(This, deletedIndex, &entryToDelete);
|
res = StorageImpl_ReadDirEntry(This, deletedIndex, &entryToDelete);
|
||||||
|
@ -2015,7 +2015,7 @@ static HRESULT removeFromTree(
|
||||||
* its children are greater than everything in the left tree, so we
|
* its children are greater than everything in the left tree, so we
|
||||||
* insert it at the rightmost point in the left tree.
|
* insert it at the rightmost point in the left tree.
|
||||||
*/
|
*/
|
||||||
ULONG newRightChildParent = entryToDelete.leftChild;
|
DirRef newRightChildParent = entryToDelete.leftChild;
|
||||||
DirEntry newRightChildParentEntry;
|
DirEntry newRightChildParentEntry;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -2130,7 +2130,7 @@ static HRESULT StorageImpl_Construct(
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
BOOL readSuccessful;
|
BOOL readSuccessful;
|
||||||
ULONG currentEntryRef;
|
DirRef currentEntryRef;
|
||||||
|
|
||||||
if ( FAILED( validateSTGM(openFlags) ))
|
if ( FAILED( validateSTGM(openFlags) ))
|
||||||
return STG_E_INVALIDFLAG;
|
return STG_E_INVALIDFLAG;
|
||||||
|
@ -3116,7 +3116,7 @@ void UpdateRawDirEntry(BYTE *buffer, const DirEntry *newData)
|
||||||
*/
|
*/
|
||||||
BOOL StorageImpl_ReadDirEntry(
|
BOOL StorageImpl_ReadDirEntry(
|
||||||
StorageImpl* This,
|
StorageImpl* This,
|
||||||
ULONG index,
|
DirRef index,
|
||||||
DirEntry* buffer)
|
DirEntry* buffer)
|
||||||
{
|
{
|
||||||
BYTE currentEntry[RAW_DIRENTRY_SIZE];
|
BYTE currentEntry[RAW_DIRENTRY_SIZE];
|
||||||
|
@ -3205,7 +3205,7 @@ BOOL StorageImpl_ReadDirEntry(
|
||||||
*/
|
*/
|
||||||
BOOL StorageImpl_WriteDirEntry(
|
BOOL StorageImpl_WriteDirEntry(
|
||||||
StorageImpl* This,
|
StorageImpl* This,
|
||||||
ULONG index,
|
DirRef index,
|
||||||
const DirEntry* buffer)
|
const DirEntry* buffer)
|
||||||
{
|
{
|
||||||
BYTE currentEntry[RAW_DIRENTRY_SIZE];
|
BYTE currentEntry[RAW_DIRENTRY_SIZE];
|
||||||
|
@ -3298,7 +3298,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
|
||||||
ULARGE_INTEGER size, offset;
|
ULARGE_INTEGER size, offset;
|
||||||
ULONG cbRead, cbWritten;
|
ULONG cbRead, cbWritten;
|
||||||
ULARGE_INTEGER cbTotalRead;
|
ULARGE_INTEGER cbTotalRead;
|
||||||
ULONG streamEntryRef;
|
DirRef streamEntryRef;
|
||||||
HRESULT resWrite = S_OK;
|
HRESULT resWrite = S_OK;
|
||||||
HRESULT resRead;
|
HRESULT resRead;
|
||||||
DirEntry streamEntry;
|
DirEntry streamEntry;
|
||||||
|
@ -3410,7 +3410,8 @@ SmallBlockChainStream* Storage32Impl_BigBlocksToSmallBlocks(
|
||||||
BlockChainStream** ppbbChain)
|
BlockChainStream** ppbbChain)
|
||||||
{
|
{
|
||||||
ULARGE_INTEGER size, offset, cbTotalRead;
|
ULARGE_INTEGER size, offset, cbTotalRead;
|
||||||
ULONG cbRead, cbWritten, streamEntryRef, sbHeadOfChain = BLOCK_END_OF_CHAIN;
|
ULONG cbRead, cbWritten, sbHeadOfChain = BLOCK_END_OF_CHAIN;
|
||||||
|
DirRef streamEntryRef;
|
||||||
HRESULT resWrite = S_OK, resRead;
|
HRESULT resWrite = S_OK, resRead;
|
||||||
DirEntry streamEntry;
|
DirEntry streamEntry;
|
||||||
BYTE* buffer;
|
BYTE* buffer;
|
||||||
|
@ -3577,7 +3578,7 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Next(
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
STATSTG* currentReturnStruct = rgelt;
|
STATSTG* currentReturnStruct = rgelt;
|
||||||
ULONG objectFetched = 0;
|
ULONG objectFetched = 0;
|
||||||
ULONG currentSearchNode;
|
DirRef currentSearchNode;
|
||||||
|
|
||||||
if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) )
|
if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) )
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -3654,7 +3655,7 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Skip(
|
||||||
|
|
||||||
DirEntry currentEntry;
|
DirEntry currentEntry;
|
||||||
ULONG objectFetched = 0;
|
ULONG objectFetched = 0;
|
||||||
ULONG currentSearchNode;
|
DirRef currentSearchNode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start with the node at the top of the stack.
|
* Start with the node at the top of the stack.
|
||||||
|
@ -3762,7 +3763,7 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Clone(
|
||||||
memcpy(
|
memcpy(
|
||||||
newClone->stackToVisit,
|
newClone->stackToVisit,
|
||||||
This->stackToVisit,
|
This->stackToVisit,
|
||||||
sizeof(ULONG) * newClone->stackSize);
|
sizeof(DirRef) * newClone->stackSize);
|
||||||
|
|
||||||
*ppenum = (IEnumSTATSTG*)newClone;
|
*ppenum = (IEnumSTATSTG*)newClone;
|
||||||
|
|
||||||
|
@ -3777,7 +3778,7 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Clone(
|
||||||
|
|
||||||
static void IEnumSTATSTGImpl_PushSearchNode(
|
static void IEnumSTATSTGImpl_PushSearchNode(
|
||||||
IEnumSTATSTGImpl* This,
|
IEnumSTATSTGImpl* This,
|
||||||
ULONG nodeToPush)
|
DirRef nodeToPush)
|
||||||
{
|
{
|
||||||
DirEntry storageEntry;
|
DirEntry storageEntry;
|
||||||
BOOL readSuccessful;
|
BOOL readSuccessful;
|
||||||
|
@ -3799,7 +3800,7 @@ static void IEnumSTATSTGImpl_PushSearchNode(
|
||||||
GetProcessHeap(),
|
GetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
This->stackToVisit,
|
This->stackToVisit,
|
||||||
sizeof(ULONG) * This->stackMaxSize);
|
sizeof(DirRef) * This->stackMaxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
This->stackToVisit[This->stackSize] = nodeToPush;
|
This->stackToVisit[This->stackSize] = nodeToPush;
|
||||||
|
@ -3824,11 +3825,11 @@ static void IEnumSTATSTGImpl_PushSearchNode(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG IEnumSTATSTGImpl_PopSearchNode(
|
static DirRef IEnumSTATSTGImpl_PopSearchNode(
|
||||||
IEnumSTATSTGImpl* This,
|
IEnumSTATSTGImpl* This,
|
||||||
BOOL remove)
|
BOOL remove)
|
||||||
{
|
{
|
||||||
ULONG topNode;
|
DirRef topNode;
|
||||||
|
|
||||||
if (This->stackSize == 0)
|
if (This->stackSize == 0)
|
||||||
return DIRENTRY_NULL;
|
return DIRENTRY_NULL;
|
||||||
|
@ -3861,7 +3862,7 @@ static const IEnumSTATSTGVtbl IEnumSTATSTGImpl_Vtbl =
|
||||||
|
|
||||||
static IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(
|
static IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(
|
||||||
StorageImpl* parentStorage,
|
StorageImpl* parentStorage,
|
||||||
ULONG storageDirEntry)
|
DirRef storageDirEntry)
|
||||||
{
|
{
|
||||||
IEnumSTATSTGImpl* newEnumeration;
|
IEnumSTATSTGImpl* newEnumeration;
|
||||||
|
|
||||||
|
@ -3890,7 +3891,7 @@ static IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(
|
||||||
newEnumeration->stackSize = 0;
|
newEnumeration->stackSize = 0;
|
||||||
newEnumeration->stackMaxSize = ENUMSTATSGT_SIZE_INCREMENT;
|
newEnumeration->stackMaxSize = ENUMSTATSGT_SIZE_INCREMENT;
|
||||||
newEnumeration->stackToVisit =
|
newEnumeration->stackToVisit =
|
||||||
HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG)*ENUMSTATSGT_SIZE_INCREMENT);
|
HeapAlloc(GetProcessHeap(), 0, sizeof(DirRef)*ENUMSTATSGT_SIZE_INCREMENT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure the current node of the iterator is the first one.
|
* Make sure the current node of the iterator is the first one.
|
||||||
|
@ -3933,7 +3934,7 @@ static const IStorageVtbl Storage32InternalImpl_Vtbl =
|
||||||
static StorageInternalImpl* StorageInternalImpl_Construct(
|
static StorageInternalImpl* StorageInternalImpl_Construct(
|
||||||
StorageImpl* ancestorStorage,
|
StorageImpl* ancestorStorage,
|
||||||
DWORD openFlags,
|
DWORD openFlags,
|
||||||
ULONG storageDirEntry)
|
DirRef storageDirEntry)
|
||||||
{
|
{
|
||||||
StorageInternalImpl* newStorage;
|
StorageInternalImpl* newStorage;
|
||||||
|
|
||||||
|
@ -4103,7 +4104,7 @@ void StorageUtl_CopyDirEntryToSTATSTG(
|
||||||
BlockChainStream* BlockChainStream_Construct(
|
BlockChainStream* BlockChainStream_Construct(
|
||||||
StorageImpl* parentStorage,
|
StorageImpl* parentStorage,
|
||||||
ULONG* headOfStreamPlaceHolder,
|
ULONG* headOfStreamPlaceHolder,
|
||||||
ULONG dirEntry)
|
DirRef dirEntry)
|
||||||
{
|
{
|
||||||
BlockChainStream* newStream;
|
BlockChainStream* newStream;
|
||||||
ULONG blockIndex;
|
ULONG blockIndex;
|
||||||
|
@ -4653,7 +4654,7 @@ static ULARGE_INTEGER BlockChainStream_GetSize(BlockChainStream* This)
|
||||||
SmallBlockChainStream* SmallBlockChainStream_Construct(
|
SmallBlockChainStream* SmallBlockChainStream_Construct(
|
||||||
StorageImpl* parentStorage,
|
StorageImpl* parentStorage,
|
||||||
ULONG* headOfStreamPlaceHolder,
|
ULONG* headOfStreamPlaceHolder,
|
||||||
ULONG dirEntry)
|
DirRef dirEntry)
|
||||||
{
|
{
|
||||||
SmallBlockChainStream* newStream;
|
SmallBlockChainStream* newStream;
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,11 @@ typedef struct IEnumSTATSTGImpl IEnumSTATSTGImpl;
|
||||||
typedef struct DirEntry DirEntry;
|
typedef struct DirEntry DirEntry;
|
||||||
typedef struct StgStreamImpl StgStreamImpl;
|
typedef struct StgStreamImpl StgStreamImpl;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A reference to a directory entry in the file or a transacted cache.
|
||||||
|
*/
|
||||||
|
typedef ULONG DirRef;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This utility structure is used to read/write the information in a directory
|
* This utility structure is used to read/write the information in a directory
|
||||||
* entry.
|
* entry.
|
||||||
|
@ -130,9 +135,9 @@ struct DirEntry
|
||||||
WCHAR name[DIRENTRY_NAME_MAX_LEN];
|
WCHAR name[DIRENTRY_NAME_MAX_LEN];
|
||||||
WORD sizeOfNameString;
|
WORD sizeOfNameString;
|
||||||
BYTE stgType;
|
BYTE stgType;
|
||||||
ULONG leftChild;
|
DirRef leftChild;
|
||||||
ULONG rightChild;
|
DirRef rightChild;
|
||||||
ULONG dirRootEntry;
|
DirRef dirRootEntry;
|
||||||
GUID clsid;
|
GUID clsid;
|
||||||
FILETIME ctime;
|
FILETIME ctime;
|
||||||
FILETIME mtime;
|
FILETIME mtime;
|
||||||
|
@ -209,7 +214,7 @@ struct StorageBaseImpl
|
||||||
/*
|
/*
|
||||||
* Index of the directory entry of this storage
|
* Index of the directory entry of this storage
|
||||||
*/
|
*/
|
||||||
ULONG storageDirEntry;
|
DirRef storageDirEntry;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* virtual Destructor method.
|
* virtual Destructor method.
|
||||||
|
@ -303,12 +308,12 @@ HRESULT StorageImpl_WriteRawDirEntry(
|
||||||
|
|
||||||
BOOL StorageImpl_ReadDirEntry(
|
BOOL StorageImpl_ReadDirEntry(
|
||||||
StorageImpl* This,
|
StorageImpl* This,
|
||||||
ULONG index,
|
DirRef index,
|
||||||
DirEntry* buffer);
|
DirEntry* buffer);
|
||||||
|
|
||||||
BOOL StorageImpl_WriteDirEntry(
|
BOOL StorageImpl_WriteDirEntry(
|
||||||
StorageImpl* This,
|
StorageImpl* This,
|
||||||
ULONG index,
|
DirRef index,
|
||||||
const DirEntry* buffer);
|
const DirEntry* buffer);
|
||||||
|
|
||||||
BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
|
BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
|
||||||
|
@ -354,7 +359,7 @@ struct StgStreamImpl
|
||||||
/*
|
/*
|
||||||
* Index of the directory entry that owns (points to) this stream.
|
* Index of the directory entry that owns (points to) this stream.
|
||||||
*/
|
*/
|
||||||
ULONG dirEntry;
|
DirRef dirEntry;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper variable that contains the size of the stream
|
* Helper variable that contains the size of the stream
|
||||||
|
@ -381,7 +386,7 @@ struct StgStreamImpl
|
||||||
StgStreamImpl* StgStreamImpl_Construct(
|
StgStreamImpl* StgStreamImpl_Construct(
|
||||||
StorageBaseImpl* parentStorage,
|
StorageBaseImpl* parentStorage,
|
||||||
DWORD grfMode,
|
DWORD grfMode,
|
||||||
ULONG dirEntry);
|
DirRef dirEntry);
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -431,7 +436,7 @@ struct BlockChainStream
|
||||||
{
|
{
|
||||||
StorageImpl* parentStorage;
|
StorageImpl* parentStorage;
|
||||||
ULONG* headOfStreamPlaceHolder;
|
ULONG* headOfStreamPlaceHolder;
|
||||||
ULONG ownerDirEntry;
|
DirRef ownerDirEntry;
|
||||||
ULONG lastBlockNoInSequence;
|
ULONG lastBlockNoInSequence;
|
||||||
ULONG lastBlockNoInSequenceIndex;
|
ULONG lastBlockNoInSequenceIndex;
|
||||||
ULONG tailIndex;
|
ULONG tailIndex;
|
||||||
|
@ -444,7 +449,7 @@ struct BlockChainStream
|
||||||
BlockChainStream* BlockChainStream_Construct(
|
BlockChainStream* BlockChainStream_Construct(
|
||||||
StorageImpl* parentStorage,
|
StorageImpl* parentStorage,
|
||||||
ULONG* headOfStreamPlaceHolder,
|
ULONG* headOfStreamPlaceHolder,
|
||||||
ULONG dirEntry);
|
DirRef dirEntry);
|
||||||
|
|
||||||
void BlockChainStream_Destroy(
|
void BlockChainStream_Destroy(
|
||||||
BlockChainStream* This);
|
BlockChainStream* This);
|
||||||
|
@ -476,7 +481,7 @@ BOOL BlockChainStream_SetSize(
|
||||||
struct SmallBlockChainStream
|
struct SmallBlockChainStream
|
||||||
{
|
{
|
||||||
StorageImpl* parentStorage;
|
StorageImpl* parentStorage;
|
||||||
ULONG ownerDirEntry;
|
DirRef ownerDirEntry;
|
||||||
ULONG* headOfStreamPlaceHolder;
|
ULONG* headOfStreamPlaceHolder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -486,7 +491,7 @@ struct SmallBlockChainStream
|
||||||
SmallBlockChainStream* SmallBlockChainStream_Construct(
|
SmallBlockChainStream* SmallBlockChainStream_Construct(
|
||||||
StorageImpl* parentStorage,
|
StorageImpl* parentStorage,
|
||||||
ULONG* headOfStreamPlaceHolder,
|
ULONG* headOfStreamPlaceHolder,
|
||||||
ULONG dirEntry);
|
DirRef dirEntry);
|
||||||
|
|
||||||
void SmallBlockChainStream_Destroy(
|
void SmallBlockChainStream_Destroy(
|
||||||
SmallBlockChainStream* This);
|
SmallBlockChainStream* This);
|
||||||
|
|
Loading…
Reference in New Issue