From d2178044765f4c15b25a3389abfff4f002e16abc Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Thu, 12 Dec 2019 10:32:14 -0800 Subject: [PATCH] Remove handles/MonoError from 12 easy socket icalls. (mono/mono#18035) Also put _icall back on ends so the search coincides between managed and native. Commit migrated from https://github.com/mono/mono/commit/a1e16d32734eadfc9beddf77e522e80cf5276a43 --- src/mono/mono/metadata/icall-decl.h | 26 +++++++++++- src/mono/mono/metadata/icall-def.h | 54 ++++++++++++------------- src/mono/mono/metadata/w32socket-unix.c | 3 +- src/mono/mono/metadata/w32socket-win32.c | 3 +- src/mono/mono/metadata/w32socket.c | 69 ++++++++++++++------------------ src/mono/mono/metadata/w32socket.h | 2 +- 6 files changed, 83 insertions(+), 74 deletions(-) diff --git a/src/mono/mono/metadata/icall-decl.h b/src/mono/mono/metadata/icall-decl.h index 23b1252..a6b882e 100644 --- a/src/mono/mono/metadata/icall-decl.h +++ b/src/mono/mono/metadata/icall-decl.h @@ -175,6 +175,7 @@ ICALL_EXPORT void ves_icall_System_GC_InternalCollect (int generation); ICALL_EXPORT void ves_icall_System_GC_RecordPressure (gint64); ICALL_EXPORT void ves_icall_System_GC_WaitForPendingFinalizers (void); ICALL_EXPORT void ves_icall_System_GC_GetGCMemoryInfo (gint64*, gint64*, gint64*, gint64*, gint64*); + #if !ENABLE_NETCORE ICALL_EXPORT void ves_icall_System_IO_LogcatTextWriter_Log (const char*, gint32, const char*); #endif @@ -192,6 +193,7 @@ ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8*, s ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8*, guint); #endif ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ecvt_s(char*, size_t, double, int, int*, int*); + #if defined(ENABLE_MONODROID) || defined(ENABLE_MONOTOUCH) || defined(TARGET_WASM) ICALL_EXPORT gpointer ves_icall_System_IO_Compression_DeflateStreamNative_CreateZStream (gint32 compress, MonoBoolean gzip, gpointer feeder, gpointer data); ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_CloseZStream (gpointer stream); @@ -199,6 +201,7 @@ ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_Flush (g ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_ReadZStream (gpointer stream, gpointer buffer, gint32 length); ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_WriteZStream (gpointer stream, gpointer buffer, gint32 length); #endif + #if defined(ENABLE_MONODROID) ICALL_EXPORT gpointer ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CreateNLSocket (void); ICALL_EXPORT gint32 ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_ReadEvents (gpointer sock, gpointer buffer, gint32 count, gint32 size); @@ -216,27 +219,46 @@ ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClas ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max); ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode); ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle (gpointer handle, gint32 milliseconds); + ICALL_EXPORT MonoBoolean ves_icall_Mono_TlsProviderFactory_IsBtlsSupported (void); + ICALL_EXPORT void ves_icall_Mono_Runtime_AnnotateMicrosoftTelemetry (const char *key, const char *value); ICALL_EXPORT void ves_icall_Mono_Runtime_DisableMicrosoftTelemetry (void); ICALL_EXPORT int ves_icall_Mono_Runtime_CheckCrashReportingLog (const char *directory, MonoBoolean clear); ICALL_EXPORT void ves_icall_Mono_Runtime_EnableCrashReportingLog (const char *directory); + ICALL_EXPORT void ves_icall_System_Array_InternalCreate (MonoArray *volatile* result, MonoType* type, gint32 rank, gint32* pLengths, gint32* pLowerBounds); ICALL_EXPORT MonoBoolean ves_icall_System_Array_CanChangePrimitive (MonoReflectionType *volatile* ref_src_type_handle, MonoReflectionType *volatile* ref_dst_type_handle, MonoBoolean reliable); + ICALL_EXPORT MonoBoolean ves_icall_System_Diagnostics_Debugger_IsAttached_internal (void); ICALL_EXPORT MonoBoolean ves_icall_System_Diagnostics_Debugger_IsLogging (void); ICALL_EXPORT void ves_icall_System_Diagnostics_Debugger_Log (int level, MonoString *volatile* category, MonoString *volatile* message); + ICALL_EXPORT void ves_icall_Mono_RuntimeGPtrArrayHandle_GPtrArrayFree (GPtrArray *ptr_array); ICALL_EXPORT void ves_icall_Mono_RuntimeMarshal_FreeAssemblyName (MonoAssemblyName *aname, MonoBoolean free_struct); ICALL_EXPORT void ves_icall_Mono_SafeStringMarshal_GFree (void *c_str); ICALL_EXPORT char* ves_icall_Mono_SafeStringMarshal_StringToUtf8 (MonoString *volatile* s); ICALL_EXPORT MonoType* ves_icall_Mono_RuntimeClassHandle_GetTypeFromClass (MonoClass *klass); + ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (const gunichar2*); ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (const gunichar2*); ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (const gunichar2*); ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (const gunichar2*); ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (const gunichar2*); -ICALL_EXPORT gpointer ves_icall_System_Net_Sockets_Socket_Accept (gsize, gint32*, MonoBoolean); -ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Available (gsize, gint32*); + +ICALL_EXPORT gpointer ves_icall_System_Net_Sockets_Socket_Accept_icall (gsize, gint32*, MonoBoolean); +ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Available_icall (gsize, gint32*); +ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Blocking_icall (gsize sock, MonoBoolean block, gint32 *werror); +ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Close_icall (gsize sock, gint32 *werror); +ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Disconnect_icall (gsize sock, MonoBoolean reuse, gint32 *werror); +ICALL_EXPORT MonoBoolean ves_icall_System_Net_Sockets_Socket_Duplicate_icall (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror); +ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Listen_icall (gsize sock, guint32 backlog, gint32 *werror); +ICALL_EXPORT MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_icall (gsize sock, gint mode, gint timeout, gint32 *werror); +ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Receive_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking); +ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_icall (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking); +ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Send_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking); +ICALL_EXPORT gint32 ves_icall_System_Net_Sockets_Socket_Send_array_icall (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking); +ICALL_EXPORT void ves_icall_System_Net_Sockets_Socket_Shutdown_icall (gsize sock, gint32 how, gint32 *werror); +ICALL_EXPORT MonoBoolean ves_icall_System_Net_Sockets_Socket_SupportPortReuse_icall (MonoProtocolType proto); #endif // __MONO_METADATA_ICALL_DECL_H__ diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index 272bf8c..5b1d69f 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -533,38 +533,38 @@ ICALL_TYPE(MAC_IFACE_PROPS, "System.Net.NetworkInformation.MacOsIPInterfacePrope HANDLES(MAC_IFACE_PROPS_1, "ParseRouteInfo_icall", ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo, MonoBoolean, 2, (MonoString, MonoArrayOut)) ICALL_TYPE(SOCK, "System.Net.Sockets.Socket", SOCK_1) -NOHANDLES(ICALL(SOCK_1, "Accept_icall", ves_icall_System_Net_Sockets_Socket_Accept)) -NOHANDLES(ICALL(SOCK_2, "Available_icall", ves_icall_System_Net_Sockets_Socket_Available)) -HANDLES(SOCK_3, "Bind_icall", ves_icall_System_Net_Sockets_Socket_Bind, void, 3, (gsize, MonoObject, gint32_ref)) -HANDLES(SOCK_4, "Blocking_icall", ves_icall_System_Net_Sockets_Socket_Blocking, void, 3, (gsize, MonoBoolean, gint32_ref)) -HANDLES(SOCK_5, "Close_icall", ves_icall_System_Net_Sockets_Socket_Close, void, 2, (gsize, gint32_ref)) -HANDLES(SOCK_6, "Connect_icall", ves_icall_System_Net_Sockets_Socket_Connect, void, 4, (gsize, MonoObject, gint32_ref, MonoBoolean)) -HANDLES(SOCK_6a, "Disconnect_icall", ves_icall_System_Net_Sockets_Socket_Disconnect, void, 3, (gsize, MonoBoolean, gint32_ref)) -HANDLES(SOCK_6b, "Duplicate_icall", ves_icall_System_Net_Sockets_Socket_Duplicate, MonoBoolean, 4, (gpointer, gint32, gpointer_ref, gint32_ref)) +NOHANDLES(ICALL(SOCK_1, "Accept_icall", ves_icall_System_Net_Sockets_Socket_Accept_icall)) +NOHANDLES(ICALL(SOCK_2, "Available_icall", ves_icall_System_Net_Sockets_Socket_Available_icall)) +HANDLES(SOCK_3, "Bind_icall", ves_icall_System_Net_Sockets_Socket_Bind_icall, void, 3, (gsize, MonoObject, gint32_ref)) +NOHANDLES(ICALL(SOCK_4, "Blocking_icall", ves_icall_System_Net_Sockets_Socket_Blocking_icall)) +NOHANDLES(ICALL(SOCK_5, "Close_icall", ves_icall_System_Net_Sockets_Socket_Close_icall)) +HANDLES(SOCK_6, "Connect_icall", ves_icall_System_Net_Sockets_Socket_Connect_icall, void, 4, (gsize, MonoObject, gint32_ref, MonoBoolean)) +NOHANDLES(ICALL(SOCK_6a, "Disconnect_icall", ves_icall_System_Net_Sockets_Socket_Disconnect_icall)) +NOHANDLES(ICALL(SOCK_6b, "Duplicate_icall", ves_icall_System_Net_Sockets_Socket_Duplicate_icall)) //FIXME The array is ref but the icall does not write to it. -HANDLES(SOCK_7, "GetSocketOption_arr_icall", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr, void, 5, (gsize, gint32, gint32, MonoArray, gint32_ref)) -HANDLES(SOCK_8, "GetSocketOption_obj_icall", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj, void, 5, (gsize, gint32, gint32, MonoObjectOut, gint32_ref)) -HANDLES(SOCK_21, "IOControl_icall", ves_icall_System_Net_Sockets_Socket_IOControl, int, 5, (gsize, gint32, MonoArray, MonoArray, gint32_ref)) -HANDLES(SOCK_9, "Listen_icall", ves_icall_System_Net_Sockets_Socket_Listen, void, 3, (gsize, guint32, gint32_ref)) -HANDLES(SOCK_10, "LocalEndPoint_icall", ves_icall_System_Net_Sockets_Socket_LocalEndPoint, MonoObject, 3, (gsize, gint32, gint32_ref)) -HANDLES(SOCK_11, "Poll_icall", ves_icall_System_Net_Sockets_Socket_Poll, MonoBoolean, 4, (gsize, int, int, gint32_ref)) -HANDLES(SOCK_13, "ReceiveFrom_icall", ves_icall_System_Net_Sockets_Socket_ReceiveFrom, gint32, 7, (gsize, char_ptr, gint32, gint32, MonoObjectInOut, gint32_ref, MonoBoolean)) -HANDLES(SOCK_11a, "Receive_array_icall", ves_icall_System_Net_Sockets_Socket_Receive_array, gint32, 6, (gsize, WSABUF_ptr, gint32, gint32, gint32_ref, MonoBoolean)) -HANDLES(SOCK_12, "Receive_icall", ves_icall_System_Net_Sockets_Socket_Receive, gint32, 6, (gsize, char_ptr, gint32, gint32, gint32_ref, MonoBoolean)) -HANDLES(SOCK_14, "RemoteEndPoint_icall", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint, MonoObject, 3, (gsize, gint32, gint32_ref)) -HANDLES(SOCK_15, "Select_icall", ves_icall_System_Net_Sockets_Socket_Select, void, 3, (MonoArrayInOut, gint32, gint32_ref)) -HANDLES(SOCK_15a, "SendFile_icall", ves_icall_System_Net_Sockets_Socket_SendFile, MonoBoolean, 7, (gsize, MonoString, MonoArray, MonoArray, int, gint32_ref, MonoBoolean)) -HANDLES(SOCK_16, "SendTo_icall", ves_icall_System_Net_Sockets_Socket_SendTo, gint32, 7, (gsize, char_ptr, gint32, gint32, MonoObject, gint32_ref, MonoBoolean)) -HANDLES(SOCK_16a, "Send_array_icall", ves_icall_System_Net_Sockets_Socket_Send_array, gint32, 6, (gsize, WSABUF_ptr, gint32, gint32, gint32_ref, MonoBoolean)) -HANDLES(SOCK_17, "Send_icall", ves_icall_System_Net_Sockets_Socket_Send, gint32, 6, (gsize, char_ptr, gint32, gint32, gint32_ref, MonoBoolean)) -HANDLES(SOCK_18, "SetSocketOption_icall", ves_icall_System_Net_Sockets_Socket_SetSocketOption, void, 7, (gsize, gint32, gint32, MonoObject, MonoArray, gint32, gint32_ref)) -HANDLES(SOCK_19, "Shutdown_icall", ves_icall_System_Net_Sockets_Socket_Shutdown, void, 3, (gsize, gint32, gint32_ref)) +HANDLES(SOCK_7, "GetSocketOption_arr_icall", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_icall, void, 5, (gsize, gint32, gint32, MonoArray, gint32_ref)) +HANDLES(SOCK_8, "GetSocketOption_obj_icall", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_icall, void, 5, (gsize, gint32, gint32, MonoObjectOut, gint32_ref)) +HANDLES(SOCK_21, "IOControl_icall", ves_icall_System_Net_Sockets_Socket_IOControl_icall, int, 5, (gsize, gint32, MonoArray, MonoArray, gint32_ref)) +NOHANDLES(ICALL(SOCK_9, "Listen_icall", ves_icall_System_Net_Sockets_Socket_Listen_icall)) +HANDLES(SOCK_10, "LocalEndPoint_icall", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_icall, MonoObject, 3, (gsize, gint32, gint32_ref)) +NOHANDLES(ICALL(SOCK_11, "Poll_icall", ves_icall_System_Net_Sockets_Socket_Poll_icall)) +HANDLES(SOCK_13, "ReceiveFrom_icall", ves_icall_System_Net_Sockets_Socket_ReceiveFrom_icall, gint32, 7, (gsize, char_ptr, gint32, gint32, MonoObjectInOut, gint32_ref, MonoBoolean)) +NOHANDLES(ICALL(SOCK_11a, "Receive_array_icall", ves_icall_System_Net_Sockets_Socket_Receive_array_icall)) +NOHANDLES(ICALL(SOCK_12, "Receive_icall", ves_icall_System_Net_Sockets_Socket_Receive_icall)) +HANDLES(SOCK_14, "RemoteEndPoint_icall", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_icall, MonoObject, 3, (gsize, gint32, gint32_ref)) +HANDLES(SOCK_15, "Select_icall", ves_icall_System_Net_Sockets_Socket_Select_icall, void, 3, (MonoArrayInOut, gint32, gint32_ref)) +HANDLES(SOCK_15a, "SendFile_icall", ves_icall_System_Net_Sockets_Socket_SendFile_icall, MonoBoolean, 7, (gsize, MonoString, MonoArray, MonoArray, int, gint32_ref, MonoBoolean)) +HANDLES(SOCK_16, "SendTo_icall", ves_icall_System_Net_Sockets_Socket_SendTo_icall, gint32, 7, (gsize, char_ptr, gint32, gint32, MonoObject, gint32_ref, MonoBoolean)) +NOHANDLES(ICALL(SOCK_16a, "Send_array_icall", ves_icall_System_Net_Sockets_Socket_Send_array_icall)) +NOHANDLES(ICALL(SOCK_17, "Send_icall", ves_icall_System_Net_Sockets_Socket_Send_icall)) +HANDLES(SOCK_18, "SetSocketOption_icall", ves_icall_System_Net_Sockets_Socket_SetSocketOption_icall, void, 7, (gsize, gint32, gint32, MonoObject, MonoArray, gint32, gint32_ref)) +NOHANDLES(ICALL(SOCK_19, "Shutdown_icall", ves_icall_System_Net_Sockets_Socket_Shutdown_icall)) HANDLES(SOCK_20, "Socket_icall", ves_icall_System_Net_Sockets_Socket_Socket_icall, gpointer, 4, (gint32, gint32, gint32, gint32_ref)) -HANDLES(SOCK_20a, "SupportsPortReuse", ves_icall_System_Net_Sockets_Socket_SupportPortReuse, MonoBoolean, 1, (MonoProtocolType)) +NOHANDLES(ICALL(SOCK_20a, "SupportsPortReuse", ves_icall_System_Net_Sockets_Socket_SupportPortReuse_icall)) HANDLES(SOCK_21a, "cancel_blocking_socket_operation", ves_icall_cancel_blocking_socket_operation, void, 1, (MonoThreadObject)) ICALL_TYPE(SOCKEX, "System.Net.Sockets.SocketException", SOCKEX_1) -NOHANDLES(ICALL(SOCKEX_1, "WSAGetLastError_icall", ves_icall_System_Net_Sockets_SocketException_WSAGetLastError)) +NOHANDLES(ICALL(SOCKEX_1, "WSAGetLastError_icall", ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_icall)) #endif /* !DISABLE_SOCKETS */ ICALL_TYPE(NUMBER_FORMATTER, "System.NumberFormatter", NUMBER_FORMATTER_1) diff --git a/src/mono/mono/metadata/w32socket-unix.c b/src/mono/mono/metadata/w32socket-unix.c index 5822ee7..ac3bd0f 100644 --- a/src/mono/mono/metadata/w32socket-unix.c +++ b/src/mono/mono/metadata/w32socket-unix.c @@ -1555,9 +1555,8 @@ mono_w32socket_convert_error (gint error) #ifndef ENABLE_NETCORE MonoBoolean -ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error) +ves_icall_System_Net_Sockets_Socket_SupportPortReuse_icall (MonoProtocolType proto) { - error_init (error); #if defined (SO_REUSEPORT) return TRUE; #else diff --git a/src/mono/mono/metadata/w32socket-win32.c b/src/mono/mono/metadata/w32socket-win32.c index 44147f6..513e5bb 100644 --- a/src/mono/mono/metadata/w32socket-win32.c +++ b/src/mono/mono/metadata/w32socket-win32.c @@ -274,9 +274,8 @@ mono_w32socket_convert_error (gint error) } MonoBoolean -ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error) +ves_icall_System_Net_Sockets_Socket_SupportPortReuse_icall (MonoProtocolType proto) { - error_init (error); return TRUE; } diff --git a/src/mono/mono/metadata/w32socket.c b/src/mono/mono/metadata/w32socket.c index 287af35..477a25d 100644 --- a/src/mono/mono/metadata/w32socket.c +++ b/src/mono/mono/metadata/w32socket.c @@ -785,11 +785,10 @@ ves_icall_System_Net_Sockets_Socket_Socket_icall (gint32 family, gint32 type, gi * file) is really an IntPtr which needs to be converted to a guint32. */ void -ves_icall_System_Net_Sockets_Socket_Close (gsize sock, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Close_icall (gsize sock, gint32 *werror) { LOGDEBUG (g_message ("%s: closing 0x%x", __func__, sock)); - error_init (error); *werror = 0; /* Clear any pending work item from this socket if the underlying @@ -800,7 +799,7 @@ ves_icall_System_Net_Sockets_Socket_Close (gsize sock, gint32 *werror, MonoError } gint32 -ves_icall_System_Net_Sockets_SocketException_WSAGetLastError (void) +ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_icall (void) { LOGDEBUG (g_message("%s: returning %d", __func__, mono_w32socket_get_last_error ())); @@ -808,7 +807,7 @@ ves_icall_System_Net_Sockets_SocketException_WSAGetLastError (void) } gint32 -ves_icall_System_Net_Sockets_Socket_Available (gsize sock, gint32 *werror) +ves_icall_System_Net_Sockets_Socket_Available_icall (gsize sock, gint32 *werror) { int ret; guint64 amount; @@ -826,11 +825,10 @@ ves_icall_System_Net_Sockets_Socket_Available (gsize sock, gint32 *werror) } void -ves_icall_System_Net_Sockets_Socket_Blocking (gsize sock, MonoBoolean block, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Blocking_icall (gsize sock, MonoBoolean block, gint32 *werror) { int ret; - error_init (error); *werror = 0; ret = mono_w32socket_set_blocking (sock, block); @@ -839,7 +837,7 @@ ves_icall_System_Net_Sockets_Socket_Blocking (gsize sock, MonoBoolean block, gin } gpointer -ves_icall_System_Net_Sockets_Socket_Accept (gsize sock, gint32 *werror, MonoBoolean blocking) +ves_icall_System_Net_Sockets_Socket_Accept_icall (gsize sock, gint32 *werror, MonoBoolean blocking) { SOCKET newsock; @@ -855,11 +853,10 @@ ves_icall_System_Net_Sockets_Socket_Accept (gsize sock, gint32 *werror, MonoBool } void -ves_icall_System_Net_Sockets_Socket_Listen (gsize sock, guint32 backlog, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Listen_icall (gsize sock, guint32 backlog, gint32 *werror) { int ret; - error_init (error); *werror = 0; ret = mono_w32socket_listen (sock, backlog); @@ -1081,13 +1078,13 @@ exit: } MonoObjectHandle -ves_icall_System_Net_Sockets_Socket_LocalEndPoint (gsize sock, gint32 af, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_LocalEndPoint_icall (gsize sock, gint32 af, gint32 *werror, MonoError *error) { return mono_w32socket_getname (sock, af, TRUE, werror, error); } MonoObjectHandle -ves_icall_System_Net_Sockets_Socket_RemoteEndPoint (gsize sock, gint32 af, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_icall (gsize sock, gint32 af, gint32 *werror, MonoError *error) { return mono_w32socket_getname (sock, af, FALSE, werror, error); } @@ -1218,7 +1215,7 @@ create_sockaddr_from_handle (MonoObjectHandle saddr_obj, socklen_t *sa_size, gin } void -ves_icall_System_Net_Sockets_Socket_Bind (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Bind_icall (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoError *error) { struct sockaddr *sa; socklen_t sa_size; @@ -1249,8 +1246,7 @@ enum { }; MonoBoolean -ves_icall_System_Net_Sockets_Socket_Poll (gsize sock, gint mode, - gint timeout, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Poll_icall (gsize sock, gint mode, gint timeout, gint32 *werror) { MonoInternalThread *thread = mono_thread_internal_current (); mono_pollfd *pfds; @@ -1258,7 +1254,6 @@ ves_icall_System_Net_Sockets_Socket_Poll (gsize sock, gint mode, time_t start; gint rtimeout; - error_init (error); *werror = 0; pfds = g_new0 (mono_pollfd, 1); @@ -1323,7 +1318,7 @@ ves_icall_System_Net_Sockets_Socket_Poll (gsize sock, gint mode, } void -ves_icall_System_Net_Sockets_Socket_Connect (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Connect_icall (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error) { struct sockaddr *sa; socklen_t sa_size; @@ -1349,21 +1344,18 @@ ves_icall_System_Net_Sockets_Socket_Connect (gsize sock, MonoObjectHandle sockad #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) void -ves_icall_System_Net_Sockets_Socket_Disconnect (gsize sock, MonoBoolean reuse, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Disconnect_icall (gsize sock, MonoBoolean reuse, gint32 *werror) { - error_init (error); - LOGDEBUG (g_message("%s: disconnecting from socket %p (reuse %d)", __func__, sock, reuse)); *werror = mono_w32socket_disconnect (sock, reuse); } + #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */ MonoBoolean -ves_icall_System_Net_Sockets_Socket_Duplicate (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Duplicate_icall (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror) { - error_init (error); - *werror = 0; if (!mono_w32socket_duplicate (handle, targetProcessId, duplicate_handle)) { *werror = mono_w32error_get_last (); @@ -1374,12 +1366,11 @@ ves_icall_System_Net_Sockets_Socket_Duplicate (gpointer handle, gint32 targetPro } gint32 -ves_icall_System_Net_Sockets_Socket_Receive (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Receive_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking) { int ret; int recvflags = 0; - error_init (error); *werror = 0; recvflags = convert_socketflags (flags); @@ -1398,13 +1389,12 @@ ves_icall_System_Net_Sockets_Socket_Receive (gsize sock, gchar *buffer, gint32 c } gint32 -ves_icall_System_Net_Sockets_Socket_Receive_array (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Receive_array_icall (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking) { int ret; guint32 recv; guint32 recvflags = 0; - error_init (error); *werror = 0; recvflags = convert_socketflags (flags); @@ -1423,7 +1413,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_array (gsize sock, WSABUF *buffers, } gint32 -ves_icall_System_Net_Sockets_Socket_ReceiveFrom (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandleInOut sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_ReceiveFrom_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandleInOut sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error) { int ret; int recvflags = 0; @@ -1472,12 +1462,11 @@ ves_icall_System_Net_Sockets_Socket_ReceiveFrom (gsize sock, gchar *buffer, gint } gint32 -ves_icall_System_Net_Sockets_Socket_Send (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Send_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking) { int ret; int sendflags = 0; - error_init (error); *werror = 0; LOGDEBUG (g_message("%s: Sending %d bytes", __func__, count)); @@ -1498,13 +1487,12 @@ ves_icall_System_Net_Sockets_Socket_Send (gsize sock, gchar *buffer, gint32 coun } gint32 -ves_icall_System_Net_Sockets_Socket_Send_array (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Send_array_icall (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking) { int ret; guint32 sent; guint32 sendflags = 0; - error_init (error); *werror = 0; sendflags = convert_socketflags (flags); @@ -1523,7 +1511,7 @@ ves_icall_System_Net_Sockets_Socket_Send_array (gsize sock, WSABUF *buffers, gin } gint32 -ves_icall_System_Net_Sockets_Socket_SendTo (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_SendTo_icall (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error) { int ret; int sendflags = 0; @@ -1626,7 +1614,7 @@ leave: } void -ves_icall_System_Net_Sockets_Socket_Select (MonoArrayHandleOut sockets, gint32 timeout, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Select_icall (MonoArrayHandleOut sockets, gint32 timeout, gint32 *werror, MonoError *error) { MonoInternalThread *thread = mono_thread_internal_current (); mono_pollfd *pfds; @@ -1726,7 +1714,7 @@ int_to_object_handle (MonoDomain *domain, int val, MonoError *error) } void -ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj (gsize sock, gint32 level, gint32 name, MonoObjectHandleOut obj_val, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_icall (gsize sock, gint32 level, gint32 name, MonoObjectHandleOut obj_val, gint32 *werror, MonoError *error) { int system_level = 0; int system_name = 0; @@ -1892,7 +1880,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj (gsize sock, gint32 leve } } void -ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr (gsize sock, gint32 level, gint32 name, MonoArrayHandle byte_val, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_icall (gsize sock, gint32 level, gint32 name, MonoArrayHandle byte_val, gint32 *werror, MonoError *error) { int system_level = 0; int system_name = 0; @@ -2009,7 +1997,7 @@ get_local_interface_id (int family) #endif /* HAVE_STRUCT_SOCKADDR_IN6 */ void -ves_icall_System_Net_Sockets_Socket_SetSocketOption (gsize sock, gint32 level, gint32 name, MonoObjectHandle obj_val, MonoArrayHandle byte_val, gint32 int_val, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_SetSocketOption_icall (gsize sock, gint32 level, gint32 name, MonoObjectHandle obj_val, MonoArrayHandle byte_val, gint32 int_val, gint32 *werror, MonoError *error) { struct linger linger; int system_level = 0; @@ -2244,11 +2232,10 @@ ves_icall_System_Net_Sockets_Socket_SetSocketOption (gsize sock, gint32 level, g } void -ves_icall_System_Net_Sockets_Socket_Shutdown (gsize sock, gint32 how, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_Shutdown_icall (gsize sock, gint32 how, gint32 *werror) { int ret; - error_init (error); *werror = 0; /* Currently, the values for how (recv=0, send=1, both=2) match the BSD API */ @@ -2258,7 +2245,7 @@ ves_icall_System_Net_Sockets_Socket_Shutdown (gsize sock, gint32 how, gint32 *we } gint -ves_icall_System_Net_Sockets_Socket_IOControl (gsize sock, gint32 code, MonoArrayHandle input, MonoArrayHandle output, gint32 *werror, MonoError *error) +ves_icall_System_Net_Sockets_Socket_IOControl_icall (gsize sock, gint32 code, MonoArrayHandle input, MonoArrayHandle output, gint32 *werror, MonoError *error) { #ifdef HOST_WIN32 DWORD output_bytes = 0; @@ -2573,8 +2560,9 @@ ves_icall_System_Net_Dns_GetHostName (MonoStringHandleOut h_name, MonoError *err } #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) + MonoBoolean -ves_icall_System_Net_Sockets_Socket_SendFile (gsize sock, MonoStringHandle filename, MonoArrayHandle pre_buffer, MonoArrayHandle post_buffer, gint flags, gint32 *werror, MonoBoolean blocking, MonoError *error) +ves_icall_System_Net_Sockets_Socket_SendFile_icall (gsize sock, MonoStringHandle filename, MonoArrayHandle pre_buffer, MonoArrayHandle post_buffer, gint flags, gint32 *werror, MonoBoolean blocking, MonoError *error) { HANDLE file; gboolean ret; @@ -2626,6 +2614,7 @@ ves_icall_System_Net_Sockets_Socket_SendFile (gsize sock, MonoStringHandle filen return ret; } + #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */ void diff --git a/src/mono/mono/metadata/w32socket.h b/src/mono/mono/metadata/w32socket.h index 05d8fa6..99ede9a 100644 --- a/src/mono/mono/metadata/w32socket.h +++ b/src/mono/mono/metadata/w32socket.h @@ -176,7 +176,7 @@ TYPED_HANDLE_DECL (MonoPeerCredData); ICALL_EXPORT gint32 -ves_icall_System_Net_Sockets_SocketException_WSAGetLastError (void); +ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_icall (void); void mono_network_init(void); -- 2.7.4