ole32: Move the low-level functionality of ReadProperty to a new function.
This commit is contained in:
parent
5d550cdc45
commit
56622de951
|
@ -3045,6 +3045,32 @@ static void StorageImpl_SaveFileHeader(
|
||||||
StorageImpl_WriteBigBlock(This, -1, headerBigBlock);
|
StorageImpl_WriteBigBlock(This, -1, headerBigBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* StorageImpl_ReadRawDirEntry
|
||||||
|
*
|
||||||
|
* This method will read the raw data from a directory entry in the file.
|
||||||
|
*
|
||||||
|
* buffer must be PROPSET_BLOCK_SIZE bytes long.
|
||||||
|
*/
|
||||||
|
HRESULT StorageImpl_ReadRawDirEntry(StorageImpl *This, ULONG index, BYTE *buffer)
|
||||||
|
{
|
||||||
|
ULARGE_INTEGER offset;
|
||||||
|
HRESULT hr;
|
||||||
|
ULONG bytesRead;
|
||||||
|
|
||||||
|
offset.u.HighPart = 0;
|
||||||
|
offset.u.LowPart = index * PROPSET_BLOCK_SIZE;
|
||||||
|
|
||||||
|
hr = BlockChainStream_ReadAt(
|
||||||
|
This->rootBlockChain,
|
||||||
|
offset,
|
||||||
|
PROPSET_BLOCK_SIZE,
|
||||||
|
buffer,
|
||||||
|
&bytesRead);
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Storage32Impl_ReadProperty
|
* Storage32Impl_ReadProperty
|
||||||
*
|
*
|
||||||
|
@ -3056,19 +3082,9 @@ BOOL StorageImpl_ReadProperty(
|
||||||
StgProperty* buffer)
|
StgProperty* buffer)
|
||||||
{
|
{
|
||||||
BYTE currentProperty[PROPSET_BLOCK_SIZE];
|
BYTE currentProperty[PROPSET_BLOCK_SIZE];
|
||||||
ULARGE_INTEGER offsetInPropSet;
|
|
||||||
HRESULT readRes;
|
HRESULT readRes;
|
||||||
ULONG bytesRead;
|
|
||||||
|
|
||||||
offsetInPropSet.u.HighPart = 0;
|
readRes = StorageImpl_ReadRawDirEntry(This, index, currentProperty);
|
||||||
offsetInPropSet.u.LowPart = index * PROPSET_BLOCK_SIZE;
|
|
||||||
|
|
||||||
readRes = BlockChainStream_ReadAt(
|
|
||||||
This->rootBlockChain,
|
|
||||||
offsetInPropSet,
|
|
||||||
PROPSET_BLOCK_SIZE,
|
|
||||||
currentProperty,
|
|
||||||
&bytesRead);
|
|
||||||
|
|
||||||
if (SUCCEEDED(readRes))
|
if (SUCCEEDED(readRes))
|
||||||
{
|
{
|
||||||
|
|
|
@ -290,6 +290,11 @@ struct StorageImpl
|
||||||
BigBlockFile* bigBlockFile;
|
BigBlockFile* bigBlockFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HRESULT StorageImpl_ReadRawDirEntry(
|
||||||
|
StorageImpl *This,
|
||||||
|
ULONG index,
|
||||||
|
BYTE *buffer);
|
||||||
|
|
||||||
BOOL StorageImpl_ReadProperty(
|
BOOL StorageImpl_ReadProperty(
|
||||||
StorageImpl* This,
|
StorageImpl* This,
|
||||||
ULONG index,
|
ULONG index,
|
||||||
|
|
Loading…
Reference in New Issue