summaryrefslogtreecommitdiff
path: root/Ivy/IvyDllMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/IvyDllMain.cpp')
-rw-r--r--Ivy/IvyDllMain.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/Ivy/IvyDllMain.cpp b/Ivy/IvyDllMain.cpp
new file mode 100644
index 0000000..e8c13f4
--- /dev/null
+++ b/Ivy/IvyDllMain.cpp
@@ -0,0 +1,42 @@
+// libIvy.cpp : Defines the initialization routines for the DLL.
+//
+
+#include "IvyStdAfx.h"
+
+BOOL APIENTRY DllMain(HANDLE hInstance,
+ DWORD dwReason,
+ LPVOID lpReserved)
+{
+ // Remove this if you use lpReserved
+ UNREFERENCED_PARAMETER(lpReserved);
+
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ TRACE("IVY.DLL Initializing!\n");
+
+ // Extension DLL one-time initialization
+
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD( 2, 0 );
+
+ 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("IVY.DLL Terminating!\n");
+ // Terminate the library before destructors are called
+ WSACleanup();
+ }
+ return 1; // ok
+}