Vincent Povirk : ole32: Change WriteDirEntry return type to HRESULT.

Alexandre Julliard julliard at winehq.org
Mon Dec 7 10:26:11 CST 2009


Module: wine
Branch: master
Commit: df13a1d1fea128207ed25788a37e45929754a6fa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=df13a1d1fea128207ed25788a37e45929754a6fa

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Nov 25 15:51:48 2009 -0600

ole32: Change WriteDirEntry return type to HRESULT.

---

 dlls/ole32/storage32.c |   30 ++++++++++++++----------------
 dlls/ole32/storage32.h |    2 +-
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 1df4d9f..8173b84 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -978,11 +978,9 @@ static HRESULT WINAPI StorageBaseImpl_SetClass(
   {
     currentEntry.clsid = *clsid;
 
-    success =  StorageImpl_WriteDirEntry(This->ancestorStorage,
-                                           This->storageDirEntry,
-                                           &currentEntry);
-    if (success)
-      hRes = S_OK;
+    hRes = StorageImpl_WriteDirEntry(This->ancestorStorage,
+                                     This->storageDirEntry,
+                                     &currentEntry);
   }
 
   return hRes;
@@ -2091,13 +2089,13 @@ static HRESULT removeFromTree(
      */
     setEntryLink(&parentEntry, typeOfRelation, entryToDelete.leftChild);
 
-    res = StorageImpl_WriteDirEntry(
+    hr = StorageImpl_WriteDirEntry(
             This,
             parentEntryRef,
             &parentEntry);
-    if(!res)
+    if(FAILED(hr))
     {
-      return E_FAIL;
+      return hr;
     }
 
     if (entryToDelete.rightChild != DIRENTRY_NULL)
@@ -2127,13 +2125,13 @@ static HRESULT removeFromTree(
 
       newRightChildParentEntry.rightChild = entryToDelete.rightChild;
 
-      res = StorageImpl_WriteDirEntry(
+      hr = StorageImpl_WriteDirEntry(
               This,
               newRightChildParent,
               &newRightChildParentEntry);
-      if (!res)
+      if (FAILED(hr))
       {
-        return E_FAIL;
+        return hr;
       }
     }
   }
@@ -2144,13 +2142,13 @@ static HRESULT removeFromTree(
      */
     setEntryLink(&parentEntry, typeOfRelation, entryToDelete.rightChild);
 
-    res = StorageImpl_WriteDirEntry(
+    hr = StorageImpl_WriteDirEntry(
             This,
             parentEntryRef,
             &parentEntry);
-    if(!res)
+    if(FAILED(hr))
     {
-      return E_FAIL;
+      return hr;
     }
   }
 
@@ -3334,7 +3332,7 @@ BOOL StorageImpl_ReadDirEntry(
 /*********************************************************************
  * Write the specified directory entry to the file
  */
-BOOL StorageImpl_WriteDirEntry(
+HRESULT StorageImpl_WriteDirEntry(
   StorageImpl*          This,
   DirRef                index,
   const DirEntry*       buffer)
@@ -3345,7 +3343,7 @@ BOOL StorageImpl_WriteDirEntry(
   UpdateRawDirEntry(currentEntry, buffer);
 
   writeRes = StorageImpl_WriteRawDirEntry(This, index, currentEntry);
-  return SUCCEEDED(writeRes) ? TRUE : FALSE;
+  return writeRes;
 }
 
 static BOOL StorageImpl_ReadBigBlock(
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index cfdc6df..45fffac 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -336,7 +336,7 @@ BOOL StorageImpl_ReadDirEntry(
             DirRef          index,
             DirEntry*       buffer);
 
-BOOL StorageImpl_WriteDirEntry(
+HRESULT StorageImpl_WriteDirEntry(
             StorageImpl*        This,
             DirRef              index,
             const DirEntry*     buffer);




More information about the wine-cvs mailing list