Ignore:
Timestamp:
Jul 18, 2000, 8:37:30 PM (25 years ago)
Author:
sandervl
Message:

dll unload fix + detach skip fix

File:
1 edited

Legend:

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

    r3704 r3854  
    1 /* $Id: windllbase.cpp,v 1.14 2000-06-14 02:27:33 phaller Exp $ */
     1/* $Id: windllbase.cpp,v 1.15 2000-07-18 18:37:29 sandervl Exp $ */
    22
    33/*
     
    5151                           Win32ImageBase *parent)
    5252                 : Win32ImageBase(hinstance),
    53                    referenced(0), fSkipEntryCalls(FALSE), next(NULL), fInserted(FALSE),
     53                   referenced(0), fSkipThreadEntryCalls(FALSE), next(NULL), fInserted(FALSE),
    5454                   fAttachedToProcess(FALSE), fUnloaded(FALSE),
    5555                   nrDynamicLibRef(0), fLoadLibrary(FALSE), fDisableUnload(FALSE)
     
    101101{
    102102  if(nrDynamicLibRef == 0) {
     103        //NOTE:
     104        //Must be called *after* attachprocess, since attachprocess may also
     105        //trigger LoadLibrary calls
     106        //Those dlls must not be put in front of this dll in the dynamic
     107        //dll list; or else the unload order is wrong:
     108        //i.e. RPAP3260 loads PNRS3260 in DLL_PROCESS_ATTACH
     109        //     this means that in ExitProcess, PNRS3260 needs to be removed
     110        //     first since RPAP3260 depends on it
     111
    103112        dlllistmutex.enter();
    104113        loadLibDlls.Push((ULONG)this);
     
    411420  tlsAttachThread();    //setup TLS (main thread)
    412421
    413   if(fSkipEntryCalls || dllEntryPoint == NULL) {
     422  if(dllEntryPoint == NULL) {
    414423        dprintf(("attachProcess not required for dll %s", szModule));
    415424        if(fSetExceptionHandler) {
     
    458467 BOOL rc;
    459468
    460   if(fSkipEntryCalls || dllEntryPoint == NULL) {
     469  if(dllEntryPoint == NULL) {
    461470        tlsDetachThread();      //destroy TLS (main thread)
    462471        fUnloaded = TRUE;
     
    501510 BOOL               rc;
    502511
    503   if(fSkipEntryCalls || dllEntryPoint == NULL)
     512  if(fSkipThreadEntryCalls || dllEntryPoint == NULL)
    504513        return(TRUE);
    505514
     
    519528 BOOL               rc;
    520529
    521   if(fSkipEntryCalls || dllEntryPoint == NULL)
     530  if(fSkipThreadEntryCalls || dllEntryPoint == NULL)
    522531        return(TRUE);
    523532
     
    630639
    631640  dlllistmutex.leave();
     641  dprintf(("Win32DllBase::deleteDynamicLibs end"));
    632642}
    633643//******************************************************************************
     
    800810//******************************************************************************
    801811//******************************************************************************
    802 void Win32DllBase::setThreadLibraryCalls(BOOL fEnable)
    803 {
    804   // if fEnable == true, do call the ATTACH_THREAD, DETACH_THREAD functions
    805   // if fEnable == false, do not call the ATTACH_THREAD, DETACH_THREAD functions
    806   fSkipEntryCalls = !fEnable;
    807 }
    808 
    809 //******************************************************************************
    810 //******************************************************************************
    811812Win32DllBase *Win32DllBase::head = NULL;
    812813Queue         Win32DllBase::loadLibDlls;
Note: See TracChangeset for help on using the changeset viewer.