update readme (#21797)
[mono-project.git] / mono / metadata / icall-decl.h
blob6ca080535bb6483f998328f078232e6f6f0f27f3
1 /**
2 * \file
3 * Copyright 2018 Microsoft
4 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
5 */
6 #ifndef __MONO_METADATA_ICALL_DECL_H__
7 #define __MONO_METADATA_ICALL_DECL_H__
9 #include "appdomain-icalls.h"
10 #include "class.h"
11 #include "console-io.h"
12 #include "environment.h"
13 #include "file-mmap.h"
14 #include "filewatcher.h"
15 #include "gc-internals.h"
16 #include "handle-decl.h"
17 #include "handle.h"
18 #include "locales.h"
19 #include "marshal.h"
20 #include "monitor.h"
21 #include "mono-perfcounters.h"
22 #include "object-forward.h"
23 #include "object-internals.h"
24 #include "rand.h"
25 #include "reflection.h"
26 #include "security-core-clr.h"
27 #include "security-manager.h"
28 #include "security.h"
29 #include "string-icalls.h"
30 #include "threadpool-io.h"
31 #include "threadpool.h"
32 #include "mono/utils/mono-digest.h"
33 #include "mono/utils/mono-forward-internal.h"
34 #include "w32event.h"
35 #include "w32file.h"
36 #include "w32mutex.h"
37 #include "w32process.h"
38 #include "w32semaphore.h"
39 #include "w32socket.h"
40 #include "mono/utils/mono-proclib.h"
42 /* From MonoProperty.cs */
43 typedef enum {
44 PInfo_Attributes = 1,
45 PInfo_GetMethod = 1 << 1,
46 PInfo_SetMethod = 1 << 2,
47 PInfo_ReflectedType = 1 << 3,
48 PInfo_DeclaringType = 1 << 4,
49 PInfo_Name = 1 << 5
50 } PInfo;
52 #include "icall-table.h"
54 #define NOHANDLES(inner) inner
55 #define HANDLES_REUSE_WRAPPER(...) /* nothing */
57 // Generate prototypes for coop icall wrappers and coop icalls.
58 #define MONO_HANDLE_REGISTER_ICALL(func, ret, nargs, argtypes) \
59 MONO_HANDLE_DECLARE (,,func ## _impl, ret, nargs, argtypes); \
60 MONO_HANDLE_REGISTER_ICALL_DECLARE_RAW (func, ret, nargs, argtypes);
61 #define ICALL_TYPE(id, name, first) /* nothing */
62 #define ICALL(id, name, func) /* nothing */
63 #define HANDLES(id, name, func, ret, nargs, argtypes) \
64 MONO_HANDLE_DECLARE_RAW (id, name, func, ret, nargs, argtypes); \
65 MONO_HANDLE_DECLARE (id, name, func, ret, nargs, argtypes);
66 #include "icall-def.h"
67 #undef ICALL_TYPE
68 #undef ICALL
69 #undef HANDLES
70 #undef HANDLES_REUSE_WRAPPER
71 #undef NOHANDLES
72 #undef MONO_HANDLE_REGISTER_ICALL
74 // This is sorted.
75 // grep ICALL_EXPORT | sort | uniq
76 ICALL_EXPORT MonoAssemblyName* ves_icall_System_Reflection_AssemblyName_GetNativeName (MonoAssembly*);
77 ICALL_EXPORT MonoBoolean ves_icall_RuntimeTypeHandle_is_subclass_of (MonoType*, MonoType*);
78 ICALL_EXPORT MonoBoolean ves_icall_System_Environment_GetIs64BitOperatingSystem (void);
79 ICALL_EXPORT MonoBoolean ves_icall_System_Environment_get_HasShutdownStarted (void);
80 ICALL_EXPORT MonoBoolean ves_icall_System_GCHandle_CheckCurrentDomain (MonoGCHandle gchandle);
81 ICALL_EXPORT MonoBoolean ves_icall_System_IO_DriveInfo_GetDiskFreeSpace (const gunichar2*, gint32, guint64*, guint64*, guint64*, gint32*);
82 ICALL_EXPORT MonoBoolean ves_icall_System_Reflection_AssemblyName_ParseAssemblyName (const char*, MonoAssemblyName*, MonoBoolean*, MonoBoolean* is_token_defined_arg);
83 ICALL_EXPORT MonoBoolean ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack (void);
84 ICALL_EXPORT MonoBoolean ves_icall_System_Threading_Thread_YieldInternal (void);
85 ICALL_EXPORT void ves_icall_System_Threading_Thread_GetCurrentThread (MonoThread * volatile *);
86 ICALL_EXPORT void ves_icall_System_ArgIterator_Setup (MonoArgIterator*, char*, char*);
87 ICALL_EXPORT MonoType* ves_icall_System_ArgIterator_IntGetNextArgType (MonoArgIterator*);
88 ICALL_EXPORT void ves_icall_System_ArgIterator_IntGetNextArg (MonoArgIterator*, MonoTypedRef*);
89 ICALL_EXPORT void ves_icall_System_ArgIterator_IntGetNextArgWithType (MonoArgIterator*, MonoTypedRef*, MonoType*);
90 ICALL_EXPORT double ves_icall_System_Math_Abs_double (double);
91 ICALL_EXPORT double ves_icall_System_Math_Acos (double);
92 ICALL_EXPORT double ves_icall_System_Math_Acosh (double);
93 ICALL_EXPORT double ves_icall_System_Math_Asin (double);
94 ICALL_EXPORT double ves_icall_System_Math_Asinh (double);
95 ICALL_EXPORT double ves_icall_System_Math_Atan (double);
96 ICALL_EXPORT double ves_icall_System_Math_Atan2 (double, double);
97 ICALL_EXPORT double ves_icall_System_Math_Atanh (double);
98 ICALL_EXPORT double ves_icall_System_Math_Cbrt (double);
99 ICALL_EXPORT double ves_icall_System_Math_Ceiling (double);
100 ICALL_EXPORT double ves_icall_System_Math_Cos (double);
101 ICALL_EXPORT double ves_icall_System_Math_Cosh (double);
102 ICALL_EXPORT double ves_icall_System_Math_Exp (double);
103 ICALL_EXPORT double ves_icall_System_Math_FMod (double, double);
104 ICALL_EXPORT double ves_icall_System_Math_Floor (double);
105 ICALL_EXPORT double ves_icall_System_Math_Log (double);
106 ICALL_EXPORT double ves_icall_System_Math_Log10 (double);
107 ICALL_EXPORT double ves_icall_System_Math_ModF (double, double*);
108 ICALL_EXPORT double ves_icall_System_Math_Pow (double, double);
109 ICALL_EXPORT double ves_icall_System_Math_Round (double);
110 ICALL_EXPORT double ves_icall_System_Math_Sin (double);
111 ICALL_EXPORT double ves_icall_System_Math_Sinh (double);
112 ICALL_EXPORT double ves_icall_System_Math_Sqrt (double);
113 ICALL_EXPORT double ves_icall_System_Math_Tan (double);
114 ICALL_EXPORT double ves_icall_System_Math_Tanh (double);
115 ICALL_EXPORT float ves_icall_System_MathF_Acos (float);
116 ICALL_EXPORT float ves_icall_System_MathF_Acosh (float);
117 ICALL_EXPORT float ves_icall_System_MathF_Asin (float);
118 ICALL_EXPORT float ves_icall_System_MathF_Asinh (float);
119 ICALL_EXPORT float ves_icall_System_MathF_Atan (float);
120 ICALL_EXPORT float ves_icall_System_MathF_Atan2 (float, float);
121 ICALL_EXPORT float ves_icall_System_MathF_Atanh (float);
122 ICALL_EXPORT float ves_icall_System_MathF_Cbrt (float);
123 ICALL_EXPORT float ves_icall_System_MathF_Ceiling (float);
124 ICALL_EXPORT float ves_icall_System_MathF_Cos (float);
125 ICALL_EXPORT float ves_icall_System_MathF_Cosh (float);
126 ICALL_EXPORT float ves_icall_System_MathF_Exp (float);
127 ICALL_EXPORT float ves_icall_System_MathF_FMod (float, float);
128 ICALL_EXPORT float ves_icall_System_MathF_Floor (float);
129 ICALL_EXPORT float ves_icall_System_MathF_Log (float);
130 ICALL_EXPORT float ves_icall_System_MathF_Log10 (float);
131 ICALL_EXPORT float ves_icall_System_MathF_ModF (float, float*);
132 ICALL_EXPORT float ves_icall_System_MathF_Pow (float, float);
133 ICALL_EXPORT float ves_icall_System_MathF_Sin (float);
134 ICALL_EXPORT float ves_icall_System_MathF_Sinh (float);
135 ICALL_EXPORT float ves_icall_System_MathF_Sqrt (float);
136 ICALL_EXPORT float ves_icall_System_MathF_Tan (float);
137 ICALL_EXPORT float ves_icall_System_MathF_Tanh (float);
138 ICALL_EXPORT float ves_icall_System_Math_Abs_single (float);
139 ICALL_EXPORT gint ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData (void);
140 ICALL_EXPORT gint32 ves_icall_System_Environment_get_ProcessorCount (void);
141 ICALL_EXPORT gint32 ves_icall_System_Environment_get_TickCount (void);
142 ICALL_EXPORT gint64 ves_icall_System_DateTime_GetSystemTimeAsFileTime (void);
143 ICALL_EXPORT gint64 ves_icall_System_Diagnostics_Process_GetProcessData (int, gint32, MonoProcessError*);
144 ICALL_EXPORT gint64 ves_icall_System_Diagnostics_Stopwatch_GetTimestamp (void);
145 ICALL_EXPORT gint64 ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection);
146 ICALL_EXPORT gint64 ves_icall_System_Threading_Timer_GetTimeMonotonic (void);
147 ICALL_EXPORT gpointer ves_icall_System_GCHandle_GetAddrOfPinnedObject (MonoGCHandle handle);
148 ICALL_EXPORT int ves_icall_Interop_Sys_DoubleToString (double, char*, char*, int);
149 ICALL_EXPORT int ves_icall_System_Environment_get_Platform (void);
150 ICALL_EXPORT int ves_icall_System_GC_GetCollectionCount (int);
151 ICALL_EXPORT int ves_icall_System_GC_GetMaxGeneration (void);
152 ICALL_EXPORT gint64 ves_icall_System_GC_GetAllocatedBytesForCurrentThread (void);
153 ICALL_EXPORT int ves_icall_System_Threading_Thread_SystemMaxStackSize (void);
154 ICALL_EXPORT int ves_icall_get_method_attributes (MonoMethod* method);
155 ICALL_EXPORT void ves_icall_Mono_Runtime_RegisterReportingForNativeLib (const char*, const char*);
156 ICALL_EXPORT void ves_icall_Mono_Runtime_RegisterReportingForAllNativeLibs (void);
157 ICALL_EXPORT void ves_icall_System_Array_GetGenericValue_icall (MonoArray**, guint32, gpointer);
158 ICALL_EXPORT void ves_icall_System_Array_SetGenericValue_icall (MonoArray**, guint32, gpointer);
159 ICALL_EXPORT void ves_icall_System_Buffer_MemcpyInternal (gpointer dest, gconstpointer src, gint32 count);
160 ICALL_EXPORT void ves_icall_System_Environment_Exit (int);
161 ICALL_EXPORT void ves_icall_System_GCHandle_FreeHandle (MonoGCHandle handle);
162 ICALL_EXPORT void ves_icall_System_GC_InternalCollect (int generation);
163 ICALL_EXPORT void ves_icall_System_GC_RecordPressure (gint64);
164 ICALL_EXPORT void ves_icall_System_GC_WaitForPendingFinalizers (void);
165 ICALL_EXPORT void ves_icall_System_GC_GetGCMemoryInfo (gint64*, gint64*, gint64*, gint64*, gint64*);
167 ICALL_EXPORT void ves_icall_System_IO_LogcatTextWriter_Log (const char*, gint32, const char*);
168 ICALL_EXPORT void ves_icall_System_NumberFormatter_GetFormatterTables (guint64 const**, gint32 const**, gunichar2 const**, gunichar2 const**, gint64 const**, gint32 const**);
169 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_Memmove (guint8*, guint8*, guint);
170 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_Memmove_wbarrier (guint8*, guint8*, guint, MonoType*);
171 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8*, guint);
172 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ecvt_s(char*, size_t, double, int, int*, int*);
174 #if defined(ENABLE_MONODROID) || defined(ENABLE_MONOTOUCH) || defined(TARGET_WASM)
175 ICALL_EXPORT gpointer ves_icall_System_IO_Compression_DeflateStreamNative_CreateZStream (gint32 compress, MonoBoolean gzip, gpointer feeder, gpointer data);
176 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_CloseZStream (gpointer stream);
177 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_Flush (gpointer stream);
178 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_ReadZStream (gpointer stream, gpointer buffer, gint32 length);
179 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_WriteZStream (gpointer stream, gpointer buffer, gint32 length);
180 #endif
182 #if defined(TARGET_WASM)
183 ICALL_EXPORT void ves_icall_System_TimeZoneInfo_mono_timezone_get_local_name (MonoString **result);
184 #endif
186 #if defined(ENABLE_MONODROID)
187 ICALL_EXPORT gpointer ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CreateNLSocket (void);
188 ICALL_EXPORT gint32 ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_ReadEvents (gpointer sock, gpointer buffer, gint32 count, gint32 size);
189 ICALL_EXPORT gpointer ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CloseNLSocket (gpointer sock);
190 #endif
192 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle);
193 ICALL_EXPORT gpointer ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void);
194 ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcessId (void);
195 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode);
196 ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle);
197 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creation_time, gint64 *exit_time, gint64 *kernel_time, gint64 *user_time);
198 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max);
199 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass);
200 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max);
201 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode);
202 ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle (gpointer handle, gint32 milliseconds);
204 ICALL_EXPORT MonoBoolean ves_icall_Mono_TlsProviderFactory_IsBtlsSupported (void);
206 ICALL_EXPORT void ves_icall_Mono_Runtime_AnnotateMicrosoftTelemetry (const char *key, const char *value);
207 ICALL_EXPORT void ves_icall_Mono_Runtime_DisableMicrosoftTelemetry (void);
208 ICALL_EXPORT int ves_icall_Mono_Runtime_CheckCrashReportingLog (const char *directory, MonoBoolean clear);
209 ICALL_EXPORT void ves_icall_Mono_Runtime_EnableCrashReportingLog (const char *directory);
211 ICALL_EXPORT void ves_icall_System_Array_InternalCreate (MonoArray *volatile* result, MonoType* type, gint32 rank, gint32* pLengths, gint32* pLowerBounds);
212 ICALL_EXPORT MonoBoolean ves_icall_System_Array_CanChangePrimitive (MonoReflectionType *volatile* ref_src_type_handle, MonoReflectionType *volatile* ref_dst_type_handle, MonoBoolean reliable);
214 ICALL_EXPORT MonoBoolean ves_icall_System_Diagnostics_Debugger_IsAttached_internal (void);
215 ICALL_EXPORT MonoBoolean ves_icall_System_Diagnostics_Debugger_IsLogging (void);
216 ICALL_EXPORT void ves_icall_System_Diagnostics_Debugger_Log (int level, MonoString *volatile* category, MonoString *volatile* message);
219 ICALL_EXPORT void ves_icall_Mono_RuntimeGPtrArrayHandle_GPtrArrayFree (GPtrArray *ptr_array);
220 ICALL_EXPORT void ves_icall_Mono_RuntimeMarshal_FreeAssemblyName (MonoAssemblyName *aname, MonoBoolean free_struct);
221 ICALL_EXPORT void ves_icall_Mono_SafeStringMarshal_GFree (void *c_str);
222 ICALL_EXPORT char* ves_icall_Mono_SafeStringMarshal_StringToUtf8 (MonoString *volatile* s);
223 ICALL_EXPORT MonoType* ves_icall_Mono_RuntimeClassHandle_GetTypeFromClass (MonoClass *klass);
225 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (const gunichar2*);
226 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (const gunichar2*);
227 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (const gunichar2*);
228 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (const gunichar2*);
229 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (const gunichar2*);
230 ICALL_EXPORT void ves_icall_Mono_Interop_ComInteropProxy_AddProxy (gpointer pUnk, MonoComInteropProxy *volatile* proxy_handle);
231 ICALL_EXPORT void ves_icall_Mono_Interop_ComInteropProxy_FindProxy (gpointer pUnk, MonoComInteropProxy *volatile* proxy_handle);
233 ICALL_EXPORT gpointer ves_icall_System_Net_Sockets_Socket_Accept_icall (gsize, gint32*, MonoBoolean);
234 ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Available_icall (gsize, gint32*);
235 ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Blocking_icall (gsize sock, MonoBoolean block, gint32 *werror);
236 ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Close_icall (gsize sock, gint32 *werror);
237 ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Disconnect_icall (gsize sock, MonoBoolean reuse, gint32 *werror);
238 ICALL_EXPORT MonoBoolean ves_icall_System_Net_Sockets_Socket_Duplicate_icall (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror);
239 ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Listen_icall (gsize sock, guint32 backlog, gint32 *werror);
240 ICALL_EXPORT MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_icall (gsize sock, gint mode, gint timeout, gint32 *werror);
241 ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Receive_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking);
242 ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_icall (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking);
243 ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Send_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking);
244 ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Send_array_icall (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking);
245 ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Shutdown_icall (gsize sock, gint32 how, gint32 *werror);
246 ICALL_EXPORT MonoBoolean ves_icall_System_Net_Sockets_Socket_SupportPortReuse_icall (MonoProtocolType proto);
248 ICALL_EXPORT gpointer ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int);
249 ICALL_EXPORT gpointer ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMemSize (gsize);
250 ICALL_EXPORT gpointer ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (gsize);
251 ICALL_EXPORT gpointer ves_icall_System_Runtime_InteropServices_Marshal_ReAllocCoTaskMem (gpointer ptr, int size);
252 ICALL_EXPORT gpointer ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (gpointer, gsize);
253 ICALL_EXPORT char* ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi (const gunichar2*, int);
254 ICALL_EXPORT gunichar2* ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (const gunichar2*, int);
256 ICALL_EXPORT gpointer ves_icall_System_Threading_Semaphore_CreateSemaphore_icall (gint32 initialCount, gint32 maximumCount, const gunichar2 *name, gint32 name_length, gint32 *win32error);
257 ICALL_EXPORT gpointer ves_icall_System_Threading_Semaphore_OpenSemaphore_icall (const gunichar2 *name, gint32 name_length, gint32 rights, gint32 *win32error);
258 ICALL_EXPORT MonoBoolean ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle, gint32 releaseCount, gint32 *prevcount);
263 #endif // __MONO_METADATA_ICALL_DECL_H__