Vincent Povirk : ole32: Add WriteDirEntry to the storage vtable.

Alexandre Julliard julliard at winehq.org
Mon Dec 7 10:26:11 CST 2009


Module: wine
Branch: master
Commit: 176cdfc75eb019f36ec8a198a495ffb3725a2467
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=176cdfc75eb019f36ec8a198a495ffb3725a2467

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Nov 25 16:53:05 2009 -0600

ole32: Add WriteDirEntry to the storage vtable.

---

 dlls/ole32/stg_stream.c |    2 +-
 dlls/ole32/storage32.c  |   28 ++++++++++++++++++++++------
 dlls/ole32/storage32.h  |    7 +++++++
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c
index 94cd2ed..a36b497 100644
--- a/dlls/ole32/stg_stream.c
+++ b/dlls/ole32/stg_stream.c
@@ -659,7 +659,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
 
   if (SUCCEEDED(hr))
   {
-    StorageImpl_WriteDirEntry(This->parentStorage->ancestorStorage,
+    StorageBaseImpl_WriteDirEntry(This->parentStorage,
 				This->dirEntry,
 				&currentEntry);
   }
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 68de806..ee0b605 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -775,7 +775,7 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
     /* Change the name of the element */
     strcpyW(currentEntry.name, pwcsNewName);
 
-    StorageImpl_WriteDirEntry(This->ancestorStorage, currentEntryRef,
+    StorageBaseImpl_WriteDirEntry(This, currentEntryRef,
         &currentEntry);
 
     /* Insert the element in a new position in the tree */
@@ -971,9 +971,9 @@ static HRESULT WINAPI StorageBaseImpl_SetClass(
   {
     currentEntry.clsid = *clsid;
 
-    hRes = StorageImpl_WriteDirEntry(This->ancestorStorage,
-                                     This->storageDirEntry,
-                                     &currentEntry);
+    hRes = StorageBaseImpl_WriteDirEntry(This,
+                                         This->storageDirEntry,
+                                         &currentEntry);
   }
 
   return hRes;
@@ -2182,6 +2182,13 @@ static HRESULT WINAPI StorageBaseImpl_SetStateBits(
   return S_OK;
 }
 
+static HRESULT StorageImpl_BaseWriteDirEntry(StorageBaseImpl *base,
+  DirRef index, const DirEntry *data)
+{
+  StorageImpl *This = (StorageImpl*)base;
+  return StorageImpl_WriteDirEntry(This, index, data);
+}
+
 /*
  * Virtual function table for the IStorage32Impl class.
  */
@@ -2210,7 +2217,8 @@ static const IStorageVtbl Storage32Impl_Vtbl =
 static const StorageBaseImplVtbl StorageImpl_BaseVtbl =
 {
   StorageImpl_Destroy,
-  StorageImpl_CreateDirEntry
+  StorageImpl_CreateDirEntry,
+  StorageImpl_BaseWriteDirEntry
 };
 
 static HRESULT StorageImpl_Construct(
@@ -3634,6 +3642,13 @@ static HRESULT StorageInternalImpl_CreateDirEntry(StorageBaseImpl *base,
     newData, index);
 }
 
+static HRESULT StorageInternalImpl_WriteDirEntry(StorageBaseImpl *base,
+  DirRef index, const DirEntry *data)
+{
+  return StorageBaseImpl_WriteDirEntry(&base->ancestorStorage->base,
+    index, data);
+}
+
 /******************************************************************************
 **
 ** Storage32InternalImpl_Commit
@@ -4077,7 +4092,8 @@ static const IStorageVtbl Storage32InternalImpl_Vtbl =
 static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl =
 {
   StorageInternalImpl_Destroy,
-  StorageInternalImpl_CreateDirEntry
+  StorageInternalImpl_CreateDirEntry,
+  StorageInternalImpl_WriteDirEntry
 };
 
 /******************************************************************************
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index 5d6f651..6c2cb14 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -249,6 +249,7 @@ struct StorageBaseImpl
 struct StorageBaseImplVtbl {
   void (*Destroy)(StorageBaseImpl*);
   HRESULT (*CreateDirEntry)(StorageBaseImpl*,const DirEntry*,DirRef*);
+  HRESULT (*WriteDirEntry)(StorageBaseImpl*,DirRef,const DirEntry*);
 };
 
 static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This)
@@ -262,6 +263,12 @@ static inline HRESULT StorageBaseImpl_CreateDirEntry(StorageBaseImpl *This,
   return This->baseVtbl->CreateDirEntry(This, newData, index);
 }
 
+static inline HRESULT StorageBaseImpl_WriteDirEntry(StorageBaseImpl *This,
+  DirRef index, const DirEntry *data)
+{
+  return This->baseVtbl->WriteDirEntry(This, index, data);
+}
+
 /****************************************************************************
  * StorageBaseImpl stream list handlers
  */




More information about the wine-cvs mailing list