Vincent Povirk : ole32: Simplify the FileMonikerImpl_BindToStorage code.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jul 1 14:14:46 CDT 2014
Module: wine
Branch: master
Commit: 69ff6f74b25866d55a8c13053836796243902c43
URL: http://source.winehq.org/git/wine.git/?a=commit;h=69ff6f74b25866d55a8c13053836796243902c43
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Mon Jun 30 13:40:02 2014 -0500
ole32: Simplify the FileMonikerImpl_BindToStorage code.
---
dlls/ole32/filemoniker.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c
index 06c4798..c7bbb66 100644
--- a/dlls/ole32/filemoniker.c
+++ b/dlls/ole32/filemoniker.c
@@ -605,22 +605,11 @@ FileMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLef
/* get the file name */
IMoniker_GetDisplayName(iface,pbc,pmkToLeft,&filePath);
- /* verify if the file contains a storage object */
- res=StgIsStorageFile(filePath);
+ res=StgOpenStorage(filePath,NULL,STGM_READWRITE|STGM_SHARE_DENY_WRITE,NULL,0,&pstg);
- 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);
}
else
More information about the wine-cvs
mailing list