/*********************************************************************** * * Copyright (C) 2006 Novell, Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; version 2.1 * of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, Novell, Inc. * * To contact Novell about this file by physical or electronic mail, * you may find current contact information at www.novell.com. * * Author: Juan Carlos Luciani * ***********************************************************************/ //===[ Include files ]===================================================== #include "internal.h" //===[ External data ]===================================================== //===[ Manifest constants ]================================================ //===[ Type definitions ]================================================== //===[ Function prototypes ]=============================================== //===[ Global variables ]================================================== UINT32 g_ulCount = 0; UINT32 g_ulLock = 0; HANDLE g_hModule; //++======================================================================= BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) //=======================================================================-- { BOOL retStatus = TRUE; switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: { g_hModule = hModule; // Initialize the library if (Initialize() != 0) { // Failed to initialize the library OutputDebugString("CASAAUTH -DllMain- Library initialization failed\n"); retStatus = FALSE; } break; } case DLL_THREAD_ATTACH: { g_hModule = hModule; break; } case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: { /* Don't uninitialize on windows tbd */ break; } } return retStatus; } //++======================================================================= // // DllCanUnloadNow // // Synopsis // // STDAPI DllCanUnloadNow() // // Input Arguments // // Ouput Arguments // // Return Value // S_OK The DLL can be unloaded. // S_FALSE The DLL cannot be unloaded now. // // Description // An Exported Function. // DLLs that support the OLE Component Object Model (COM) should implement // and export DllCanUnloadNow. // A call to DllCanUnloadNow determines whether the DLL from which it is // exported is still in use. A DLL is no longer in use when it is not // managing any existing objects (the reference count on all of its objects // is 0). // DllCanUnloadNow returns S_FALSE if there are any existing references to // objects that the DLL manages. // // Environment // // See Also // //=======================================================================-- { // tbd return ((g_ulCount == 0 && g_ulLock == 0) ? S_OK : S_FALSE); } //========================================================================= //=========================================================================