CallEnclave function (enclaveapi.h)

Calls a function within an enclave. CallEnclave can also be called within an enclave to call a function outside of the enclave.

Syntax

BOOL CallEnclave(
  [in]  LPENCLAVE_ROUTINE lpRoutine,
  [in]  LPVOID            lpParameter,
  [in]  BOOL              fWaitForThread,
  [out] LPVOID            *lpReturnValue
);

Parameters

[in] lpRoutine

The address of the function that you want to call.

[in] lpParameter

The parameter than you want to pass to the function.

[in] fWaitForThread

TRUE if the call to the specified function should block execution until an idle enclave thread becomes available when no idle enclave thread is available. FALSE if the call to the specified function should fail when no idle enclave thread is available.

This parameter is ignored when you use CallEnclave within an enclave to call a function that is not in any enclave.

[out] lpReturnValue

The return value of the function, if it is called successfully.

Return value

TRUE if the specified function was called successfully; otherwise FALSE. To get extended error information, call GetLastError.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1709 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header enclaveapi.h
Library Vertdll.lib
DLL Vertdll.dll; Api-ms-win-core-enclave-l1-1-0.dll

See also

Enclave functions

TerminateEnclave

Vertdll APIs available in VBS enclaves