[io-layer] Extract socket (#4241)
[mono.git] / mono / io-layer / wapi.c
index f1674179d9a194f0d2dcb4d992acbf5bb6926d3c..d4da229603e49264010aa78f072d525d308dd690 100644 (file)
@@ -3,11 +3,9 @@
 
 #include "io-trace.h"
 #include "io.h"
-#include "process-private.h"
-#include "socket-private.h"
 
 #include "mono/utils/mono-lazy-init.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 gboolean _wapi_has_shut_down = FALSE;
 
@@ -15,8 +13,6 @@ void
 wapi_init (void)
 {
        _wapi_io_init ();
-       _wapi_processes_init ();
-       _wapi_socket_init ();
 }
 
 void
@@ -26,7 +22,6 @@ wapi_cleanup (void)
        _wapi_has_shut_down = TRUE;
 
        _wapi_error_cleanup ();
-       wapi_processes_cleanup ();
        _wapi_io_cleanup ();
 }
 
@@ -49,27 +44,6 @@ wapi_getpid (void)
        return _wapi_pid;
 }
 
-/* Lots more to implement here, but this is all we need at the moment */
-gboolean
-DuplicateHandle (gpointer srcprocess, gpointer src, gpointer targetprocess, gpointer *target,
-       guint32 access G_GNUC_UNUSED, gboolean inherit G_GNUC_UNUSED, guint32 options G_GNUC_UNUSED)
-{
-       if (srcprocess != _WAPI_PROCESS_CURRENT || targetprocess != _WAPI_PROCESS_CURRENT) {
-               /* Duplicating other process's handles is not supported */
-               SetLastError (ERROR_INVALID_HANDLE);
-               return FALSE;
-       }
-
-       if (src == _WAPI_PROCESS_CURRENT) {
-               *target = _wapi_process_duplicate ();
-       } else {
-               mono_w32handle_ref (src);
-               *target = src;
-       }
-
-       return TRUE;
-}
-
 /**
  * CloseHandle:
  * @handle: The handle to release