diff options
-rw-r--r-- | Bus/Ivy/IvyDllMain.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
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
}
|