Nikolay Sivov : ole32: Return END_OF_CHAIN for chains starting with special sector values.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 29 15:42:43 CST 2014


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Dec 29 17:44:47 2014 +0300

ole32: Return END_OF_CHAIN for chains starting with special sector values.

---

 dlls/ole32/storage32.c | 9 ++-------
 dlls/ole32/storage32.h | 1 +
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 6ebc1e7..26fc0d8 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -6995,10 +6995,8 @@ static ULONG BlockChainStream_GetHeadOfChain(BlockChainStream* This)
                       This->ownerDirEntry,
                       &chainEntry);
 
-    if (SUCCEEDED(hr))
-    {
+    if (SUCCEEDED(hr) && chainEntry.startingBlock < BLOCK_FIRST_SPECIAL)
       return chainEntry.startingBlock;
-    }
   }
 
   return BLOCK_END_OF_CHAIN;
@@ -7520,11 +7518,8 @@ static ULONG SmallBlockChainStream_GetHeadOfChain(
                       This->ownerDirEntry,
                       &chainEntry);
 
-    if (SUCCEEDED(hr))
-    {
+    if (SUCCEEDED(hr) && chainEntry.startingBlock < BLOCK_FIRST_SPECIAL)
       return chainEntry.startingBlock;
-    }
-
   }
 
   return BLOCK_END_OF_CHAIN;
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index 36cbc9d..9831a27 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -78,6 +78,7 @@ static const WORD  MAX_BIG_BLOCK_SIZE_BITS   = 0x000c;
 static const WORD  DEF_SMALL_BLOCK_SIZE_BITS = 0x0006;
 static const WORD  DEF_BIG_BLOCK_SIZE        = 0x0200;
 static const WORD  DEF_SMALL_BLOCK_SIZE      = 0x0040;
+static const ULONG BLOCK_FIRST_SPECIAL       = 0xFFFFFFFB;
 static const ULONG BLOCK_EXTBBDEPOT          = 0xFFFFFFFC;
 static const ULONG BLOCK_SPECIAL             = 0xFFFFFFFD;
 static const ULONG BLOCK_END_OF_CHAIN        = 0xFFFFFFFE;




More information about the wine-cvs mailing list