From 1239f11a93030e75f7a81a337d8740e03c597ec6 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 15 Oct 2009 15:34:33 -0500 Subject: [PATCH] ole32: Don't use IEnumSTATSTGImpl to search in OpenStorage. --- dlls/ole32/storage32.c | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index b78b7dc..f80e810 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -502,10 +502,10 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage( { StorageBaseImpl *This = (StorageBaseImpl *)iface; StorageInternalImpl* newStorage; - IEnumSTATSTGImpl* propertyEnumeration; - StgProperty currentProperty; ULONG foundPropertyIndex; HRESULT res = STG_E_UNKNOWN; + Dirent storageDirent; + DirentData storageData; TRACE("(%p, %s, %p, %x, %p, %d, %p)\n", iface, debugstr_w(pwcsName), pstgPriority, @@ -555,19 +555,16 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage( *ppstg = NULL; - propertyEnumeration = IEnumSTATSTGImpl_Construct( - This->ancestorStorage, - This->rootPropertySetIndex); + res = Dirent_FindElement(&This->dirent, pwcsName, &storageDirent); - foundPropertyIndex = IEnumSTATSTGImpl_FindProperty( - propertyEnumeration, - pwcsName, - ¤tProperty); + if (SUCCEEDED(res)) + { + foundPropertyIndex = Dirent_GetIndex(&storageDirent); - IEnumSTATSTGImpl_Destroy(propertyEnumeration); + res = Dirent_GetData(&storageDirent, &storageData); + } - if ( (foundPropertyIndex!=PROPERTY_NULL) && - (currentProperty.propertyType==PROPTYPE_STORAGE) ) + if (SUCCEEDED(res) && storageData.direntType == PROPTYPE_STORAGE) { newStorage = StorageInternalImpl_Construct( This->ancestorStorage, @@ -588,7 +585,8 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage( goto end; } - res = STG_E_FILENOTFOUND; + if (SUCCEEDED(res)) /* not a storage */ + res = STG_E_FILENOTFOUND; end: TRACE("<-- %08x\n", res); -- 1.5.4.3