LAN Web TCP Delphi

Title: How to check if Winsock is enabled
uses
Winsock;
function WinsockEnabled: Boolean;
var
wsaData: TWSAData;
begin
Result := True;
case Winsock.WSAStartup($0101, wsaData) of
WSAEINVAL, WSASYSNOTREADY, WSAVERNOTSUPPORTED: Result := False;
else
Winsock.WSACleanup;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if WinsockEnabled then
ShowMessage('Winsock is enabled')
else
ShowMessage('Winsock is disabled');
end;