From 9b6c4c79385c1e2900dcb5a3bcda9472692a31cb Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 15 Oct 2009 15:15:24 -0500 Subject: [PATCH] ole32: Don't use IEnumSTATSTGImpl to search in CreateStream. --- dlls/ole32/storage32.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 66cf807..6d525fe 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -857,10 +857,11 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream( IStream** ppstm) /* [out] */ { StorageBaseImpl *This = (StorageBaseImpl *)iface; - IEnumSTATSTGImpl* propertyEnumeration; StgStreamImpl* newStream; - StgProperty currentProperty, newStreamProperty; + StgProperty newStreamProperty; ULONG foundPropertyIndex, newPropertyIndex; + HRESULT hr; + Dirent streamDirent; TRACE("(%p, %s, %x, %d, %d, %p)\n", iface, debugstr_w(pwcsName), grfMode, @@ -906,17 +907,12 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream( *ppstm = 0; - propertyEnumeration = IEnumSTATSTGImpl_Construct(This->ancestorStorage, - This->rootPropertySetIndex); - - foundPropertyIndex = IEnumSTATSTGImpl_FindProperty(propertyEnumeration, - pwcsName, - ¤tProperty); + hr = Dirent_FindElement(&This->dirent, pwcsName, &streamDirent); - IEnumSTATSTGImpl_Destroy(propertyEnumeration); - - if (foundPropertyIndex != PROPERTY_NULL) + if (SUCCEEDED(hr)) { + foundPropertyIndex = Dirent_GetIndex(&streamDirent); + /* * An element with this name already exists */ -- 1.5.4.3