Gijs Vermeulen : ole2disp.dll16: Implement SafeArrayGet[UBound|LBound].
Alexandre Julliard
julliard at winehq.org
Mon May 14 06:54:26 CDT 2018
Module: wine
Branch: stable
Commit: 61d406fd22fe74e5f83c16b9766b13348378d974
URL: https://source.winehq.org/git/wine.git/?a=commit;h=61d406fd22fe74e5f83c16b9766b13348378d974
Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date: Wed Jan 17 22:34:28 2018 +0100
ole2disp.dll16: Implement SafeArrayGet[UBound|LBound].
Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit a9686b0037126008cd5935eb45a100095d022415)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/ole2disp.dll16/ole2disp.c | 36 +++++++++++++++++++++++++++++++++
dlls/ole2disp.dll16/ole2disp.dll16.spec | 4 ++--
2 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/ole2disp.dll16/ole2disp.c b/dlls/ole2disp.dll16/ole2disp.c
index d61b5e8..98aca3d 100644
--- a/dlls/ole2disp.dll16/ole2disp.c
+++ b/dlls/ole2disp.dll16/ole2disp.c
@@ -117,6 +117,42 @@ USHORT WINAPI SafeArrayGetElemsize16(SAFEARRAY16 *sa)
}
/******************************************************************************
+ * SafeArrayGetUBound [OLE2DISP.19]
+ */
+HRESULT WINAPI SafeArrayGetUBound16(SAFEARRAY16 *sa, UINT16 dim, LONG *ubound)
+{
+ TRACE("(%p, %u, %p)\n", sa, dim, ubound);
+
+ if (!sa)
+ return E_INVALIDARG16;
+
+ if (!dim || dim > sa->cDims)
+ return DISP_E_BADINDEX;
+
+ *ubound = sa->rgsabound[sa->cDims - dim].lLbound + sa->rgsabound[sa->cDims - dim].cElements - 1;
+
+ return S_OK;
+}
+
+/******************************************************************************
+ * SafeArrayGetLBound [OLE2DISP.20]
+ */
+HRESULT WINAPI SafeArrayGetLBound16(SAFEARRAY16 *sa, UINT16 dim, LONG *lbound)
+{
+ TRACE("(%p, %u, %p)\n", sa, dim, lbound);
+
+ if (!sa)
+ return E_INVALIDARG16;
+
+ if (!dim || dim > sa->cDims)
+ return DISP_E_BADINDEX;
+
+ *lbound = sa->rgsabound[sa->cDims - dim].lLbound;
+
+ return S_OK;
+}
+
+/******************************************************************************
* SafeArrayLock [OLE2DISP.21]
*/
HRESULT WINAPI SafeArrayLock16(SAFEARRAY16 *sa)
diff --git a/dlls/ole2disp.dll16/ole2disp.dll16.spec b/dlls/ole2disp.dll16/ole2disp.dll16.spec
index 4b8af41..7b00ac3 100644
--- a/dlls/ole2disp.dll16/ole2disp.dll16.spec
+++ b/dlls/ole2disp.dll16/ole2disp.dll16.spec
@@ -16,8 +16,8 @@
16 stub SAFEARRAYDESTROY
17 pascal -ret16 SafeArrayGetDim(ptr) SafeArrayGetDim16
18 pascal -ret16 SafeArrayGetElemsize(ptr) SafeArrayGetElemsize16
-19 stub SAFEARRAYGETUBOUND
-20 stub SAFEARRAYGETLBOUND
+19 pascal SafeArrayGetUBound(ptr word ptr) SafeArrayGetUBound16
+20 pascal SafeArrayGetLBound(ptr word ptr) SafeArrayGetLBound16
21 pascal SafeArrayLock(ptr) SafeArrayLock16
22 pascal SafeArrayUnlock(ptr) SafeArrayUnlock16
23 pascal SafeArrayAccessData(ptr ptr) SafeArrayAccessData16
More information about the wine-cvs
mailing list