TIdStackWindows.WSSocket

Giganews Newsgroups
Subject: TIdStackWindows.WSSocket
Posted by:  Mattias Fagerlund (mattias@cambrianlabs.dontspamme.com)
Date: Mon, 5 Apr 2004

When I call WSSocket ( located in IdStackWindows ) I get an AV, because
windows can't find the routine WSASocket in my "WS2_32.DLL". However
WSASocketA and WSASocketW are present, and either one seems to work as a
replacement.

Is this a bug or am I doing something strange here?

function TIdStackWindows.WSSocket(AFamily, AStruct, AProtocol: Integer;
const AOverlapped: Boolean = False): TIdStackSocketHandle;
begin
  if AOverlapped then begin
    Result := WSASocketW(AFamily, AStruct,
AProtocol,nil,0,WSA_FLAG_OVERLAPPED);
    // Result := WSASocketA(AFamily, AStruct,
AProtocol,nil,0,WSA_FLAG_OVERLAPPED);
    // Result := WSASocket(AFamily, AStruct,
AProtocol,nil,0,WSA_FLAG_OVERLAPPED);
  end else begin
    Result := IdWinsock2.Socket(AFamily, AStruct, AProtocol);
  end;
end;

I run WindowsXP

with regards,
mattias

Replies