Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Apr : Correct Prototypes for winsock connect

www.cryer.info
Managed Newsgroup Archive

Correct Prototypes for winsock connect

Subject:Correct Prototypes for winsock connect
Posted by:"Mike Collins" (i..@thebottomofthepost)
Date:Thu, 10 Apr 2008 04:20:58

Hi all,

I'm doing some api hooking using madshi's madCodeHook.  I've reciently
started to have issues with a previously stable hook - winsock connect()

This got me looking at the prototype for connect(). This throw up issues
because i have now found 3 different prototypes and I've no idea which one
is correct.

I got my prototypes from i) Delphi 7 winsock.pas, ii) Jedi IdWinSock.pas
iii) Tome Tomes of Delphi - Basic 32-bit Programming.

So far this is what i have:

Tomes -> connect(s : TSocket; name : PSockAddr; namelen : integer) :
integer; stdcall

Jedi -> connect(const s : TSocket; const name : PSockAddr; const namelen :
integer) : integer; stdcall

Delphi 7 winsock.pas -> connect(s : TSocket; var : TSockAddr; namelen :
integer) : integer; stdcall

- where TSockAddr is the sockaddr_in structure and PSockAddr is a pointer to
sockaddr_in.

I'm not a delphi expert - i'm used to BCB but there were issues with using
madCodeHook in BCB DLL's so i had to use Delphi.  Can anyone shed any light
on this?

Many thanks,

Mike C

Replies:

www.cryer.info
Managed Newsgroup Archive