From 61268ba853445ea7ac980f5d18a600ff7b40c323 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Wed, 25 Nov 2009 15:28:34 -0600 Subject: [PATCH 1/5] ole32: Make CreateDirEntry a virtual method. --- dlls/ole32/storage32.c | 28 ++++++++++++++++------------ dlls/ole32/storage32.h | 7 +++++++ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 384722d..1df4d9f 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -184,11 +184,6 @@ static HRESULT removeFromTree( * Declaration of the functions used to manipulate DirEntry */ -static HRESULT createDirEntry( - StorageImpl *storage, - const DirEntry *newData, - DirRef *index); - static HRESULT destroyDirEntry( StorageImpl *storage, DirRef index); @@ -926,8 +921,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream( /* * Create an entry with the new data */ - createDirEntry(This->ancestorStorage, &newStreamEntry, &newStreamEntryRef); - + StorageBaseImpl_CreateDirEntry(This, &newStreamEntry, &newStreamEntryRef); /* * Insert the new entry in the parent storage's tree. */ @@ -1117,7 +1111,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage( /* * Create a new directory entry for the storage */ - createDirEntry(This->ancestorStorage, &newEntry, &newEntryRef); + StorageBaseImpl_CreateDirEntry(This, &newEntry, &newEntryRef); /* * Insert the new directory entry into the parent storage's tree @@ -1148,11 +1142,12 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage( * * Reserve a directory entry in the file and initialize it. */ -static HRESULT createDirEntry( - StorageImpl *storage, +static HRESULT StorageImpl_CreateDirEntry( + StorageBaseImpl *base, const DirEntry *newData, DirRef *index) { + StorageImpl *storage = (StorageImpl*)base; ULONG currentEntryIndex = 0; ULONG newEntryIndex = DIRENTRY_NULL; HRESULT hr = S_OK; @@ -2221,7 +2216,8 @@ static const IStorageVtbl Storage32Impl_Vtbl = static const StorageBaseImplVtbl StorageImpl_BaseVtbl = { - StorageImpl_Destroy + StorageImpl_Destroy, + StorageImpl_CreateDirEntry }; static HRESULT StorageImpl_Construct( @@ -3639,6 +3635,13 @@ static void StorageInternalImpl_Destroy( StorageBaseImpl *iface) HeapFree(GetProcessHeap(), 0, This); } +static HRESULT StorageInternalImpl_CreateDirEntry(StorageBaseImpl *base, + const DirEntry *newData, DirRef *index) +{ + return StorageBaseImpl_CreateDirEntry(&base->ancestorStorage->base, + newData, index); +} + /****************************************************************************** ** ** Storage32InternalImpl_Commit @@ -4081,7 +4084,8 @@ static const IStorageVtbl Storage32InternalImpl_Vtbl = static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl = { - StorageInternalImpl_Destroy + StorageInternalImpl_Destroy, + StorageInternalImpl_CreateDirEntry }; /****************************************************************************** diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index c97a2b7..cfdc6df 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -248,6 +248,7 @@ struct StorageBaseImpl /* virtual methods for StorageBaseImpl objects */ struct StorageBaseImplVtbl { void (*Destroy)(StorageBaseImpl*); + HRESULT (*CreateDirEntry)(StorageBaseImpl*,const DirEntry*,DirRef*); }; static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This) @@ -255,6 +256,12 @@ static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This) This->baseVtbl->Destroy(This); } +static inline HRESULT StorageBaseImpl_CreateDirEntry(StorageBaseImpl *This, + const DirEntry *newData, DirRef *index) +{ + return This->baseVtbl->CreateDirEntry(This, newData, index); +} + /**************************************************************************** * StorageBaseImpl stream list handlers */ -- 1.6.3.3