From 409394e3680053ea329d162f800042e719f66b3a Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:55 +0000 Subject: Utilisateur : Fcolin Date : 16/06/00 Heure : 10:40 Archivé dans $/Ivy Commentaire: Init dll socket dans DLLMain (vss 2) --- Bus/Ivy/IvyDllMain.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Bus/Ivy/IvyDllMain.cpp') diff --git a/Bus/Ivy/IvyDllMain.cpp b/Bus/Ivy/IvyDllMain.cpp index ac1a854..c49283a 100644 --- a/Bus/Ivy/IvyDllMain.cpp +++ b/Bus/Ivy/IvyDllMain.cpp @@ -12,18 +12,31 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) if (dwReason == DLL_PROCESS_ATTACH) { - TRACE("LIBIVY.DLL Initializing!\n"); + TRACE("IVY.DLL Initializing!\n"); // Extension DLL one-time initialization - //if (WSAInit) - // return 0; + + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD( 2, 2 ); + + err = WSAStartup( wVersionRequested, &wsaData ); + if ( err != 0 ) { + /* Tell the user that we could not find a usable */ + /* WinSock DLL. */ + return 0; + } + } else if (dwReason == DLL_PROCESS_DETACH) { - TRACE("LIBIVY.DLL Terminating!\n"); + TRACE("IVY.DLL Terminating!\n"); // Terminate the library before destructors are called + WSACleanup(); } return 1; // ok } -- cgit v1.1