Nikolay Sivov : ole2disp: Implement SafeArrayLock()/SafeArrayUnlock().
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jan 14 11:10:26 CST 2016
Module: wine
Branch: master
Commit: 2ef42bd946caa11c2248afbeb0dfc3e6d05929b0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2ef42bd946caa11c2248afbeb0dfc3e6d05929b0
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Jan 13 22:25:56 2016 +0300
ole2disp: Implement SafeArrayLock()/SafeArrayUnlock().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ole2disp.dll16/ole2disp.c | 34 +++++++++++++++++++++++++++++++++
dlls/ole2disp.dll16/ole2disp.dll16.spec | 4 ++--
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/dlls/ole2disp.dll16/ole2disp.c b/dlls/ole2disp.dll16/ole2disp.c
index 20b7b6c..af6f03c 100644
--- a/dlls/ole2disp.dll16/ole2disp.c
+++ b/dlls/ole2disp.dll16/ole2disp.c
@@ -108,6 +108,40 @@ USHORT WINAPI SafeArrayGetElemsize16(SAFEARRAY16 *sa)
}
/******************************************************************************
+ * SafeArrayLock [OLE2DISP.21]
+ */
+HRESULT WINAPI SafeArrayLock16(SAFEARRAY16 *sa)
+{
+ TRACE("(%p)\n", sa);
+
+ if (!sa)
+ return E_INVALIDARG16;
+
+ if (sa->cLocks == 0xffff)
+ return E_UNEXPECTED;
+
+ sa->cLocks++;
+ return S_OK;
+}
+
+/******************************************************************************
+ * SafeArrayUnlock [OLE2DISP.22]
+ */
+HRESULT WINAPI SafeArrayUnlock16(SAFEARRAY16 *sa)
+{
+ TRACE("(%p)\n", sa);
+
+ if (!sa)
+ return E_INVALIDARG16;
+
+ if (sa->cLocks == 0)
+ return E_UNEXPECTED;
+
+ sa->cLocks--;
+ return S_OK;
+}
+
+/******************************************************************************
* SafeArrayAllocDescriptor [OLE2DISP.38]
*/
HRESULT WINAPI SafeArrayAllocDescriptor16(UINT16 dims, SEGPTR *ret)
diff --git a/dlls/ole2disp.dll16/ole2disp.dll16.spec b/dlls/ole2disp.dll16/ole2disp.dll16.spec
index ca884a0..b0db920 100644
--- a/dlls/ole2disp.dll16/ole2disp.dll16.spec
+++ b/dlls/ole2disp.dll16/ole2disp.dll16.spec
@@ -18,8 +18,8 @@
18 pascal -ret16 SafeArrayGetElemsize(ptr) SafeArrayGetElemsize16
19 stub SAFEARRAYGETUBOUND
20 stub SAFEARRAYGETLBOUND
-21 stub SAFEARRAYLOCK
-22 stub SAFEARRAYUNLOCK
+21 pascal SafeArrayLock(ptr) SafeArrayLock16
+22 pascal SafeArrayUnlock(ptr) SafeArrayUnlock16
23 stub SAFEARRAYACCESSDATA
24 stub SAFEARRAYUNACCESSDATA
25 stub SAFEARRAYGETELEMENT
More information about the wine-cvs
mailing list