mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 06:01:17 +00:00
ole2disp: Implement SafeArrayAccessData()/SafeArrayUnaccessData().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
668e975446
commit
cfbac8d2ed
|
@ -89,6 +89,15 @@ static ULONG safearray_getcellcount(const SAFEARRAY16 *sa)
|
|||
return cells;
|
||||
}
|
||||
|
||||
static HRESULT safearray_lock(SAFEARRAY16 *sa)
|
||||
{
|
||||
if (sa->cLocks == 0xffff)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
sa->cLocks++;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* SafeArrayGetDim [OLE2DISP.17]
|
||||
*/
|
||||
|
@ -117,11 +126,7 @@ HRESULT WINAPI SafeArrayLock16(SAFEARRAY16 *sa)
|
|||
if (!sa)
|
||||
return E_INVALIDARG16;
|
||||
|
||||
if (sa->cLocks == 0xffff)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
sa->cLocks++;
|
||||
return S_OK;
|
||||
return safearray_lock(sa);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -141,6 +146,34 @@ HRESULT WINAPI SafeArrayUnlock16(SAFEARRAY16 *sa)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* SafeArrayAccessData [OLE2DISP.23]
|
||||
*/
|
||||
HRESULT WINAPI SafeArrayAccessData16(SAFEARRAY16 *sa, SEGPTR *data)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p, %p)\n", sa, data);
|
||||
|
||||
/* arguments are not tested, it crashes if any of them is NULL */
|
||||
|
||||
hr = safearray_lock(sa);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
*data = sa->pvData;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* SafeArrayUnaccessData [OLE2DISP.24]
|
||||
*/
|
||||
HRESULT WINAPI SafeArrayUnaccessData16(SAFEARRAY16 *sa)
|
||||
{
|
||||
TRACE("(%p)\n", sa);
|
||||
return SafeArrayUnlock16(sa);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* SafeArrayAllocDescriptor [OLE2DISP.38]
|
||||
*/
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
20 stub SAFEARRAYGETLBOUND
|
||||
21 pascal SafeArrayLock(ptr) SafeArrayLock16
|
||||
22 pascal SafeArrayUnlock(ptr) SafeArrayUnlock16
|
||||
23 stub SAFEARRAYACCESSDATA
|
||||
24 stub SAFEARRAYUNACCESSDATA
|
||||
23 pascal SafeArrayAccessData(ptr ptr) SafeArrayAccessData16
|
||||
24 pascal SafeArrayUnaccessData(ptr) SafeArrayUnaccessData16
|
||||
25 stub SAFEARRAYGETELEMENT
|
||||
26 stub SAFEARRAYPUTELEMENT
|
||||
27 stub SAFEARRAYCOPY
|
||||
|
|
Loading…
Reference in a new issue