I'm trying to use the new windows 1709 feature that allows to load a DLL into enclave memory.
I didn't find ANY documentation or example of doing it. As far as I understand these are the steps to achieve it:
Check that VBS (only VBS supports enclave image) enclave type is supported using
IsEnclaveTypeSupported
.Use
CreateEnclave
function to create enclave.Use
LoadEnclaveImage
function to load the image into the enclave memory.
Here is code snippet that I tried to use:
HANDLE h = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessPid());
BOOL vbsSupport = IsEnclaveTypeSupported(ENCLAVE_TYPE_VBS); //returns TRUE
ENCLAVE_CREATE_INFO_VBS vci = { 0 };
vci.Flags = 1;
LPVOID lpAddress = CreateEnclave(h, NULL, 0x10000, NULL, ENCLAVE_TYPE_VBS, &vci, sizeof(ENCLAVE_CREATE_INFO_VBS), NULL);
The call the CreateEnclave
return NULL
and set the last error code to 0x32 (The request is not supported).
Any ideas how to make it work ?