ole32: Ignore high part of size in storage version 3 files.

Vincent Povirk madewokherd at gmail.com
Wed Aug 5 16:41:09 CDT 2015


For bug 38967.
-------------- next part --------------
From 3a34afaa5c5eb6105c855a799670b56c6b8b8f2c Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Wed, 5 Aug 2015 16:33:07 -0500
Subject: [PATCH] ole32: Ignore high part of size in storage version 3 files.

---
 dlls/ole32/storage32.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index ce72b73..c881620 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -3446,10 +3446,18 @@ static HRESULT StorageImpl_ReadDirEntry(
       OFFSET_PS_SIZE,
       &buffer->size.u.LowPart);
 
-    StorageUtl_ReadDWord(
-      currentEntry,
-      OFFSET_PS_SIZE_HIGH,
-      &buffer->size.u.HighPart);
+    if (This->bigBlockSize < 4096)
+    {
+      /* Version 3 files may have junk in the high part of size. */
+      buffer->size.u.HighPart = 0;
+    }
+    else
+    {
+      StorageUtl_ReadDWord(
+        currentEntry,
+        OFFSET_PS_SIZE_HIGH,
+        &buffer->size.u.HighPart);
+    }
   }
 
   return readRes;
-- 
2.1.4



More information about the wine-patches mailing list