加载飞地时出错:无法使用CreateFile()打开文件 [英] Error Loading Enclave: Couldn't open file with CreateFile()
问题描述
我正在尝试编写一个简单的SGX项目作为开始.因此,我有了这个主要的主机应用程序例程,该例程已从拉里希特的博客:
I'm trying to write a simple SGX project for a start. So I have this main host application routine that I've pretty much copied from Lars Richter's blog:
#define ENCLAVE_FILE _T("Enclave.signed.dll")
#include <tchar.h>
#include <cstdio>
#include "sgx_urts.h"
#include "Enclave_u.h"
int main()
{
sgx_enclave_id_t eid;
sgx_status_t ret = SGX_SUCCESS;
sgx_launch_token_t token = { 0 };
int updated = 0;
ret = sgx_create_enclave(ENCLAVE_FILE, SGX_DEBUG_FLAG, &token, &updated, &eid, NULL);
if (ret != SGX_SUCCESS) {
printf("\nApp: error %#x, failed to create enclave.\n", ret);
}
scanf("\n");
return 0;
}
它可以正常编译(我在Visual Studio 2015中使用了Intel C ++ 17.0编译器),但是它不会加载该区域.我收到以下错误消息:
It compiles fine (I'm using the Intel C++ 17.0 compiler with Visual Studio 2015) but it doesn't load the enclave. I get the following error message:
[sgx_create_enclavew ..\urts\win\urts.cpp:195] Couldn't open file with CreateFile()
App: error 0x200f, failed to create enclave.
推荐答案
转到 app_test_save 项目设置.在调试下,将工作目录更改为 $(SolutionDir)Debug .该答案假定两个项目 app_test_save 和 enclave_test_save 属于同一解决方案.
Go to app_test_save project setting. Under Debugging, change working directory to $(SolutionDir)Debug. This answer assumes that both projects app_test_save and enclave_test_save belong to the same solution.
这篇关于加载飞地时出错:无法使用CreateFile()打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!