EnclaveCopyOutOfEnclave function (winenclaveapi.h)

Copies data from the enclave to an untrusted address (outside of the enclave).

Syntax

HRESULT EnclaveCopyOutOfEnclave(
  VOID       *UnsecureAddress,
  const VOID *EnclaveAddress,
  SIZE_T     NumberOfBytes
);

Parameters

UnsecureAddress

An address outside of the enclave to which to copy data.

EnclaveAddress

An address within the enclave from which to copy data.

NumberOfBytes

The number of bytes to copy.

Return value

An HRESULT value that indicates success or failure. The function returns S_OK if the copy operation was successful. Otherwise, it returns an HRESULT error code.

Remarks

Note that the EnclaveCopyOutOfEnclave and EnclaveCopyIntoEnclave APIs will still continue to work (and access the address space of the containing process) even when access is restricted using EnclaveRestrictContainingProcessAccess.

Requirements

Requirement Value
Minimum supported client Windows 11 24H2 [desktop apps only]
Minimum supported server Windows Server 2025 [desktop apps only]
Header winenclaveapi.h
Library Vertdll.lib
DLL Vertdll.dll

See also

EnclaveCopyIntoEnclave

EnclaveRestrictContainingProcessAccess