Ignore:
Timestamp:
Oct 15, 2001, 7:10:55 PM (24 years ago)
Author:
sandervl
Message:

custom build update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wnaspi32/initterm.cpp

    r6639 r7063  
    1 /* $Id: initterm.cpp,v 1.7 2001-09-05 10:28:28 bird Exp $
     1/* $Id: initterm.cpp,v 1.8 2001-10-15 17:06:18 sandervl Exp $
    22 *
    33 * DLL entry point
     
    3636#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
    3737#include <initdll.h>
    38 #include "aspilib.h"
    3938
    40 extern "C" {
    41  //Win32 resource table (produced by wrc)
    42  extern DWORD _Resource_PEResTab;
    43 }
    44 
    45 static HMODULE dllHandle = 0;
    46 scsiObj *aspi = NULL;
    47 //******************************************************************************
    48 //******************************************************************************
    49 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
    50 {
    51    switch (fdwReason)
    52    {
    53    case DLL_PROCESS_ATTACH:
    54         aspi = new scsiObj();
    55     if(aspi == NULL) {
    56         dprintf(("WNASPI32: LibMain; can't allocate aspi object!"));
    57         return FALSE;
    58     }
    59         if(aspi->init(65535) == FALSE)
    60         {
    61         delete aspi;
    62         aspi = NULL;
    63         dprintf(("WNASPI32: LibMain; can't init aspi object!"));
    64         return FALSE;
    65     }
    66     dprintf(("WNASPI32: LibMain; aspi object created successfully"));
    67     return TRUE;
    68 
    69    case DLL_THREAD_ATTACH:
    70    case DLL_THREAD_DETACH:
    71     return TRUE;
    72 
    73    case DLL_PROCESS_DETACH:
    74     if(aspi) {
    75             aspi->close();
    76         delete aspi;
    77         aspi = NULL;
    78     }
    79     ctordtorTerm();
    80     return TRUE;
    81    }
    82    return FALSE;
    83 }
    8439/****************************************************************************/
    8540/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    9045/* calling this function.                                                   */
    9146/****************************************************************************/
    92 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
    93                                    ulFlag)
     47ULONG DLLENTRYPOINT_CCONV DLLENTRYPOINT_NAME(ULONG hModule, ULONG ulFlag)
    9448{
    9549   size_t i;
     
    10862         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    10963
    110      dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);
    111          if(dllHandle == 0)
    112         return 0UL;
     64         return inittermWnaspi32(hModule, ulFlag);
    11365
    114          break;
    11566      case 1:
    116          if(dllHandle) {
    117         UnregisterLxDll(dllHandle);
    118          }
     67         inittermWnaspi32(hModule, ulFlag);
     68         ctordtorTerm();
    11969         break;
    12070      default:
Note: See TracChangeset for help on using the changeset viewer.