VariantCopyInd  (OLEAUT32.11)


 HRESULT VariantCopyInd
  VARIANT*          pvargDest,
  const VARIANTARG* pvargSrc


Copy a variant, dereferencing it if it is by-reference.


pvargDest [Out] Destination for copy.
pvargSrc [In] Source variant to copy.


Success: S_OK. pvargDest contains a copy of pvargSrc.

Failure: An HRESULT error code indicating the error.


Failure: DISP_E_BADVARTYPE, if either variant has an invalid by-value type. E_INVALIDARG, if pvargSrc is an invalid by-reference type. E_OUTOFMEMORY, if memory cannot be allocated. Otherwise an HRESULT error code from SafeArrayCopy, IRecordInfo_GetSize, or IRecordInfo_RecordCopy, depending on the type of pvargSrc.


- If pvargSrc is by-value, this function behaves exactly as VariantCopy.

- If pvargSrc is by-reference, the value copied to pvargDest is the pointed-to value.

- if pvargSrc == pvargDest, this function dereferences in place. Otherwise, pvargDest is always cleared using VariantClear before pvargSrc is copied to it. If clearing pvargDest fails, so does this function.


Declared in "oleauto.h".

Implemented in "dlls/oleaut32/variant.c".

Debug channel "variant".

Copyright © 2021 The Wine Project. All trademarks are the property of their respective owners. Visit WineHQ for license details. Generated Jun 2021.