Vincent Povirk : ole32: Remove directory entries from the tree before we free them.

Alexandre Julliard julliard at winehq.org
Fri Oct 30 11:04:30 CDT 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Oct 28 14:06:23 2009 -0500

ole32: Remove directory entries from the tree before we free them.

The directory entry should still be valid as long as it's in the tree.

---

 dlls/ole32/storage32.c |   32 +++++++++-----------------------
 1 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 89ae657..18ced72 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -1817,6 +1817,15 @@ static HRESULT WINAPI StorageImpl_DestroyElement(
         parentPropertyId,
         typeOfRelation);
 
+  /*
+   * Invalidate the property by zeroing its name member.
+   */
+  propertyToDelete.sizeOfNameString = 0;
+
+  StorageImpl_WriteProperty(This->base.ancestorStorage,
+                            foundPropertyIndexToDelete,
+                            &propertyToDelete);
+
   return hr;
 }
 
@@ -1936,15 +1945,6 @@ static HRESULT deleteStorageProperty(
 
   } while ((hr == S_OK) && (destroyHr == S_OK));
 
-  /*
-   * Invalidate the property by zeroing its name member.
-   */
-  propertyToDelete.sizeOfNameString = 0;
-
-  StorageImpl_WriteProperty(parentStorage->base.ancestorStorage,
-                            indexOfPropertyToDelete,
-                            &propertyToDelete);
-
   IStorage_Release(childStorage);
   IEnumSTATSTG_Release(elements);
 
@@ -1993,20 +1993,6 @@ static HRESULT deleteStreamProperty(
    */
   IStream_Release(pis);
 
-  /*
-   * Invalidate the property by zeroing its name member.
-   */
-  propertyToDelete.sizeOfNameString = 0;
-
-  /*
-   * Here we should re-read the property so we get the updated pointer
-   * but since we are here to zap it, I don't do it...
-   */
-  StorageImpl_WriteProperty(
-    parentStorage->base.ancestorStorage,
-    indexOfPropertyToDelete,
-    &propertyToDelete);
-
   return S_OK;
 }
 




More information about the wine-cvs mailing list