diff --git a/dlls/ole2disp.dll16/ole2disp.c b/dlls/ole2disp.dll16/ole2disp.c index 1774211c12c..539b515fc85 100644 --- a/dlls/ole2disp.dll16/ole2disp.c +++ b/dlls/ole2disp.dll16/ole2disp.c @@ -67,6 +67,11 @@ static SEGPTR safearray_alloc(ULONG size) return WOWGlobalAllocLock16(GPTR, size, &h); } +static void safearray_free(SEGPTR ptr) +{ + WOWGlobalUnlockFree16(ptr); +} + /****************************************************************************** * SafeArrayAllocDescriptor [OLE2DISP.38] */ @@ -90,6 +95,26 @@ HRESULT WINAPI SafeArrayAllocDescriptor16(UINT16 dims, SEGPTR *ret) return S_OK; } +/****************************************************************************** + * SafeArrayDestroyDescriptor [OLE2DISP.40] + */ +HRESULT WINAPI SafeArrayDestroyDescriptor16(SEGPTR s) +{ + TRACE("0x%08x\n", s); + + if (s) + { + SAFEARRAY16 *sa = MapSL(s); + + if (sa->cLocks) + return DISP_E_ARRAYISLOCKED; + + safearray_free(s); + } + + return S_OK; +} + /* This implementation of the BSTR API is 16-bit only. It represents BSTR as a 16:16 far pointer, and the strings as ISO-8859 */ diff --git a/dlls/ole2disp.dll16/ole2disp.dll16.spec b/dlls/ole2disp.dll16/ole2disp.dll16.spec index 08372c5cba8..997de3171bd 100644 --- a/dlls/ole2disp.dll16/ole2disp.dll16.spec +++ b/dlls/ole2disp.dll16/ole2disp.dll16.spec @@ -37,7 +37,7 @@ 37 stub GETACTIVEOBJECT 38 pascal SafeArrayAllocDescriptor(word ptr) SafeArrayAllocDescriptor16 39 stub SAFEARRAYALLOCDATA -40 stub SAFEARRAYDESTROYDESCRIPTOR +40 pascal SafeArrayDestroyDescriptor(segptr) SafeArrayDestroyDescriptor16 41 stub SAFEARRAYDESTROYDATA 42 stub SAFEARRAYREDIM 43 stub VARI2FROMI4