Skip to content

Commit 96c5d15

Browse files
committed
Fixed calling conventions for unitytls callbacks
(for calls native -> managed)
1 parent 7a9ba85 commit 96c5d15

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mcs/class/System/Mono.UnityTls/UnityTls.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public enum unitytls_x509verify_result : UInt32
112112
UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR = 0x08000000,
113113
}
114114

115+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
115116
public delegate unitytls_x509verify_result unitytls_x509verify_callback(void* userData, unitytls_x509_ref cert, unitytls_x509verify_result result, unitytls_errorstate* errorState);
116117

117118
// ------------------------------------
@@ -144,10 +145,15 @@ public struct unitytls_tlsctx_protocolrange
144145
public unitytls_protocol max;
145146
};
146147

148+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
147149
public delegate size_t unitytls_tlsctx_write_callback(void* userData, UInt8* data, size_t bufferLen, unitytls_errorstate* errorState);
150+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
148151
public delegate size_t unitytls_tlsctx_read_callback(void* userData, UInt8* buffer, size_t bufferLen, unitytls_errorstate* errorState);
152+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
149153
public delegate void unitytls_tlsctx_trace_callback(void* userData, unitytls_tlsctx* ctx, Int8* traceMessage, size_t traceMessageLen);
154+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
150155
public delegate void unitytls_tlsctx_certificate_callback(void* userData, unitytls_tlsctx* ctx, Int8* cn, size_t cnLen, unitytls_x509name* caList, size_t caListLen, unitytls_x509list_ref* chain, unitytls_key_ref* key, unitytls_errorstate* errorState);
156+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
151157
public delegate unitytls_x509verify_result unitytls_tlsctx_x509verify_callback(void* userData, unitytls_x509list_ref chain, unitytls_errorstate* errorState);
152158

153159
[StructLayout (LayoutKind.Sequential)]

0 commit comments

Comments
 (0)