ws2_32: Use register_async for WS2_async_recv.
This changes behaviour in case when winsock attempts to use both completion routine and completion value. Tests from previous patch show that it should fail anyway. It will be possible to properly return error once APCs are passed to server in register_async request. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b9f6f3896a
commit
57e93b72bb
|
@ -7792,18 +7792,12 @@ static int WS2_recv_base( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
||||||
iosb->u.Status = STATUS_PENDING;
|
iosb->u.Status = STATUS_PENDING;
|
||||||
iosb->Information = 0;
|
iosb->Information = 0;
|
||||||
|
|
||||||
SERVER_START_REQ( register_async )
|
if (wsa->completion_func)
|
||||||
{
|
err = register_async( ASYNC_TYPE_READ, wsa->hSocket, WS2_async_recv, wsa, NULL,
|
||||||
req->type = ASYNC_TYPE_READ;
|
ws2_async_apc, wsa, iosb );
|
||||||
req->async.handle = wine_server_obj_handle( wsa->hSocket );
|
else
|
||||||
req->async.callback = wine_server_client_ptr( WS2_async_recv );
|
err = register_async( ASYNC_TYPE_READ, wsa->hSocket, WS2_async_recv, wsa, lpOverlapped->hEvent,
|
||||||
req->async.iosb = wine_server_client_ptr( iosb );
|
NULL, (void *)cvalue, iosb );
|
||||||
req->async.arg = wine_server_client_ptr( wsa );
|
|
||||||
req->async.event = wine_server_obj_handle( lpCompletionRoutine ? 0 : lpOverlapped->hEvent );
|
|
||||||
req->async.cvalue = cvalue;
|
|
||||||
err = wine_server_call( req );
|
|
||||||
}
|
|
||||||
SERVER_END_REQ;
|
|
||||||
|
|
||||||
if (err != STATUS_PENDING) HeapFree( GetProcessHeap(), 0, wsa );
|
if (err != STATUS_PENDING) HeapFree( GetProcessHeap(), 0, wsa );
|
||||||
SetLastError(NtStatusToWSAError( err ));
|
SetLastError(NtStatusToWSAError( err ));
|
||||||
|
|
Loading…
Reference in New Issue