From 073889a08f3f81c659475e54ef448402d0498cee Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Wed, 25 Nov 2009 17:01:27 -0600 Subject: [PATCH 5/5] ole32: Add ReadDirEntry to the storage vtable. --- dlls/ole32/stg_stream.c | 8 ++++---- dlls/ole32/storage32.c | 30 +++++++++++++++++++++++------- dlls/ole32/storage32.h | 7 +++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c index a36b497..6200126 100644 --- a/dlls/ole32/stg_stream.c +++ b/dlls/ole32/stg_stream.c @@ -208,7 +208,7 @@ static void StgStreamImpl_OpenBlockChain( /* * Read the information from the directory entry. */ - hr = StorageImpl_ReadDirEntry(This->parentStorage->ancestorStorage, + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, This->dirEntry, ¤tEntry); @@ -605,7 +605,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize( /* * Read this stream's size to see if it's small blocks or big blocks */ - StorageImpl_ReadDirEntry(This->parentStorage->ancestorStorage, + StorageBaseImpl_ReadDirEntry(This->parentStorage, This->dirEntry, ¤tEntry); /* @@ -650,7 +650,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize( /* * Write the new information about this stream to the directory entry */ - hr = StorageImpl_ReadDirEntry(This->parentStorage->ancestorStorage, + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, This->dirEntry, ¤tEntry); @@ -852,7 +852,7 @@ static HRESULT WINAPI StgStreamImpl_Stat( /* * Read the information from the directory entry. */ - hr = StorageImpl_ReadDirEntry(This->parentStorage->ancestorStorage, + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, This->dirEntry, ¤tEntry); diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index ee0b605..f54bfdf 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -690,8 +690,8 @@ static HRESULT WINAPI StorageBaseImpl_Stat( goto end; } - res = StorageImpl_ReadDirEntry( - This->ancestorStorage, + res = StorageBaseImpl_ReadDirEntry( + This, This->storageDirEntry, ¤tEntry); @@ -964,9 +964,9 @@ static HRESULT WINAPI StorageBaseImpl_SetClass( if (!This->ancestorStorage) return STG_E_REVERTED; - hRes = StorageImpl_ReadDirEntry(This->ancestorStorage, - This->storageDirEntry, - ¤tEntry); + hRes = StorageBaseImpl_ReadDirEntry(This, + This->storageDirEntry, + ¤tEntry); if (SUCCEEDED(hRes)) { currentEntry.clsid = *clsid; @@ -2189,6 +2189,13 @@ static HRESULT StorageImpl_BaseWriteDirEntry(StorageBaseImpl *base, return StorageImpl_WriteDirEntry(This, index, data); } +static HRESULT StorageImpl_BaseReadDirEntry(StorageBaseImpl *base, + DirRef index, DirEntry *data) +{ + StorageImpl *This = (StorageImpl*)base; + return StorageImpl_ReadDirEntry(This, index, data); +} + /* * Virtual function table for the IStorage32Impl class. */ @@ -2218,7 +2225,8 @@ static const StorageBaseImplVtbl StorageImpl_BaseVtbl = { StorageImpl_Destroy, StorageImpl_CreateDirEntry, - StorageImpl_BaseWriteDirEntry + StorageImpl_BaseWriteDirEntry, + StorageImpl_BaseReadDirEntry, }; static HRESULT StorageImpl_Construct( @@ -3649,6 +3657,13 @@ static HRESULT StorageInternalImpl_WriteDirEntry(StorageBaseImpl *base, index, data); } +static HRESULT StorageInternalImpl_ReadDirEntry(StorageBaseImpl *base, + DirRef index, DirEntry *data) +{ + return StorageBaseImpl_ReadDirEntry(&base->ancestorStorage->base, + index, data); +} + /****************************************************************************** ** ** Storage32InternalImpl_Commit @@ -4093,7 +4108,8 @@ static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl = { StorageInternalImpl_Destroy, StorageInternalImpl_CreateDirEntry, - StorageInternalImpl_WriteDirEntry + StorageInternalImpl_WriteDirEntry, + StorageInternalImpl_ReadDirEntry }; /****************************************************************************** diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 6c2cb14..a087e0d 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -250,6 +250,7 @@ struct StorageBaseImplVtbl { void (*Destroy)(StorageBaseImpl*); HRESULT (*CreateDirEntry)(StorageBaseImpl*,const DirEntry*,DirRef*); HRESULT (*WriteDirEntry)(StorageBaseImpl*,DirRef,const DirEntry*); + HRESULT (*ReadDirEntry)(StorageBaseImpl*,DirRef,DirEntry*); }; static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This) @@ -269,6 +270,12 @@ static inline HRESULT StorageBaseImpl_WriteDirEntry(StorageBaseImpl *This, return This->baseVtbl->WriteDirEntry(This, index, data); } +static inline HRESULT StorageBaseImpl_ReadDirEntry(StorageBaseImpl *This, + DirRef index, DirEntry *data) +{ + return This->baseVtbl->ReadDirEntry(This, index, data); +} + /**************************************************************************** * StorageBaseImpl stream list handlers */ -- 1.6.3.3