ole32: Rename rootPropertySetIndex to storageDirEntry.

Not only is it not related to property set storages, it's also not the root
of the tree that's used to search for elements.
This commit is contained in:
Vincent Povirk 2009-11-12 13:19:37 -06:00 committed by Alexandre Julliard
parent cf1242e03b
commit 4ba13cb9a7
2 changed files with 27 additions and 28 deletions

View File

@ -443,7 +443,7 @@ static HRESULT WINAPI StorageBaseImpl_OpenStream(
*/ */
foundPropertyIndex = findElement( foundPropertyIndex = findElement(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsName, pwcsName,
&currentProperty); &currentProperty);
@ -551,7 +551,7 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage(
foundPropertyIndex = findElement( foundPropertyIndex = findElement(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsName, pwcsName,
&currentProperty); &currentProperty);
@ -610,7 +610,7 @@ static HRESULT WINAPI StorageBaseImpl_EnumElements(
newEnum = IEnumSTATSTGImpl_Construct( newEnum = IEnumSTATSTGImpl_Construct(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex); This->storageDirEntry);
if (newEnum!=0) if (newEnum!=0)
{ {
@ -652,7 +652,7 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
readSuccessful = StorageImpl_ReadDirEntry( readSuccessful = StorageImpl_ReadDirEntry(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
&curProperty); &curProperty);
if (readSuccessful) if (readSuccessful)
@ -700,7 +700,7 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
iface, debugstr_w(pwcsOldName), debugstr_w(pwcsNewName)); iface, debugstr_w(pwcsOldName), debugstr_w(pwcsNewName));
foundPropertyIndex = findElement(This->ancestorStorage, foundPropertyIndex = findElement(This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsNewName, pwcsNewName,
&currentProperty); &currentProperty);
@ -716,14 +716,14 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
* Search for the old element name * Search for the old element name
*/ */
foundPropertyIndex = findElement(This->ancestorStorage, foundPropertyIndex = findElement(This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsOldName, pwcsOldName,
&currentProperty); &currentProperty);
if (foundPropertyIndex != DIRENTRY_NULL) if (foundPropertyIndex != DIRENTRY_NULL)
{ {
/* Remove the element from its current position in the tree */ /* Remove the element from its current position in the tree */
removeFromTree(This->ancestorStorage, This->rootPropertySetIndex, removeFromTree(This->ancestorStorage, This->storageDirEntry,
foundPropertyIndex); foundPropertyIndex);
/* Change the name of the element */ /* Change the name of the element */
@ -733,7 +733,7 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
&currentProperty); &currentProperty);
/* Insert the element in a new position in the tree */ /* Insert the element in a new position in the tree */
insertIntoTree(This->ancestorStorage, This->rootPropertySetIndex, insertIntoTree(This->ancestorStorage, This->storageDirEntry,
foundPropertyIndex); foundPropertyIndex);
} }
else else
@ -812,7 +812,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
*ppstm = 0; *ppstm = 0;
foundPropertyIndex = findElement(This->ancestorStorage, foundPropertyIndex = findElement(This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsName, pwcsName,
&currentProperty); &currentProperty);
@ -884,7 +884,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
*/ */
insertIntoTree( insertIntoTree(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
newPropertyIndex); newPropertyIndex);
/* /*
@ -926,14 +926,14 @@ static HRESULT WINAPI StorageBaseImpl_SetClass(
TRACE("(%p, %p)\n", iface, clsid); TRACE("(%p, %p)\n", iface, clsid);
success = StorageImpl_ReadDirEntry(This->ancestorStorage, success = StorageImpl_ReadDirEntry(This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
&curProperty); &curProperty);
if (success) if (success)
{ {
curProperty.clsid = *clsid; curProperty.clsid = *clsid;
success = StorageImpl_WriteDirEntry(This->ancestorStorage, success = StorageImpl_WriteDirEntry(This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
&curProperty); &curProperty);
if (success) if (success)
hRes = S_OK; hRes = S_OK;
@ -998,7 +998,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
} }
foundPropertyIndex = findElement(This->ancestorStorage, foundPropertyIndex = findElement(This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsName, pwcsName,
&currentProperty); &currentProperty);
@ -1067,7 +1067,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
*/ */
insertIntoTree( insertIntoTree(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
newPropertyIndex); newPropertyIndex);
/* /*
@ -1735,7 +1735,7 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
foundPropertyIndexToDelete = findElement( foundPropertyIndexToDelete = findElement(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
pwcsName, pwcsName,
&propertyToDelete); &propertyToDelete);
@ -1767,7 +1767,7 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
*/ */
hr = removeFromTree( hr = removeFromTree(
This->ancestorStorage, This->ancestorStorage,
This->rootPropertySetIndex, This->storageDirEntry,
foundPropertyIndexToDelete); foundPropertyIndexToDelete);
/* /*
@ -2297,13 +2297,13 @@ static HRESULT StorageImpl_Construct(
if ( (currentProperty.sizeOfNameString != 0 ) && if ( (currentProperty.sizeOfNameString != 0 ) &&
(currentProperty.stgType == STGTY_ROOT) ) (currentProperty.stgType == STGTY_ROOT) )
{ {
This->base.rootPropertySetIndex = currentPropertyIndex; This->base.storageDirEntry = currentPropertyIndex;
} }
} }
currentPropertyIndex++; currentPropertyIndex++;
} while (readSuccessful && (This->base.rootPropertySetIndex == DIRENTRY_NULL) ); } while (readSuccessful && (This->base.storageDirEntry == DIRENTRY_NULL) );
if (!readSuccessful) if (!readSuccessful)
{ {
@ -2315,7 +2315,7 @@ static HRESULT StorageImpl_Construct(
* Create the block chain abstraction for the small block root chain. * Create the block chain abstraction for the small block root chain.
*/ */
if(!(This->smallBlockRootChain = if(!(This->smallBlockRootChain =
BlockChainStream_Construct(This, NULL, This->base.rootPropertySetIndex))) BlockChainStream_Construct(This, NULL, This->base.storageDirEntry)))
return STG_E_READFAULT; return STG_E_READFAULT;
return hr; return hr;
@ -3130,7 +3130,7 @@ BOOL StorageImpl_ReadDirEntry(
if (SUCCEEDED(readRes)) if (SUCCEEDED(readRes))
{ {
/* replace the name of root entry (often "Root Entry") by the file name */ /* replace the name of root entry (often "Root Entry") by the file name */
WCHAR *propName = (index == This->base.rootPropertySetIndex) ? WCHAR *propName = (index == This->base.storageDirEntry) ?
This->filename : (WCHAR *)currentProperty+OFFSET_PS_NAME; This->filename : (WCHAR *)currentProperty+OFFSET_PS_NAME;
memset(buffer->name, 0, sizeof(buffer->name)); memset(buffer->name, 0, sizeof(buffer->name));
@ -3964,7 +3964,7 @@ static StorageInternalImpl* StorageInternalImpl_Construct(
/* /*
* Keep the index of the root property set for this storage, * Keep the index of the root property set for this storage,
*/ */
newStorage->base.rootPropertySetIndex = rootPropertyIndex; newStorage->base.storageDirEntry = rootPropertyIndex;
return newStorage; return newStorage;
} }
@ -4900,7 +4900,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock(
StorageImpl_ReadDirEntry( StorageImpl_ReadDirEntry(
This->parentStorage, This->parentStorage,
This->parentStorage->base.rootPropertySetIndex, This->parentStorage->base.storageDirEntry,
&rootProp); &rootProp);
rootProp.startingBlock = sbStartIndex; rootProp.startingBlock = sbStartIndex;
@ -4909,7 +4909,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock(
StorageImpl_WriteDirEntry( StorageImpl_WriteDirEntry(
This->parentStorage, This->parentStorage,
This->parentStorage->base.rootPropertySetIndex, This->parentStorage->base.storageDirEntry,
&rootProp); &rootProp);
} }
else else
@ -4930,7 +4930,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock(
StorageImpl_ReadDirEntry( StorageImpl_ReadDirEntry(
This->parentStorage, This->parentStorage,
This->parentStorage->base.rootPropertySetIndex, This->parentStorage->base.storageDirEntry,
&rootProp); &rootProp);
if (rootProp.size.u.LowPart < if (rootProp.size.u.LowPart <
@ -4944,7 +4944,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock(
StorageImpl_WriteDirEntry( StorageImpl_WriteDirEntry(
This->parentStorage, This->parentStorage,
This->parentStorage->base.rootPropertySetIndex, This->parentStorage->base.storageDirEntry,
&rootProp); &rootProp);
} }
} }

View File

@ -207,10 +207,9 @@ struct StorageBaseImpl
StorageImpl* ancestorStorage; StorageImpl* ancestorStorage;
/* /*
* Index of the property for the root of * Index of the directory entry of this storage
* this storage
*/ */
ULONG rootPropertySetIndex; ULONG storageDirEntry;
/* /*
* virtual Destructor method. * virtual Destructor method.