-
Notifications
You must be signed in to change notification settings - Fork 351
/
string.edl
90 lines (64 loc) · 3.76 KB
/
string.edl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
enclave {
trusted {
// string attribute must be used only with in or in-out attributes.
public void ecall_string_fun1([string, in] char* s);
public void ecall_string_fun2([string, in] const char* s);
public void ecall_string_fun3([string, in, out] char* s);
// Edger8r allows this even though const cannot be modified.
// public void ecall_string_fun4([string, in, out] const char* s);
// user_check attribute is supported.
public void ecall_string_fun5([user_check] char* s);
public void ecall_string_fun6([user_check] const char* s);
// Multiple string parameters
public void ecall_string_fun7([string, in] char* s1, [string, in] char* s2);
public void test_string_edl_ocalls();
// wstring attribute must be used only with in or in-out attributes.
public void ecall_wstring_fun1([wstring, in] wchar_t* s);
public void ecall_wstring_fun2([wstring, in] const wchar_t* s);
public void ecall_wstring_fun3([wstring, in, out] wchar_t* s);
// Edger8r allows this even though const cannot be modified.
// public void ecall_wstring_fun4([string, in, out] const wchar_t* s);
// user_check attribute is supported.
public void ecall_wstring_fun5([user_check] wchar_t* s);
public void ecall_wstring_fun6([user_check] const wchar_t* s);
// Multiple string parameters
public void ecall_wstring_fun7([wstring, in] wchar_t* s1, [wstring, in] wchar_t* s2);
public void test_wstring_edl_ocalls();
// Negative tests for non null-terminated strings
public void ecall_string_no_null_terminator(
[string, in] char* s1, [string, in, out] char* s2);
public void ecall_wstring_no_null_terminator(
[wstring, in] wchar_t* s1, [wstring, in, out] wchar_t* s2);
};
untrusted {
// string attribute must be used only with in or in-out attributes.
void ocall_string_fun1([string, in] char* s);
void ocall_string_fun2([string, in] const char* s);
void ocall_string_fun3([string, in, out] char* s);
// Edger8r allows this even though const cannot be modified.
// public void ocall_string_fun4([string, in, out] const char* s);
// user_check for ocalls does not add much value since
// the pointer cannot be de-referenced on the host side.
void ocall_string_fun5([user_check] char* s);
void ocall_string_fun6([user_check] const char* s);
// Multiple string parameters
void ocall_string_fun7([string, in] char* s1, [string, in] char* s2);
// wstring attribute must be used only with in or in-out attributes.
void ocall_wstring_fun1([wstring, in] wchar_t* s);
void ocall_wstring_fun2([wstring, in] const wchar_t* s);
void ocall_wstring_fun3([wstring, in, out] wchar_t* s);
// Edger8r allows this even though const cannot be modified.
// public void ocall_string_fun4([string, in, out] const char* s);
// user_check for ocalls does not add much value since
// the pointer cannot be de-referenced on the host side.
void ocall_wstring_fun5([user_check] wchar_t* s);
void ocall_wstring_fun6([user_check] const wchar_t* s);
// Multiple string parameters
void ocall_wstring_fun7([wstring, in] wchar_t* s1, [wstring, in] wchar_t* s2);
// Scenario where host does not null terminate in-out strings.
void ocall_string_no_null_terminator(bool erasenull, [string, in, out] char* s);
void ocall_wstring_no_null_terminator(bool erasenull, [wstring, in, out] wchar_t* s);
};
};