/*
|
/*
|
* dllEntryPoint.c --
|
* dllEntryPoint.c --
|
*
|
*
|
* This file implements the Dll entry point as needed by Windows.
|
* This file implements the Dll entry point as needed by Windows.
|
*/
|
*/
|
|
|
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
#include <windows.h>
|
#include <windows.h>
|
#include <tcl.h>
|
#include <tcl.h>
|
|
|
/* CYGNUS LOCAL */
|
/* CYGNUS LOCAL */
|
#ifdef __CYGWIN32__
|
#ifdef __CYGWIN32__
|
/*
|
/*
|
* The following declaration is for the VC++ DLL entry point.
|
* The following declaration is for the VC++ DLL entry point.
|
*/
|
*/
|
|
|
BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
|
BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
|
DWORD reason, LPVOID reserved));
|
DWORD reason, LPVOID reserved));
|
|
|
/* cygwin32 requires an impure pointer variable, which must be
|
/* cygwin32 requires an impure pointer variable, which must be
|
explicitly initialized when the DLL starts up. */
|
explicitly initialized when the DLL starts up. */
|
struct _reent *_impure_ptr;
|
struct _reent *_impure_ptr;
|
extern struct _reent *_imp__reent_data;
|
extern struct _reent *_imp__reent_data;
|
|
|
/*
|
/*
|
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
*
|
*
|
* DllMain --
|
* DllMain --
|
*
|
*
|
* DLL entry point.
|
* DLL entry point.
|
*
|
*
|
* Results:
|
* Results:
|
* TRUE on sucess, FALSE on failure.
|
* TRUE on sucess, FALSE on failure.
|
*
|
*
|
* Side effects:
|
* Side effects:
|
* None.
|
* None.
|
*
|
*
|
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
*/
|
*/
|
|
|
BOOL APIENTRY
|
BOOL APIENTRY
|
DllMain(hInstance, reason, reserved)
|
DllMain(hInstance, reason, reserved)
|
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
DWORD reason;
|
DWORD reason;
|
LPVOID reserved;
|
LPVOID reserved;
|
{
|
{
|
/* CYGNUS LOCAL */
|
/* CYGNUS LOCAL */
|
/* cygwin32 requires the impure data pointer to be initialized
|
/* cygwin32 requires the impure data pointer to be initialized
|
when the DLL starts up. */
|
when the DLL starts up. */
|
_impure_ptr = _imp__reent_data;
|
_impure_ptr = _imp__reent_data;
|
/* END CYGNUS LOCAL */
|
/* END CYGNUS LOCAL */
|
|
|
return(TRUE);
|
return(TRUE);
|
}
|
}
|
|
|
/* END CYGNUS LOCAL */
|
/* END CYGNUS LOCAL */
|
#else /* __CYGWIN32__ */
|
#else /* __CYGWIN32__ */
|
|
|
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
# define DllEntryPoint DllMain
|
# define DllEntryPoint DllMain
|
#endif
|
#endif
|
|
|
/*
|
/*
|
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
*
|
*
|
* DllEntryPoint --
|
* DllEntryPoint --
|
*
|
*
|
* This wrapper function is used by Windows to invoke the
|
* This wrapper function is used by Windows to invoke the
|
* initialization code for the DLL. If we are compiling
|
* initialization code for the DLL. If we are compiling
|
* with Visual C++, this routine will be renamed to DllMain.
|
* with Visual C++, this routine will be renamed to DllMain.
|
*
|
*
|
* Results:
|
* Results:
|
* Returns TRUE;
|
* Returns TRUE;
|
*
|
*
|
* Side effects:
|
* Side effects:
|
* None.
|
* None.
|
*
|
*
|
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
*/
|
*/
|
|
|
BOOL APIENTRY
|
BOOL APIENTRY
|
DllEntryPoint(hInst, reason, reserved)
|
DllEntryPoint(hInst, reason, reserved)
|
HINSTANCE hInst; /* Library instance handle. */
|
HINSTANCE hInst; /* Library instance handle. */
|
DWORD reason; /* Reason this function is being called. */
|
DWORD reason; /* Reason this function is being called. */
|
LPVOID reserved; /* Not used. */
|
LPVOID reserved; /* Not used. */
|
{
|
{
|
return TRUE;
|
return TRUE;
|
}
|
}
|
|
|
#endif
|
#endif
|
|
|