Blame src/lib/win_glue.c

Packit Service 99d1c0
#include "k5-int.h"
Packit Service 99d1c0
Packit Service 99d1c0
#ifdef KRB5
Packit Service 99d1c0
#include "krb5_err.h"
Packit Service 99d1c0
#include "kv5m_err.h"
Packit Service 99d1c0
#include "asn1_err.h"
Packit Service 99d1c0
#include "kdb5_err.h"
Packit Service 99d1c0
#include "profile.h"
Packit Service 99d1c0
extern void krb5_stdcc_shutdown();
Packit Service 99d1c0
#endif
Packit Service 99d1c0
#ifdef GSSAPI
Packit Service 99d1c0
#include "gssapi/generic/gssapi_err_generic.h"
Packit Service 99d1c0
#include "gssapi/krb5/gssapi_err_krb5.h"
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
Packit Service 99d1c0
/*
Packit Service 99d1c0
 * #defines for MIT-specific time-based timebombs and/or version
Packit Service 99d1c0
 * server for the Kerberos DLL.
Packit Service 99d1c0
 */
Packit Service 99d1c0
Packit Service 99d1c0
#ifdef SAP_TIMEBOMB
Packit Service 99d1c0
#define TIMEBOMB 865141200	/* 1-Jun-97 */
Packit Service 99d1c0
#define TIMEBOMB_PRODUCT "SAPGUI"
Packit Service 99d1c0
#define TIMEBOMB_WARN  15
Packit Service 99d1c0
#define TIMEBOMB_INFO "  Please see the web page at:\nhttp://web.mit.edu/reeng/www/saphelp for more information"
Packit Service 99d1c0
#define TIMEBOMB_ERROR KRB5_APPL_EXPIRED
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
#ifdef KRB_TIMEBOMB
Packit Service 99d1c0
#define TIMEBOMB 865141200	/* 1-Jun-97 */
Packit Service 99d1c0
#define TIMEBOMB_PRODUCT "Kerberos V5"
Packit Service 99d1c0
#define TIMEBOMB_WARN 15
Packit Service 99d1c0
#define TIMEBOMB_INFO "  Please see the web page at:\nhttp://web.mit.edu/reeng/www/saphelp for more information"
Packit Service 99d1c0
#define TIMEBOMB_ERROR KRB5_LIB_EXPIRED
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
/*
Packit Service 99d1c0
 * #defines for using MIT's version server DLL
Packit Service 99d1c0
 */
Packit Service 99d1c0
#ifdef SAP_VERSERV
Packit Service 99d1c0
#define APP_TITLE "KRB5-SAP"
Packit Service 99d1c0
#define APP_VER "3.0f"
Packit Service 99d1c0
#define APP_INI "krb5sap.ini"
Packit Service 99d1c0
#define VERSERV_ERROR 	KRB5_APPL_EXPIRED
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
#ifdef VERSERV
Packit Service 99d1c0
#define WINDOWS
Packit Service 99d1c0
#include <ver.h>
Packit Service 99d1c0
#include <vs.h>
Packit Service 99d1c0
#include <v.h>
Packit Service 99d1c0
Packit Service 99d1c0
Packit Service 99d1c0
/*
Packit Service 99d1c0
 * This function will get the version resource information from the
Packit Service 99d1c0
 * application using the DLL.  This allows us to Version Serve
Packit Service 99d1c0
 * arbitrary third party applications.  If there is an error, or we
Packit Service 99d1c0
 * decide that we should not version check the calling application
Packit Service 99d1c0
 * then VSflag will be FALSE when the function returns.
Packit Service 99d1c0
 *
Packit Service 99d1c0
 * The buffers passed into this function must be at least
Packit Service 99d1c0
 * APPVERINFO_SIZE bytes long.
Packit Service 99d1c0
 */
Packit Service 99d1c0
Packit Service 99d1c0
#define APPVERINFO_SIZE 256
Packit Service 99d1c0
Packit Service 99d1c0
void GetCallingAppVerInfo( char *AppTitle, char *AppVer, char *AppIni,
Packit Service 99d1c0
			  BOOL *VSflag)
