xref: /reactos/drivers/network/tcpip/tcpip/cinfo.c (revision c2c66aff)
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS TCP/IP protocol driver
4  * FILE:        tcpip/cinfo.c
5  * PURPOSE:     Per-socket connection information.
6  * PROGRAMMER:  Jérôme Gardou
7  */
8 
9 #include "precomp.h"
10 
SetConnectionInfo(TDIObjectID * ID,PCONNECTION_ENDPOINT Connection,PVOID Buffer,UINT BufferSize)11 TDI_STATUS SetConnectionInfo(TDIObjectID *ID,
12                              PCONNECTION_ENDPOINT Connection,
13                              PVOID Buffer,
14                              UINT BufferSize)
15 {
16     ASSERT(ID->toi_type == INFO_TYPE_CONNECTION);
17     switch (ID->toi_id)
18     {
19         case TCP_SOCKET_NODELAY:
20         {
21             BOOLEAN Set;
22             if (BufferSize < sizeof(BOOLEAN))
23                 return TDI_INVALID_PARAMETER;
24             Set = *(BOOLEAN*)Buffer;
25             return TCPSetNoDelay(Connection, Set);
26         }
27         default:
28             DbgPrint("TCPIP: Unknown connection info ID: %u.\n", ID->toi_id);
29     }
30 
31     return TDI_INVALID_PARAMETER;
32 }
33