+static void pipe_close (gpointer handle, gpointer data);
+static void pipe_details (gpointer data);
+static const gchar* pipe_typename (void);
+static gsize pipe_typesize (void);
+static gint pipe_getfiletype (void);
+static gboolean pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread);
+static gboolean pipe_write (gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten);
+
+/* Pipe handles
+ */
+static MonoW32HandleOps _wapi_pipe_ops = {
+ pipe_close, /* close */
+ NULL, /* signal */
+ NULL, /* own */
+ NULL, /* is_owned */
+ NULL, /* special_wait */
+ NULL, /* prewait */
+ pipe_details, /* details */
+ pipe_typename, /* typename */
+ pipe_typesize, /* typesize */
+};
+
+static const struct {
+ /* File, console and pipe handles */
+ gint (*getfiletype)(void);
+
+ /* File, console and pipe handles */
+ gboolean (*readfile)(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread);
+ gboolean (*writefile)(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten);
+ gboolean (*flushfile)(gpointer handle);
+
+ /* File handles */
+ guint32 (*seek)(gpointer handle, gint32 movedistance,
+ gint32 *highmovedistance, gint method);
+ gboolean (*setendoffile)(gpointer handle);
+ guint32 (*getfilesize)(gpointer handle, guint32 *highsize);
+ gboolean (*getfiletime)(gpointer handle, FILETIME *create_time,
+ FILETIME *access_time,
+ FILETIME *write_time);
+ gboolean (*setfiletime)(gpointer handle,
+ const FILETIME *create_time,
+ const FILETIME *access_time,
+ const FILETIME *write_time);
+} io_ops[MONO_W32HANDLE_COUNT]={
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* file */
+ {file_getfiletype,
+ file_read, file_write,
+ file_flush, file_seek,
+ file_setendoffile,
+ file_getfilesize,
+ file_getfiletime,
+ file_setfiletime},
+ /* console */
+ {console_getfiletype,
+ console_read,
+ console_write,
+ NULL, NULL, NULL, NULL, NULL, NULL},
+ /* thread */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* sem */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* mutex */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* event */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* socket (will need at least read and write) */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* find */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* process */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* pipe */
+ {pipe_getfiletype,
+ pipe_read,
+ pipe_write,
+ NULL, NULL, NULL, NULL, NULL, NULL},
+};
+