WSAStartup()?

#3
On Wed, 02 Mar 2011 22:14:10 -0500, you wrote:

|---Quote (Originally by vefatica)---
|Do plugins need to call WSAStartup()? It would seem not, since I can call winsock functions without it. Can I rely on that?
|---End Quote---
|
|I certainly wouldn't rely on it. TCC doesn't call WSAStartup, so if you want to use an API that needs it, you'll have to do it yourself.

Hmmm! I have a plugin which successfully calls gethostbyname() without first
calling WSAStartup(). Could it be that IPWorks is starting up Winsock (and
leaving it started)?
 

rconn

Administrator
Staff member
May 14, 2008
10,533
94
#4
Hmmm! I have a plugin which successfully calls gethostbyname() without first calling WSAStartup(). Could it be that IPWorks is starting up Winsock (and leaving it started)?
I have no idea. But you'd have to be crazy to rely on undocumented behavior by unknown third-party dll's! (And besides, it wouldn't work in TCC/LE, which doesn't load IPWorks.)