summaryrefslogtreecommitdiff
path: root/Bus/Ivy/IvyDllMain.cpp
blob: a94616fd3983fc3976f577c1d76b860cf5ff729a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// libIvy.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.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, 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("IVY.DLL Terminating!\n");
		// Terminate the library before destructors are called
		WSACleanup();
	}
	return 1;   // ok
}