---
name: "VariantCopyInd"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/VariantCopyInd"
---

# VariantCopyInd(3w)

## NAME

**VariantCopyInd** (OLEAUT32.11)

## SYNOPSIS

HRESULT VariantCopyInd\
  (\
   VARIANT\*    *pvargDest*,\
   VARIANTARG\* *pvargSrc*\
  )

## DESCRIPTION

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

## PARAMS

*pvargDest* **\[Out\]**  Destination for copy.

*pvargSrc* **\[In\]**  Source variant to copy.

## RETURNS

**Success:** **S\_OK**. *pvargDest* contains a copy of *pvargSrc*.

**Failure:** An **HRESULT** error code indicating the error.

## NOTES

**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(3w)](/SafeArrayCopy/3w.md)**, **IRecordInfo\_GetSize(3w)**, or **IRecordInfo\_RecordCopy(3w)**, depending on the type of *pvargSrc*.

## NOTES

**-** If *pvargSrc* is by-value, this function behaves exactly as **[VariantCopy(3w)](/VariantCopy/3w.md)**.

**-** 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(3w)](/VariantClear/3w.md)** before *pvargSrc* is copied to it. If clearing *pvargDest* fails, so does this function.

## IMPLEMENTATION

Declared in **"oleauto.h"**.

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

Debug channel **"variant"**.