Packit Service 99d1c0
{
Packit Service 99d1c0
	char CallerFilename[_MAX_PATH];
Packit Service 99d1c0
	LONG *lpLangInfo;
Packit Service 99d1c0
	DWORD hVersionInfoID, size;
Packit Service 99d1c0
	GLOBALHANDLE hVersionInfo;
Packit Service 99d1c0
	LPSTR lpVersionInfo;
Packit Service 99d1c0
	int dumint, retval;
Packit Service 99d1c0
	char *cp;
Packit Service 99d1c0
	char *revAppTitle;
Packit Service 99d1c0
	char szVerQ[90];
Packit Service 99d1c0
	LPBYTE locAppTitle;
Packit Service 99d1c0
	LPBYTE locAppVer;
Packit Service 99d1c0
	char locAppIni[_MAX_PATH];
Packit Service 99d1c0
#ifndef _WIN32
Packit Service 99d1c0
	WORD wStackSeg;
Packit Service 99d1c0
#endif /* !_WIN32 */
Packit Service 99d1c0
Packit Service 99d1c0
	/* first we need to get the calling module's filename */
Packit Service 99d1c0
#ifndef _WIN32
Packit Service 99d1c0
	_asm {
Packit Service 99d1c0
		mov wStackSeg, ss
Packit Service 99d1c0
	};
Packit Service 99d1c0
	retval = GetModuleFileName((HMODULE)wStackSeg, CallerFilename,
Packit Service 99d1c0
		_MAX_PATH);
Packit Service 99d1c0
#else
Packit Service 99d1c0
	/*
Packit Service 99d1c0
	 * Note: this may only work for single threaded applications,
Packit Service 99d1c0
	 * we'll live and learn ...
Packit Service 99d1c0
	 */
Packit Service 99d1c0
        retval = GetModuleFileName( NULL, CallerFilename, _MAX_PATH);
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
	if ( retval == 0 ) {
Packit Service 99d1c0
		VSflag = FALSE;
Packit Service 99d1c0
		return;
Packit Service 99d1c0
	}
Packit Service 99d1c0
Packit Service 99d1c0
	size = GetFileVersionInfoSize( CallerFilename, &hVersionInfoID);
Packit Service 99d1c0
Packit Service 99d1c0
	if( size == 0 ) {
Packit Service 99d1c0
		/*
Packit Service 99d1c0
		 * hey , I bet we don't have a version resource, let's
Packit Service 99d1c0
		 * punt
Packit Service 99d1c0
		 */
Packit Service 99d1c0
		*VSflag = FALSE;
Packit Service 99d1c0
		return;
Packit Service 99d1c0
	}
Packit Service 99d1c0
Packit Service 99d1c0
	hVersionInfo = GlobalAlloc(GHND, size);
Packit Service 99d1c0
	lpVersionInfo = GlobalLock(hVersionInfo);
Packit Service 99d1c0
Packit Service 99d1c0
	retval = GetFileVersionInfo( CallerFilename, hVersionInfoID, size,
Packit Service 99d1c0
				    lpVersionInfo);
Packit Service 99d1c0
Packit Service 99d1c0
	retval = VerQueryValue(lpVersionInfo, "\\VarFileInfo\\Translation",
Packit Service 99d1c0
			       (LPSTR *)&lpLangInfo, &dumint);
Packit Service 99d1c0
	wsprintf(szVerQ,
Packit Service 99d1c0
		 "\\StringFileInfo\\%04x%04x\\",
Packit Service 99d1c0
		 LOWORD(*lpLangInfo), HIWORD(*lpLangInfo));
Packit Service 99d1c0
Packit Service 99d1c0
	cp = szVerQ + lstrlen(szVerQ);
Packit Service 99d1c0
Packit Service 99d1c0
	lstrcpy(cp, "ProductName");
Packit Service 99d1c0
Packit Service 99d1c0
Packit Service 99d1c0
	/* try a localAppTitle and then a strcpy 4/2/97 */
Packit Service 99d1c0
Packit Service 99d1c0
	locAppTitle = 0;
Packit Service 99d1c0
	locAppVer = 0;
Packit Service 99d1c0
Packit Service 99d1c0
	retval = VerQueryValue(lpVersionInfo, szVerQ, &locAppTitle,
Packit Service 99d1c0
			       &dumint);
Packit Service 99d1c0
Packit Service 99d1c0
	lstrcpy(cp, "ProductVersion");
Packit Service 99d1c0
Packit Service 99d1c0
Packit Service 99d1c0
	retval = VerQueryValue(lpVersionInfo, szVerQ, &locAppVer,
Packit Service 99d1c0
			       &dumint);
Packit Service 99d1c0
Packit Service 99d1c0
	if (!locAppTitle || !locAppVer) {
Packit Service 99d1c0
	  	/* Punt, we don't have the right version resource records */
Packit Service 99d1c0
		*VSflag = FALSE;
Packit Service 99d1c0
		return;
Packit Service 99d1c0
	}
Packit Service 99d1c0
Packit Service 99d1c0
	/*
Packit Service 99d1c0
	 * We don't have a way to determine that INI file of the
Packit Service 99d1c0
	 * application at the moment so let's just use krb5.ini
Packit Service 99d1c0
	 */
Packit Service 99d1c0
	strncpy( locAppIni, KERBEROS_INI, sizeof(locAppIni) - 1 );
Packit Service 99d1c0
	locAppIni[ sizeof(locAppIni) - 1 ] = '\0';
Packit Service 99d1c0
Packit Service 99d1c0
	strncpy( AppTitle, locAppTitle, APPVERINFO_SIZE);
Packit Service 99d1c0
	AppTitle[APPVERINFO_SIZE - 1] = '\0';
Packit Service 99d1c0
	strncpy( AppVer, locAppVer, APPVERINFO_SIZE);
Packit Service 99d1c0
	AppVer[APPVERINFO_SIZE - 1] = '\0';
Packit Service 99d1c0
	strncpy( AppIni, locAppIni, APPVERINFO_SIZE);
Packit Service 99d1c0
	AppIni[APPVERINFO_SIZE - 1] = '\0';
Packit Service 99d1c0
Packit Service 99d1c0
	/*
Packit Service 99d1c0
	 * We also need to determine if we want to suppress version
Packit Service 99d1c0
	 * checking of this application.  Does the tail of the
Packit Service 99d1c0
	 * AppTitle end in a "-v" ?
Packit Service 99d1c0
	 */
Packit Service 99d1c0
	revAppTitle = _strrev( _strdup(AppTitle));
Packit Service 99d1c0
	if( revAppTitle[0] == 'v' || revAppTitle[0] == 'V'  &&
Packit Service 99d1c0
	   revAppTitle[1] == '-' ) {
Packit Service 99d1c0
		VSflag = FALSE;
Packit Service 99d1c0
	}
Packit Service 99d1c0
	return;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
Packit Service 99d1c0
/*
Packit Service 99d1c0
 * Use the version server to give us some control on distribution and usage
Packit Service 99d1c0
 * We're going to test track as well
Packit Service 99d1c0
 */
Packit Service 99d1c0
static int CallVersionServer(app_title, app_version, app_ini, code_cover)
Packit Service 99d1c0
	char *app_title;
Packit Service 99d1c0
	char *app_version;
Packit Service 99d1c0
	char *app_ini;
Packit Service 99d1c0
	char *code_cover;
Packit Service 99d1c0
{
Packit Service 99d1c0
	VS_Request vrequest;
Packit Service 99d1c0
	VS_Status  vstatus;
Packit Service 99d1c0
Packit Service 99d1c0
	SetCursor(LoadCursor(NULL, IDC_WAIT));
Packit Service 99d1c0
Packit Service 99d1c0
	/*
Packit Service 99d1c0
	 * We should be able to pass in code_cover below, but things
Packit Service 99d1c0
	 * are breaking under Windows 16 for no good reason.
Packit Service 99d1c0
	 */
Packit Service 99d1c0
	vrequest = VSFormRequest((LPSTR) app_title, (LPSTR) app_version,
Packit Service 99d1c0
				 (LPSTR) app_ini,
Packit Service 99d1c0
				 NULL /* code_cover */, NULL,
Packit Service 99d1c0
				 V_CHECK_AND_LOG);
Packit Service 99d1c0
Packit Service 99d1c0
	SetCursor(LoadCursor(NULL, IDC_ARROW));
Packit Service 99d1c0
	/*
Packit Service 99d1c0
	 * If the user presses cancel when registering the test
Packit Service 99d1c0
	 * tracker, we'll let them continue.
Packit Service 99d1c0
	 */
Packit Service 99d1c0
	if (ReqStatus(vrequest) == V_E_CANCEL) {
Packit Service 99d1c0
		VSDestroyRequest(vrequest);
Packit Service 99d1c0
		return 0;
Packit Service 99d1c0
	}
Packit Service 99d1c0
	vstatus = VSProcessRequest(vrequest);
Packit Service 99d1c0
	/*
Packit Service 99d1c0
	 * Only complain periodically, if the test tracker isn't
Packit Service 99d1c0
	 * working...
Packit Service 99d1c0
	 */
Packit Service 99d1c0
	if (v_complain(vstatus, app_ini)) {
Packit Service 99d1c0
		WinVSReportRequest(vrequest, NULL,
Packit Service 99d1c0
				   "Version Server Status Report");
Packit Service 99d1c0
	}
Packit Service 99d1c0
	if (vstatus == V_REQUIRED) {
Packit Service 99d1c0
		SetCursor(LoadCursor(NULL, IDC_WAIT));
Packit Service 99d1c0
		VSDestroyRequest(vrequest);
Packit Service 99d1c0
		return( -1 );
Packit Service 99d1c0
	}
Packit Service 99d1c0
	VSDestroyRequest(vrequest);
Packit Service 99d1c0
	return (0);
Packit Service 99d1c0
}
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
#ifdef TIMEBOMB
Packit Service 99d1c0
static krb5_error_code do_timebomb()
Packit Service 99d1c0
{
Packit Service 99d1c0
	char buf[1024];
Packit Service 99d1c0
	long timeleft;
Packit Service 99d1c0
	static first_time = 1;
Packit Service 99d1c0
Packit Service 99d1c0
	timeleft = TIMEBOMB - time(0);
Packit Service 99d1c0
	if (timeleft <= 0) {
Packit Service 99d1c0
		if (first_time) {
Packit Service 99d1c0
			sprintf(buf, "Your version of %s has expired.\n",
Packit Service 99d1c0
				TIMEBOMB_PRODUCT);
Packit Service 99d1c0
			buf[sizeof(buf) - 1] = '\0';
Packit Service 99d1c0
			strncat(buf, "Please upgrade it.", sizeof(buf) - 1 - strlen(buf));
Packit Service 99d1c0
#ifdef TIMEBOMB_INFO
Packit Service 99d1c0
			strncat(buf, TIMEBOMB_INFO, sizeof(buf) - 1 - strlen(buf));
Packit Service 99d1c0
#endif
Packit Service 99d1c0
			MessageBox(NULL, buf, "", MB_OK);
Packit Service 99d1c0
			first_time = 0;
Packit Service 99d1c0
		}
Packit Service 99d1c0
		return TIMEBOMB_ERROR;
Packit Service 99d1c0
	}
Packit Service 99d1c0
	timeleft = timeleft / ((long) 60*60*24);
Packit Service 99d1c0
	if (timeleft < TIMEBOMB_WARN) {
Packit Service 99d1c0
		if (first_time) {
Packit Service 99d1c0
			sprintf(buf, "Your version of %s will expire in %ld days.\n",
Packit Service 99d1c0
				TIMEBOMB_PRODUCT, timeleft);
Packit Service 99d1c0
			strncat(buf, "Please upgrade it soon.", sizeof(buf) - 1 - strlen(buf));
Packit Service 99d1c0
#ifdef TIMEBOMB_INFO
Packit Service 99d1c0
			strncat(buf, TIMEBOMB_INFO, sizeof(buf) - 1 - strlen(buf));
Packit Service 99d1c0
#endif
Packit Service 99d1c0
			MessageBox(NULL, buf, "", MB_OK);
Packit Service 99d1c0
			first_time = 0;
Packit Service 99d1c0
		}
Packit Service 99d1c0
	}
Packit Service 99d1c0
	return 0;
Packit Service 99d1c0
}
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
/*
Packit Service 99d1c0
 * This was originally called from LibMain; unfortunately, Windows 3.1
Packit Service 99d1c0
 * doesn't allow you to make messaging calls from LibMain.  So, we now
Packit Service 99d1c0
 * do the timebomb/version server stuff from krb5_init_context().
Packit Service 99d1c0
 */
Packit Service 99d1c0
krb5_error_code krb5_vercheck()
Packit Service 99d1c0
{
Packit Service 99d1c0
	static int verchecked = 0;
Packit Service 99d1c0
	if (verchecked)
Packit Service 99d1c0
		return 0;
Packit Service 99d1c0
#ifdef TIMEBOMB
Packit Service 99d1c0
	krb5_error_code retval = do_timebomb();
Packit Service 99d1c0
	if (retval)
Packit Service 99d1c0
		return retval;
Packit Service 99d1c0
#endif
Packit Service 99d1c0
#ifdef VERSERV
Packit Service 99d1c0
	{
Packit Service 99d1c0
#ifdef APP_TITLE
Packit Service 99d1c0
		if (CallVersionServer(APP_TITLE, APP_VER, APP_INI, NULL))
Packit Service 99d1c0
			return VERSERV_ERROR;
Packit Service 99d1c0
#else
Packit Service 99d1c0
		char AppTitle[APPVERINFO_SIZE];
Packit Service 99d1c0
		char AppVer[APPVERINFO_SIZE];
Packit Service 99d1c0
		char AppIni[APPVERINFO_SIZE];
Packit Service 99d1c0
		BOOL VSflag=TRUE;
Packit Service 99d1c0
Packit Service 99d1c0
		GetCallingAppVerInfo( AppTitle, AppVer, AppIni, &VSflag);
Packit Service 99d1c0
Packit Service 99d1c0
		if (VSflag) {
Packit Service 99d1c0
			if (CallVersionServer(AppTitle, AppVer, AppIni, NULL))
Packit Service 99d1c0
				return KRB5_APPL_EXPIRED;
Packit Service 99d1c0
		}
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
	}
Packit Service 99d1c0
#endif
Packit Service 99d1c0
        verchecked = 1;
Packit Service 99d1c0
	return 0;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
Packit Service 99d1c0
static HINSTANCE hlibinstance;
Packit Service 99d1c0
Packit Service 99d1c0
HINSTANCE get_lib_instance()
Packit Service 99d1c0
{
Packit Service 99d1c0
    return hlibinstance;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
#define DLL_STARTUP 0
Packit Service 99d1c0
#define DLL_SHUTDOWN 1
Packit Service 99d1c0
Packit Service 99d1c0
static int
Packit Service 99d1c0
control(int mode)
Packit Service 99d1c0
{
Packit Service 99d1c0
    switch(mode) {
Packit Service 99d1c0
    case DLL_STARTUP:
Packit Service 99d1c0
	break;
Packit Service 99d1c0
Packit Service 99d1c0
    case DLL_SHUTDOWN:
Packit Service 99d1c0
#ifdef KRB5
Packit Service 99d1c0
	krb5_stdcc_shutdown();
Packit Service 99d1c0
#endif
Packit Service 99d1c0
	break;
Packit Service 99d1c0
Packit Service 99d1c0
#if defined(ENABLE_THREADS) && defined(SUPPORTLIB)
Packit Service 99d1c0
    case DLL_THREAD_DETACH:
Packit Service 99d1c0
	krb5int_thread_detach_hook();
Packit Service 99d1c0
	return 0;
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
    default:
Packit Service 99d1c0
	return -1;
Packit Service 99d1c0
    }
Packit Service 99d1c0
Packit Service 99d1c0
#if defined KRB5
Packit Service 99d1c0
    switch (mode) {
Packit Service 99d1c0
    case DLL_STARTUP:
Packit Service 99d1c0
	profile_library_initializer__auxinit();
Packit Service 99d1c0
	cryptoint_initialize_library__auxinit();
Packit Service 99d1c0
	krb5int_lib_init__auxinit();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    case DLL_SHUTDOWN:
Packit Service 99d1c0
	krb5int_lib_fini();
Packit Service 99d1c0
	cryptoint_cleanup_library();
Packit Service 99d1c0
	profile_library_finalizer();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    }
Packit Service 99d1c0
#elif defined GSSAPI
Packit Service 99d1c0
    switch (mode) {
Packit Service 99d1c0
    case DLL_STARTUP:
Packit Service 99d1c0
	gssint_mechglue_init__auxinit();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    case DLL_SHUTDOWN:
Packit Service 99d1c0
	gssint_mechglue_fini();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    }
Packit Service 99d1c0
#elif defined COMERR
Packit Service 99d1c0
    switch (mode) {
Packit Service 99d1c0
    case DLL_STARTUP:
Packit Service 99d1c0
	com_err_initialize__auxinit();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    case DLL_SHUTDOWN:
Packit Service 99d1c0
	com_err_terminate();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    }
Packit Service 99d1c0
#elif defined PROFILELIB
Packit Service 99d1c0
    switch (mode) {
Packit Service 99d1c0
    case DLL_STARTUP:
Packit Service 99d1c0
	profile_library_initializer__auxinit();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    case DLL_SHUTDOWN:
Packit Service 99d1c0
	profile_library_finalizer();
Packit Service 99d1c0
	break;
Packit Service 99d1c0
    }
Packit Service 99d1c0
#elif defined SUPPORTLIB
Packit Service 99d1c0
    switch (mode) {
Packit Service 99d1c0
    case DLL_STARTUP:
Packit Service 99d1c0
      krb5int_thread_support_init__auxinit();
Packit Service 99d1c0
      break;
Packit Service 99d1c0
    case DLL_SHUTDOWN:
Packit Service 99d1c0
      krb5int_thread_support_fini();
Packit Service 99d1c0
      break;
Packit Service 99d1c0
    }
Packit Service 99d1c0
#else
Packit Service 99d1c0
# error "Don't know the init/fini functions for this library."
Packit Service 99d1c0
#endif
Packit Service 99d1c0
Packit Service 99d1c0
    return 0;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
#ifdef _WIN32
Packit Service 99d1c0
Packit Service 99d1c0
BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
Packit Service 99d1c0
{
Packit Service 99d1c0
    switch (fdwReason)
Packit Service 99d1c0
    {
Packit Service 99d1c0
        case DLL_PROCESS_ATTACH:
Packit Service 99d1c0
	    hlibinstance = (HINSTANCE) hModule;
Packit Service 99d1c0
	    if (control(DLL_STARTUP))
Packit Service 99d1c0
		return FALSE;
Packit Service 99d1c0
	    break;
Packit Service 99d1c0
Packit Service 99d1c0
        case DLL_THREAD_ATTACH:
Packit Service 99d1c0
	    break;
Packit Service 99d1c0
Packit Service 99d1c0
        case DLL_THREAD_DETACH:
Packit Service 99d1c0
	    if (control(DLL_THREAD_DETACH))
Packit Service 99d1c0
		return FALSE;
Packit Service 99d1c0
	    break;
Packit Service 99d1c0
Packit Service 99d1c0
        case DLL_PROCESS_DETACH:
Packit Service 99d1c0
	    if (control(DLL_SHUTDOWN))
Packit Service 99d1c0
		return FALSE;
Packit Service 99d1c0
	    break;
Packit Service 99d1c0
Packit Service 99d1c0
        default:
Packit Service 99d1c0
	    return FALSE;
Packit Service 99d1c0
    }
Packit Service 99d1c0
Packit Service 99d1c0
    return TRUE;   // successful DLL_PROCESS_ATTACH
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
#else
Packit Service 99d1c0
Packit Service 99d1c0
BOOL CALLBACK
Packit Service 99d1c0
LibMain (hInst, wDataSeg, cbHeap, CmdLine)
Packit Service 99d1c0
HINSTANCE hInst;
Packit Service 99d1c0
WORD wDataSeg;
Packit Service 99d1c0
WORD cbHeap;
Packit Service 99d1c0
LPSTR CmdLine;
Packit Service 99d1c0
{
Packit Service 99d1c0
    hlibinstance = hInst;
Packit Service 99d1c0
    if (control(DLL_STARTUP))
Packit Service 99d1c0
	return 0;
Packit Service 99d1c0
    else
Packit Service 99d1c0
	return 1;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
int CALLBACK __export
Packit Service 99d1c0
WEP(nParam)
Packit Service 99d1c0
	int nParam;
Packit Service 99d1c0
{
Packit Service 99d1c0
    if (control(DLL_SHUTDOWN))
Packit Service 99d1c0
	return 0;
Packit Service 99d1c0
    else
Packit Service 99d1c0
	return 1;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
#endif