[RFC PATCH v2 04/11] server: Attempt to complete I/O request immediately in recv_socket.

Zebediah Figura (she/her) zfigura at codeweavers.com
Tue Jan 25 12:23:04 CST 2022


On 1/22/22 08:36, Jinoh Kang wrote:
> diff --git a/include/wine/afd.h b/include/wine/afd.h
> index efd5787e90a..1e26739229d 100644
> --- a/include/wine/afd.h
> +++ b/include/wine/afd.h
> @@ -37,6 +37,23 @@ struct afd_wsabuf_32
>   # define WS(x)    x
>   #endif
>   
> +
> +/* Used in the iosb.result field to indicate that the current socket I/O
> + * operation is in synchronous non-blocking mode.  This value is normally
> + * transmitted via the APC_ASYNC_IO system APC call (with status STATUS_ALERTED)
> + * when the server gives the client a chance to complete the I/O synchronously
> + * before resuming the request as fully asynchronous I/O or failing it.
> + * If the I/O fails with EWOULDBLOCK and the iosb.result field is set to any
> + * other value, the client shall request the server to resume the asynchronous
> + * operation.
> + *
> + * The value (ULONG_PTR)-1 (the maximum value of ULONG_PTR) is chosen so that
> + * it will be least likely to be confused with "the number of bytes transferred
> + * so far."  Any I/O operation that has made it to the maximum number of bytes
> + * shall complete immediately anyway.
> + */
> +#define AFD_WINE_IN_NONBLOCKING_MODE ((ULONG_PTR)-1)
> +

Why add this instead of returning a separate field from the recv_socket 
request?



More information about the wine-devel mailing list