/* **************************************************************************

  %name: _dllmain.c %
  %version: 3 %
  %date_modified: Thu Feb  5 19:47:51 1998 %
 
  Copyright (c) 1997 Novell, Inc.  All Rights Reserved.

  THIS WORK IS AN UNPUBLISHED WORK AND CONTAINS CONFIDENTIAL PROPRIETARY
  AND TRADE SECRET INFORMATION OF NOVELL, INC. ACCESS  TO  THIS  WORK IS
  RESTRICTED TO (I) NOVELL, INC.  EMPLOYEES WHO HAVE A NEED TO  KNOW HOW
  TO  PERFORM  TASKS WITHIN  THE SCOPE  OF  THEIR   ASSIGNMENTS AND (II)
  ENTITIES OTHER  THAN  NOVELL, INC.  WHO  HAVE ENTERED INTO APPROPRIATE
  LICENSE   AGREEMENTS.  NO  PART  OF  THIS WORK MAY BE USED, PRACTICED,
  PERFORMED COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED, ABRIDGED,
  CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED,  RECAST, TRANSFORMED
  OR ADAPTED  WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, INC.  ANY USE
  OR EXPLOITATION  OF  THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT THE
  PERPETRATOR  TO CRIMINAL AND CIVIL LIABILITY.

****************************************************************************/

#include <windows.h>
#include <stdio.h>
#include "jncp.h"
#include "JNIString.h"
#include "netJNI.h"
#include "CLXJNI.h"
#include "xjni.h"

static char *productStr = JNCP_PRODUCT_STRING;
static char *versionStr = JNCP_VERSION_STRING;
static char *copyrightStr = JNCP_COPYRIGHT_STRING;

/*
BOOL WINAPI _MainInit() //These functions call LoadLibrary which is not safe to call from DllMain
{
   __InitNWCalls();
   __InitNativeUnicode();
   __InitSkadsFunctions();
   __InitCLXJNI();
}
   
BOOL WINAPI _MainCleanup() //These functions call FreeLibrary which is not safe to call from DllMain
{
   __CleanupCLXJNI();
   __CleanupNativeUnicode();
   __CleanupNWCalls();
   __CleanupSkadsFunctions();
}
*/

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD reason, HANDLE unused)
{
   switch (reason)
   {
      case DLL_PROCESS_ATTACH:
         __InitNWCalls();
         __InitNativeUnicode();
         __InitSkadsFunctions();
         __InitCLXJNI();
         __InitNASAndExFunctions();
         break;

      case DLL_PROCESS_DETACH:
         __CleanupNASAndExFunctions();
         __CleanupCLXJNI();
         __CleanupNativeUnicode();
         __CleanupNWCalls();
         __CleanupSkadsFunctions();
         break;
   }

   return (TRUE);
}

