192 lines
3.6 KiB
C++
Executable File
192 lines
3.6 KiB
C++
Executable File
//
|
|
// AL200.CPP
|
|
//
|
|
// Source file for ArchiveLib 2.0
|
|
//
|
|
// Copyright (c) Greenleaf Software, Inc. 1994-1996
|
|
// All Rights Reserved
|
|
//
|
|
// CONTENTS
|
|
//
|
|
// LibMain()
|
|
// WEP()
|
|
//
|
|
// DESCRIPTION
|
|
//
|
|
// This file contains LibMain() and the WEP() for ArchiveLib DLLs.
|
|
// We don't really do anything exciting in the WEP, it is just
|
|
// here for decoration. LibMain() has to set up memory allocation
|
|
// for Borland.
|
|
//
|
|
// REVISION HISTORY
|
|
//
|
|
// May 20, 1994 1.0A : First release
|
|
//
|
|
// January 6, 1995 1.01A : Moved this file to cpp_all, we are now
|
|
// supporting DOS DLLs with PowerPack.
|
|
//
|
|
// February 14, 1996 2.0A : New release.
|
|
//
|
|
|
|
#include "arclib.h"
|
|
#if !defined( AL_IBM )
|
|
#pragma hdrstop
|
|
#endif
|
|
|
|
#if defined( AL_BUILDING_DLL ) && defined( AL_WINDOWS )
|
|
#define STRICT
|
|
#include <windows.h>
|
|
|
|
//
|
|
// NAME
|
|
//
|
|
// LibMain()
|
|
//
|
|
// PLATFORMS/ENVIRONMENTS
|
|
//
|
|
// Windows
|
|
// C++
|
|
//
|
|
// SHORT DESCRIPTION
|
|
//
|
|
// The DLL Entry point.
|
|
//
|
|
// C++ SYNOPSIS
|
|
//
|
|
// #include "arclib.h"
|
|
//
|
|
// int LibMain( HINSTANCE hInst,
|
|
// WORD wDS,
|
|
// WORD cbHeap,
|
|
// LPSTR lpCmdLine );
|
|
//
|
|
// C SYNOPSIS
|
|
//
|
|
// None.
|
|
//
|
|
// VB SYNOPSIS
|
|
//
|
|
// None.
|
|
//
|
|
// DELPHI SYNOPSIS
|
|
//
|
|
// None.
|
|
//
|
|
// ARGUMENTS
|
|
//
|
|
// hInst : Instance handle of the DLL. We don't use this.
|
|
//
|
|
// wDS : DS value for the DLL. We don't use this.
|
|
//
|
|
// cbHeap : Size of the local heap for the DLL. We don't use this.
|
|
//
|
|
// lpCmdLine : The command line used to start the DLL. We don't use this.
|
|
//
|
|
// DESCRIPTION
|
|
//
|
|
// The only time we need to do anything in the startup of a DLL is under
|
|
// Borland C++. By default, Borland DLLs allocate memory in non-shared
|
|
// mode, which means multiple processes can delete one-anothers memory
|
|
// when it has been served up out of the subsegment allocator. This
|
|
// fixes that problem.
|
|
//
|
|
// RETURNS
|
|
//
|
|
// Always returns 1;
|
|
//
|
|
// EXAMPLE
|
|
//
|
|
// SEE ALSO
|
|
//
|
|
// REVISION HISTORY
|
|
//
|
|
// November 13, 1995 2.00A : First release.
|
|
//
|
|
|
|
extern "C" int CALLBACK
|
|
LibMain( HINSTANCE, /* Tag internal function */
|
|
WORD,
|
|
WORD,
|
|
LPSTR )
|
|
{
|
|
//
|
|
// I believe that both Microsoft and Symantec take care of this
|
|
// detail for me. However, Borland 3.1 did not. Not sure about
|
|
// Borland 4.0
|
|
//
|
|
#if defined( AL_BORLAND ) && !defined( AL_FLAT_MODEL )
|
|
extern unsigned _WinAllocFlag;
|
|
_WinAllocFlag |= GMEM_SHARE;
|
|
#endif
|
|
return 1;
|
|
}
|
|
|
|
//
|
|
// NAME
|
|
//
|
|
// WEP()
|
|
//
|
|
// PLATFORMS/ENVIRONMENTS
|
|
//
|
|
// Windows
|
|
// C++
|
|
//
|
|
// SHORT DESCRIPTION
|
|
//
|
|
// The DLL exit procedure.
|
|
//
|
|
// C++ SYNOPSIS
|
|
//
|
|
// #include "arclib.h"
|
|
//
|
|
// int FAR PASCAL WEP( int nParameter );
|
|
//
|
|
// C SYNOPSIS
|
|
//
|
|
// None.
|
|
//
|
|
// VB SYNOPSIS
|
|
//
|
|
// None.
|
|
//
|
|
// DELPHI SYNOPSIS
|
|
//
|
|
// None.
|
|
//
|
|
// ARGUMENTS
|
|
//
|
|
// nParameter : A parameter that can be used to determine whether this
|
|
// DLL is being shut down, or whether all of Windows is
|
|
// being shut down. This WEP() ignores the parameter.
|
|
//
|
|
// DESCRIPTION
|
|
//
|
|
// We have no use for a WEP, and I'm not sure if it is even being called.
|
|
// WEP names are tricky.
|
|
//
|
|
// RETURNS
|
|
//
|
|
// Always returns 1
|
|
//
|
|
// EXAMPLE
|
|
//
|
|
// SEE ALSO
|
|
//
|
|
// REVISION HISTORY
|
|
//
|
|
// November 13, 1995 2.00A : First release.
|
|
//
|
|
|
|
#if defined( AL_BORLAND ) && ( AL_BORLAND >= 0x410 )
|
|
extern "C" int FAR PASCAL WEP(int) /* Tag internal function */
|
|
#else
|
|
extern "C" int FAR PASCAL _WEP(int)
|
|
#endif
|
|
{
|
|
/* Your WEP functionality goes here */
|
|
return 1;
|
|
}
|
|
|
|
#endif //#if defined( AL_BUILDING_DLL )
|
|
|