1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use shared::basetsd::{PSIZE_T, SIZE_T};
7 use shared::minwindef::{BOOL, DWORD, LPCVOID, LPDWORD, LPVOID};
8 use shared::ntdef::{HANDLE};
9 use um::minwinbase::LPENCLAVE_ROUTINE;
10 use um::winnt::{LPCSTR, LPCWSTR};
11 extern "system" {
IsEnclaveTypeSupported( flEnclaveType: DWORD, ) -> BOOL12     pub fn IsEnclaveTypeSupported(
13         flEnclaveType: DWORD,
14     ) -> BOOL;
CreateEnclave( hProcess: HANDLE, lpAddress: LPVOID, dwSize: SIZE_T, dwInitialCommitment: SIZE_T, flEnclaveType: DWORD, lpEnclaveInformation: LPCVOID, dwInfoLength: DWORD, lpEnclaveError: LPDWORD, ) -> LPVOID15     pub fn CreateEnclave(
16         hProcess: HANDLE,
17         lpAddress: LPVOID,
18         dwSize: SIZE_T,
19         dwInitialCommitment: SIZE_T,
20         flEnclaveType: DWORD,
21         lpEnclaveInformation: LPCVOID,
22         dwInfoLength: DWORD,
23         lpEnclaveError: LPDWORD,
24     ) -> LPVOID;
LoadEnclaveData( hProcess: HANDLE, lpAddress: LPVOID, lpBuffer: LPCVOID, nSize: SIZE_T, flProtect: DWORD, lpPageInformation: LPCVOID, dwInfoLength: DWORD, lpNumberOfBytesWritten: PSIZE_T, lpEnclaveError: LPDWORD, ) -> BOOL25     pub fn LoadEnclaveData(
26         hProcess: HANDLE,
27         lpAddress: LPVOID,
28         lpBuffer: LPCVOID,
29         nSize: SIZE_T,
30         flProtect: DWORD,
31         lpPageInformation: LPCVOID,
32         dwInfoLength: DWORD,
33         lpNumberOfBytesWritten: PSIZE_T,
34         lpEnclaveError: LPDWORD,
35     ) -> BOOL;
InitializeEnclave( hProcess: HANDLE, lpAddress: LPVOID, lpEnclaveInformation: LPCVOID, dwInfoLength: DWORD, lpEnclaveError: LPDWORD, ) -> BOOL36     pub fn InitializeEnclave(
37         hProcess: HANDLE,
38         lpAddress: LPVOID,
39         lpEnclaveInformation: LPCVOID,
40         dwInfoLength: DWORD,
41         lpEnclaveError: LPDWORD,
42     ) -> BOOL;
LoadEnclaveImageA( lpEnclaveAddress: LPVOID, lpImageName: LPCSTR, ) -> BOOL43     pub fn LoadEnclaveImageA(
44         lpEnclaveAddress: LPVOID,
45         lpImageName: LPCSTR,
46     ) -> BOOL;
LoadEnclaveImageW( lpEnclaveAddress: LPVOID, lpImageName: LPCWSTR, ) -> BOOL47     pub fn LoadEnclaveImageW(
48         lpEnclaveAddress: LPVOID,
49         lpImageName: LPCWSTR,
50     ) -> BOOL;
CallEnclave( lpRoutine: LPENCLAVE_ROUTINE, lpParameter: LPVOID, fWaitForThread: BOOL, lpReturnValue: *mut LPVOID, ) -> BOOL51     pub fn CallEnclave(
52         lpRoutine: LPENCLAVE_ROUTINE,
53         lpParameter: LPVOID,
54         fWaitForThread: BOOL,
55         lpReturnValue: *mut LPVOID,
56     ) -> BOOL;
TerminateEnclave( lpAddress: LPVOID, fWait: BOOL, ) -> BOOL57     pub fn TerminateEnclave(
58         lpAddress: LPVOID,
59         fWait: BOOL,
60     ) -> BOOL;
DeleteEnclave( lpAddress: LPVOID, ) -> BOOL61     pub fn DeleteEnclave(
62         lpAddress: LPVOID,
63     ) -> BOOL;
64 }
65