Module: wine Branch: stable Commit: f2e755166f7ce4a7241bb008ae0db639e8f4aca7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f2e755166f7ce4a7241bb008ae...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Jan 12 11:49:29 2016 +0300
ole2disp: Implement SafeArrayDestroyDescriptor().
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 1529f082e6ee5e7a897b41e112b219480df6f82e) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/ole2disp.dll16/ole2disp.c | 25 +++++++++++++++++++++++++ dlls/ole2disp.dll16/ole2disp.dll16.spec | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/dlls/ole2disp.dll16/ole2disp.c b/dlls/ole2disp.dll16/ole2disp.c index 1774211..539b515 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 08372c5..997de31 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