NULL, /* signal */
NULL, /* own */
NULL, /* is_owned */
+ NULL, /* special_wait */
+ NULL /* prewait */
};
static mono_once_t socket_ops_once=MONO_ONCE_INIT;
startup_count++;
/* I've no idea what is the minor version of the spec I read */
- data->wHighVersion = MAKEWORD(2,0);
+ data->wHighVersion = MAKEWORD(2,2);
data->wVersion = requested < data->wHighVersion? requested:
data->wHighVersion;
if (fd >= _wapi_fd_reserve) {
#ifdef DEBUG
- g_message ("%s: File descriptor is too big", __func__);
+ g_message ("%s: File descriptor is too big (%d >= %d)",
+ __func__, fd, _wapi_fd_offset_table_size);
#endif
WSASetLastError (WSASYSCALLFAILURE);
} else {
/* We just copy the buffer to the output. Some ioctls
* don't even output any data, but, well...
+ *
+ * NB windows returns WSAEFAULT if o_len is too small
*/
i_len = (i_len > o_len) ? o_len : i_len;
- memcpy (output, buffer, i_len);
+
+ if (i_len > 0 && output != NULL) {
+ memcpy (output, buffer, i_len);
+ }
+
g_free (buffer);
*written = i_len;
}