[3/5] ole32: Accept only STG_E_INVALIDFUNCTION or success from LockRegionSync.

Vincent Povirk madewokherd at gmail.com
Tue Mar 10 16:32:53 CDT 2015


-------------- next part --------------
From d02dd3d19dca2cc0ee89cceada5fbf193c22071f Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Tue, 10 Mar 2015 14:41:10 -0500
Subject: [PATCH 3/5] ole32: Accept only STG_E_INVALIDFUNCTION or success from
 LockRegionSync.

We need LockRegionSync to be able to time out and fail, and that needs to be
treated as failure.
---
 dlls/ole32/storage32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 0a9b1ad..d3fb023 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -2959,7 +2959,8 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
     hr = StorageImpl_LockRegionSync(This, offset, cb, LOCK_ONLYONCE);
 
     /* If the ILockBytes doesn't support locking that's ok. */
-    if (FAILED(hr)) return S_OK;
+    if (hr == STG_E_INVALIDFUNCTION) return S_OK;
+    else if (FAILED(hr)) return hr;
 
     hr = S_OK;
 
-- 
2.1.0



More information about the wine-patches mailing list