| 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" { |
| 12 |
pub fn IsEnclaveTypeSupported( |
| 13 |
flEnclaveType: DWORD, |
| 14 |
) -> BOOL; |
| 15 |
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; |
| 25 |
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; |
| 36 |
pub fn InitializeEnclave( |
| 37 |
hProcess: HANDLE, |
| 38 |
lpAddress: LPVOID, |
| 39 |
lpEnclaveInformation: LPCVOID, |
| 40 |
dwInfoLength: DWORD, |
| 41 |
lpEnclaveError: LPDWORD, |
| 42 |
) -> BOOL; |
| 43 |
pub fn LoadEnclaveImageA( |
| 44 |
lpEnclaveAddress: LPVOID, |
| 45 |
lpImageName: LPCSTR, |
| 46 |
) -> BOOL; |
| 47 |
pub fn LoadEnclaveImageW( |
| 48 |
lpEnclaveAddress: LPVOID, |
| 49 |
lpImageName: LPCWSTR, |
| 50 |
) -> BOOL; |
| 51 |
pub fn CallEnclave( |
| 52 |
lpRoutine: LPENCLAVE_ROUTINE, |
| 53 |
lpParameter: LPVOID, |
| 54 |
fWaitForThread: BOOL, |
| 55 |
lpReturnValue: *mut LPVOID, |
| 56 |
) -> BOOL; |
| 57 |
pub fn TerminateEnclave( |
| 58 |
lpAddress: LPVOID, |
| 59 |
fWait: BOOL, |
| 60 |
) -> BOOL; |
| 61 |
pub fn DeleteEnclave( |
| 62 |
lpAddress: LPVOID, |
| 63 |
) -> BOOL; |
| 64 |
} |