ole32: Simplify the FileMonikerImpl_BindToStorage code.

This commit is contained in:
Vincent Povirk 2014-06-30 13:40:02 -05:00 committed by Alexandre Julliard
parent 7447b37ff5
commit 69ff6f74b2
1 changed files with 3 additions and 14 deletions

View File

@ -605,22 +605,11 @@ FileMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLef
/* get the file name */ /* get the file name */
IMoniker_GetDisplayName(iface,pbc,pmkToLeft,&filePath); IMoniker_GetDisplayName(iface,pbc,pmkToLeft,&filePath);
/* verify if the file contains a storage object */ res=StgOpenStorage(filePath,NULL,STGM_READWRITE|STGM_SHARE_DENY_WRITE,NULL,0,&pstg);
res=StgIsStorageFile(filePath);
if(res==S_OK){ if (SUCCEEDED(res))
*ppvObject=pstg;
res=StgOpenStorage(filePath,NULL,STGM_READWRITE|STGM_SHARE_DENY_WRITE,NULL,0,&pstg);
if (SUCCEEDED(res)){
*ppvObject=pstg;
IStorage_AddRef(pstg);
return res;
}
}
CoTaskMemFree(filePath); CoTaskMemFree(filePath);
} }
else else