Ignore:
Timestamp:
Oct 17, 1999, 3:49:09 AM (26 years ago)
Author:
bird
Message:

No exception throwing. Constructors is moved into an init method.
TLS is now implemented, but not tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/windllpe2lx.cpp

    r1274 r1325  
    1 /* $Id: windllpe2lx.cpp,v 1.2 1999-10-14 01:37:55 bird Exp $ */
     1/* $Id: windllpe2lx.cpp,v 1.3 1999-10-17 01:49:08 bird Exp $ */
    22
    33/*
     
    8888
    8989        /* Try create pe2lx dll object. */
    90         try
     90        pWinMod = new Win32Pe2LxDll(hinstance, (ulPe2LxVersion & 0x80000000UL) == 0x80000000UL);
     91        if (pWinMod == NULL)
    9192        {
    92             pWinMod = new Win32Pe2LxDll(hinstance, (ulPe2LxVersion & 0x80000000UL) == 0x80000000UL);
    93             if (pWinMod == NULL)
    94                 throw ((ULONG)ERROR_NOT_ENOUGH_MEMORY);
    95 
    96             /* @@@PH 1998/03/17 Console devices initialization */
    97             iConsoleDevicesRegister();
    98 
    99             /* Add reference and attach dll to process. */
    100             pWinMod->AddRef();
    101             pWinMod->attachProcess();
     93            eprintf(("RegisterPe2LxDll: new returned a NULL-pointer\n"));
     94            return 0;
    10295        }
    103         catch(ULONG ul)
     96        if (!pWinMod->init())
    10497        {
    105             eprintf(("RegisterPe2LxDLL: Failed to create module object, ul=%d\n", ul));
    106             DebugInt3();
    107             return 0;  /* fail dll load */
     98            eprintf(("RegisterPe2LxDll: init-method failed.\n"));
     99            delete pWinMod;
     100            return 0;
    108101        }
     102
     103        /* @@@PH 1998/03/17 Console devices initialization */
     104        iConsoleDevicesRegister();
     105
     106        /* Add reference and attach dll to process. */
     107        pWinMod->AddRef();
     108        pWinMod->attachProcess();
    109109    }
    110110    else
     
    112112        if (pWinMod != NULL && !fFreeLibrary)
    113113            return 0;   /* don't unload (OS/2 dll unload bug) - see OS2.bugs in root dir. */
    114 
    115         #if 0 /* Runtime environment could already be gone, so don't do this */
    116             dprintf(("KERNEL32: Dll Removed by FreeLibrary or ExitProcess\n"));
    117         #endif
    118114    }
    119115
     
    130126 * @author    Sander van Leeuwen, knut st. osmundsen
    131127 */
    132 Win32Pe2LxDll::Win32Pe2LxDll(HINSTANCE hinstance, BOOL fWin32k) throw(ULONG)
     128Win32Pe2LxDll::Win32Pe2LxDll(HINSTANCE hinstance, BOOL fWin32k)
    133129    : Win32ImageBase(hinstance),
    134130    Win32DllBase(hinstance, NULL),
     
    136132{
    137133    dprintf(("Win32Pe2LxDll::Win32Pe2LxDll %s", szModule));
    138     /* set entry point. */
    139     dllEntryPoint = (WIN32DLLENTRY)entryPoint;
    140134}
    141135
     
    151145}
    152146
     147
     148/**
     149 * Init object.
     150 * Must be called immedeately after objecte construction.
     151 * @returns   Success indicator. (TRUE == success)
     152 * @sketch    call init method of the parten class.
     153 *            set dllEntryPoint
     154 * @status    completely implemented.
     155 * @author    knut st. osmundsen
     156 */
     157BOOL Win32Pe2LxDll::init()
     158{
     159    if (Win32Pe2LxImage::init())
     160    {
     161        /* set entry point. */
     162        dllEntryPoint = (WIN32DLLENTRY)entryPoint;
     163    }
     164    else
     165        return FALSE;
     166    return TRUE;
     167}
    153168
    154169/**
Note: See TracChangeset for help on using the changeset viewer.