Community
cancel
Showing results for 
Search instead for 
Did you mean: 
OvalPiston
Beginner
80 Views

How to call sgx_is_capable on a new VM/PC

Two problems:

I am running VS 2017 as an Administrator.

1. Without installing the SDK, how can I call the function sgx_is_capable? Do I just copy the sgx_capable.dll file into our own folder and call the function? Is this code one of the ways to call it?

HINSTANCE hinstLib = LoadLibrary(L"C:\\Program Files (x86)\\OurApp\\sgx_capable.dll");
typedef LONG(WINAPI *SGX_CAPABLE)(int *);
SGX_CAPABLE sgxcapable;
sgxcapable = (SGX_CAPABLE)GetProcAddress(hinstLib, "sgx_is_capable");
INT bSGX;
sgxcapable(&bSGX);

 

2. Even when I call this function with the Intel SGX SDK installed, this error pops up (though the bSGX does get set to 0, which matches the system capabilities):

Exception thrown at 0x0FA31CF7 (sgx_capable.dll) in CryptoMSDN.exe: 0xC0000005: Access violation writing location 0x00CCE8E1.

 

 

0 Kudos
1 Reply
OvalPiston
Beginner
80 Views

Added include and changed typedef to this and it seems to work now:

#include "C:\\Program Files (x86)\\Intel\\IntelSGXSDK\\include\\sgx_capable.h"
typedef	sgx_status_t (SGXAPI *SGX_CAPABLE)(int *);

 

Reply