I created a socket using WskSocket as follow:
WskSocket(
Client,
AF_INET,
SOCK_DGRAM,
IPPROTO_UDP,
WSK_FLAG_DATAGRAM_SOCKET,
Context,
&ClientDatagramDispatch,
NULL,
NULL,
NULL,
irp );
The operation completed successfully and I got back the PWSK_SOCKET pointer from irp->IoStatus.Information.
I tried to get and set the SO_RCVBUF option using WskControlSocket as follow:
WskControlSocket(
Socket,
WskGetOption,
SO_RCVBUF,
SOL_SOCKET,
0,
NULL,
sizeof( ULONG ),
&ReceiveBufferSize,
NULL,
irp);
The return status for WskControlSocket was 0xC000000D, STATUS_INVALID_PARAMETER. The WDK documentation said option SO_RCVBUF is supported for datagram socket, but I have not been able to successfully get or set this option.
I also tried to bind the created socket and enabled event callback for this socket before querying SO_RCVBUF option but the end result was still the same.
Any suggestions would really be appreciated.