#ifndef _NTLDR_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
#if (PHNT_VERSION >= PHNT_THRESHOLD)
// rev from CreateEnclave
/**
* Creates a new uninitialized enclave. An enclave is an isolated region of code and data within the address space for an application. Only code that runs within the enclave can access data within the same enclave.
*
* @param ProcessHandle A handle to the process for which you want to create an enclave.
* @param BaseAddress The preferred base address of the enclave. Specify NULL to have the operating system assign the base address.
* @param Reserved Reserved.
* @param Size The size of the enclave that you want to create, including the size of the code that you will load into the enclave, in bytes.
* @param InitialCommitment The amount of memory to commit for the enclave, in bytes. This parameter is not used for virtualization-based security (VBS) enclaves.
* @param EnclaveType The architecture type of the enclave that you want to create. To verify that an enclave type is supported, call IsEnclaveTypeSupported.
* @param EnclaveInformation A pointer to the architecture-specific information to use to create the enclave.
* @param EnclaveInformationLength The length of the structure that the EnclaveInformation parameter points to, in bytes.
* For the ENCLAVE_TYPE_SGX and ENCLAVE_TYPE_SGX2 enclave types, this value must be 4096. For the ENCLAVE_TYPE_VBS enclave type, this value must be sizeof(ENCLAVE_CREATE_INFO_VBS), which is 36 bytes.
* @param EnclaveError An optional pointer to a variable that receives an enclave error code that is architecture-specific.
* @return NTSTATUS Successful or errant status.
* @remarks https://learn.microsoft.com/en-us/windows/win32/api/enclaveapi/nf-enclaveapi-createenclave
*/
NTSYSAPI
NTSTATUS
NTAPI
LdrCreateEnclave(
_In_ HANDLE ProcessHandle,
_Inout_ PVOID* BaseAddress,
_In_ ULONG Reserved,
_In_ SIZE_T Size,
_In_ SIZE_T InitialCommitment,
_In_ ULONG EnclaveType,
_In_reads_bytes_(EnclaveInformationLength) PVOID EnclaveInformation,
_In_ ULONG EnclaveInformationLength,
_Out_ PULONG EnclaveError
);
View code on GitHub
No description available.