diff --git a/dlls/ole2disp.dll16/ole2disp.c b/dlls/ole2disp.dll16/ole2disp.c index d61b5e8c5a1..98aca3dbee7 100644 --- a/dlls/ole2disp.dll16/ole2disp.c +++ b/dlls/ole2disp.dll16/ole2disp.c @@ -116,6 +116,42 @@ USHORT WINAPI SafeArrayGetElemsize16(SAFEARRAY16 *sa) return sa->cbElements; } +/****************************************************************************** + * 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] */ diff --git a/dlls/ole2disp.dll16/ole2disp.dll16.spec b/dlls/ole2disp.dll16/ole2disp.dll16.spec index 4b8af41172a..7b00ac353bb 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