Ignore:
Timestamp:
Jun 8, 2002, 1:42:04 PM (23 years ago)
Author:
sandervl
Message:

os2cdrom.dmd rewrite

File:
1 edited

Legend:

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

    r8134 r8601  
    1 /* $Id: initwnaspi32.cpp,v 1.6 2002-03-28 16:53:47 sandervl Exp $
     1/* $Id: initwnaspi32.cpp,v 1.7 2002-06-08 11:42:02 sandervl Exp $
    22 *
    33 * DLL entry point
     
    3737#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
    3838#include <initdll.h>
    39 #include "aspilib.h"
    4039#include <custombuild.h>
     40#include "cdio.h"
    4141
    4242extern "C" {
     
    4444 extern DWORD wnaspi32_PEResTab;
    4545}
    46 scsiObj *aspi = NULL;
    4746static HMODULE dllHandle = 0;
    48 static BOOL fDisableASPI = FALSE;
     47BOOL fASPIAvailable = TRUE;
    4948
    5049//******************************************************************************
     
    5352{
    5453   dprintf(("DisableASPI"));
    55    fDisableASPI = TRUE;
     54   fASPIAvailable = FALSE;
    5655}
    5756//******************************************************************************
     
    6362   case DLL_PROCESS_ATTACH:
    6463   {
    65        if(fDisableASPI) return TRUE;
     64       if(fASPIAvailable == FALSE) return TRUE;
    6665
    67        aspi = new scsiObj();
    68        if(aspi == NULL) {
     66       if(OSLibCdIoInitialize() == FALSE) {
    6967           dprintf(("WNASPI32: LibMain; can't allocate aspi object! APIs will not work!"));
    7068           // @@@AH 20011020 we shouldn't prevent DLL loading in this case
     
    7270           return TRUE;
    7371       }
    74        if(aspi->init(65535) == FALSE)
    75        {
    76            delete aspi;
    77            aspi = NULL;
    78            dprintf(("WNASPI32: LibMain; can't init aspi object!"));
    79            // @@@20011026 and also in this case we shouldn't prevent DLL loading...
    80            return TRUE;
    81        }
    82        dprintf(("WNASPI32: LibMain; aspi object created successfully"));
     72       fASPIAvailable = TRUE;
     73       dprintf(("WNASPI32: LibMain; os2cdrom.dmd ASPI interface available"));
    8374       return TRUE;
    8475   }
     
    8980
    9081   case DLL_PROCESS_DETACH:
    91        if(aspi) {
    92            aspi->close();
    93            delete aspi;
    94            aspi = NULL;
    95        }
     82       OSLibCdIoTerminate();
    9683       return TRUE;
    9784   }
Note: See TracChangeset for help on using the changeset viewer.