summaryrefslogtreecommitdiff
path: root/Ivy
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy')
-rw-r--r--Ivy/IvyDllMain.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/Ivy/IvyDllMain.cpp b/Ivy/IvyDllMain.cpp
index ac1a854..c49283a 100644
--- a/Ivy/IvyDllMain.cpp
+++ b/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
}