On windows 7 (.Net 4.6.1) I am getting exception with this code:
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.IOControl(-1744830448, new byte[4] { 1, 0, 0, 0 }, null);
The attempted operation is not supported for the type of object referenced at System.Net.Sockets.Socket.IOControl(Int32 ioControlCode, Byte[] optionInValue, Byte[] optionOutValue)
This works fine with Windows 8 on my VM.
Using SIO_LOOPBACK_FAST_PATH = -1744830448 with IOControl method is not supported by Windows 7, so an exception will occur.
From the MSDN documentation for SIO_LOOPBACK_FAST_PATH:
The attempted operation is not supported for the type of object referenced. This error is returned if the specified IOCTL command is not supported. This error is returned if the SIO_LOOPBACK_FAST_PATH IOCTL is used on Windows 7, Windows Server 2008 R2, and earlier versions.
This error is also returned if the SIO_LOOPBACK_FAST_PATH IOCTL is not supported by the transport provider.