Mike McCormack : ole32: Return STG_E_REVERTED when a stream' s parent storage has been closed.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 5 14:08:06 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 3c1e67d084aff5c040f504ae3a583246dd21248a
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3c1e67d084aff5c040f504ae3a583246dd21248a

Author: Mike McCormack <mike at codeweavers.com>
Date:   Sun Apr 30 14:13:22 2006 +0900

ole32: Return STG_E_REVERTED when a stream's parent storage has been closed.

---

 dlls/ole32/stg_stream.c |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c
index fd75ee2..e208fb6 100644
--- a/dlls/ole32/stg_stream.c
+++ b/dlls/ole32/stg_stream.c
@@ -267,6 +267,9 @@ static HRESULT WINAPI StgStreamImpl_Read
   TRACE("(%p, %p, %ld, %p)\n",
 	iface, pv, cb, pcbRead);
 
+  if (!This->parentStorage)
+    return STG_E_REVERTED;
+ 
   /*
    * If the caller is not interested in the number of bytes read,
    * we use another buffer to avoid "if" statements in the code.
@@ -375,6 +378,9 @@ static HRESULT WINAPI StgStreamImpl_Writ
   if (!pv)
     return STG_E_INVALIDPOINTER;
 
+  if (!This->parentStorage)
+    return STG_E_REVERTED;
+ 
   /*
    * If the caller is not interested in the number of bytes written,
    * we use another buffer to avoid "if" statements in the code.
@@ -463,9 +469,8 @@ static HRESULT WINAPI StgStreamImpl_Seek
    * fail if the stream has no parent (as does windows)
    */
 
-  if(!(This->parentStorage)) {
+  if (!This->parentStorage)
     return STG_E_REVERTED;
-  }
 
   /*
    * The caller is allowed to pass in NULL as the new position return value.
@@ -527,9 +532,8 @@ static HRESULT WINAPI StgStreamImpl_SetS
 
   TRACE("(%p, %ld)\n", iface, libNewSize.u.LowPart);
 
-  if(!This->parentStorage) {
+  if(!This->parentStorage)
     return STG_E_REVERTED;
-  }
 
   /*
    * As documented.
@@ -648,9 +652,8 @@ static HRESULT WINAPI StgStreamImpl_Copy
    * Sanity check
    */
 
-  if(!This->parentStorage) {
+  if (!This->parentStorage)
     return STG_E_REVERTED;
-  }
 
   if ( pstm == 0 )
     return STG_E_INVALIDPOINTER;
@@ -724,9 +727,9 @@ static HRESULT WINAPI StgStreamImpl_Comm
 {
   StgStreamImpl* const This=(StgStreamImpl*)iface;
 
-  if(!This->parentStorage) {
+  if (!This->parentStorage)
     return STG_E_REVERTED;
-  }
+
   return S_OK;
 }
 
@@ -752,9 +755,8 @@ static HRESULT WINAPI StgStreamImpl_Lock
 {
   StgStreamImpl* const This=(StgStreamImpl*)iface;
 
-  if(!This->parentStorage) {
+  if (!This->parentStorage)
     return STG_E_REVERTED;
-  }
 
   FIXME("not implemented!\n");
   return E_NOTIMPL;
@@ -768,9 +770,8 @@ static HRESULT WINAPI StgStreamImpl_Unlo
 {
   StgStreamImpl* const This=(StgStreamImpl*)iface;
 
-  if(!This->parentStorage) {
+  if (!This->parentStorage)
     return STG_E_REVERTED;
-  }
 
   FIXME("not implemented!\n");
   return E_NOTIMPL;
@@ -798,9 +799,8 @@ static HRESULT WINAPI StgStreamImpl_Stat
    * if stream has no parent, return STG_E_REVERTED
    */
 
-  if(!This->parentStorage) {
-	return STG_E_REVERTED;
-  }
+  if (!This->parentStorage)
+    return STG_E_REVERTED;
 
   /*
    * Read the information from the property.
@@ -848,9 +848,8 @@ static HRESULT WINAPI StgStreamImpl_Clon
    * Sanity check
    */
 
-  if(!This->parentStorage) {
+  if (!This->parentStorage)
     return STG_E_REVERTED;
-  }
 
   if ( ppstm == 0 )
     return STG_E_INVALIDPOINTER;




More information about the wine-cvs mailing list