Vincent Povirk : ole32: Move the low-level functionality of ReadProperty to a new function.
Alexandre Julliard
julliard at winehq.org
Thu Oct 29 11:20:39 CDT 2009
Module: wine
Branch: master
Commit: 56622de95182863cf374eb850afaef6ce08ca39d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=56622de95182863cf374eb850afaef6ce08ca39d
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Wed Oct 28 11:37:30 2009 -0500
ole32: Move the low-level functionality of ReadProperty to a new function.
---
dlls/ole32/storage32.c | 38 +++++++++++++++++++++++++++-----------
dlls/ole32/storage32.h | 5 +++++
2 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 64039cc..4ff9f89 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -3046,6 +3046,32 @@ static void StorageImpl_SaveFileHeader(
}
/******************************************************************************
+ * 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
*
* This method will read the specified property from the property chain.
@@ -3056,19 +3082,9 @@ BOOL StorageImpl_ReadProperty(
StgProperty* buffer)
{
BYTE currentProperty[PROPSET_BLOCK_SIZE];
- ULARGE_INTEGER offsetInPropSet;
HRESULT readRes;
- ULONG bytesRead;
- offsetInPropSet.u.HighPart = 0;
- offsetInPropSet.u.LowPart = index * PROPSET_BLOCK_SIZE;
-
- readRes = BlockChainStream_ReadAt(
- This->rootBlockChain,
- offsetInPropSet,
- PROPSET_BLOCK_SIZE,
- currentProperty,
- &bytesRead);
+ readRes = StorageImpl_ReadRawDirEntry(This, index, currentProperty);
if (SUCCEEDED(readRes))
{
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index 8dd44fa..281948e 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -290,6 +290,11 @@ struct StorageImpl
BigBlockFile* bigBlockFile;
};
+HRESULT StorageImpl_ReadRawDirEntry(
+ StorageImpl *This,
+ ULONG index,
+ BYTE *buffer);
+
BOOL StorageImpl_ReadProperty(
StorageImpl* This,
ULONG index,
More information about the wine-cvs
mailing list