Expand Minimize

SafeArrayUnlock function

Decrements the lock count of an array so it can be freed or resized.

Syntax


HRESULT SafeArrayUnlock(
  _In_  SAFEARRAY *psa
);

Parameters

psa [in]

An array descriptor created by SafeArrayCreate.

Return value

This function can return one of these values.

Return codeDescription
S_OK

Success.

E_INVALIDARG

The argument psa is not valid.

E_UNEXPECTED

The array could not be unlocked.

 

Remarks

This function is called after access to the data in an array is finished.

Thread Safety

All public static members of the SAFEARRAY data type are thread safe. Instance members are not guaranteed to be thread safe.

For example, consider an application that uses the SafeArrayLock and SafeArrayUnlock functions. If these functions are called concurrently from different threads on the same SAFEARRAY data type instance, an inconsistent lock count may be created. This will eventually cause the SafeArrayUnlock function to return E_UNEXPECTED. You can prevent this by providing your own synchronization code.

Requirements

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft