- Timestamp:
- Jul 18, 2000, 8:37:30 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/windllbase.cpp
r3704 r3854 1 /* $Id: windllbase.cpp,v 1.1 4 2000-06-14 02:27:33 phallerExp $ */1 /* $Id: windllbase.cpp,v 1.15 2000-07-18 18:37:29 sandervl Exp $ */ 2 2 3 3 /* … … 51 51 Win32ImageBase *parent) 52 52 : Win32ImageBase(hinstance), 53 referenced(0), fSkip EntryCalls(FALSE), next(NULL), fInserted(FALSE),53 referenced(0), fSkipThreadEntryCalls(FALSE), next(NULL), fInserted(FALSE), 54 54 fAttachedToProcess(FALSE), fUnloaded(FALSE), 55 55 nrDynamicLibRef(0), fLoadLibrary(FALSE), fDisableUnload(FALSE) … … 101 101 { 102 102 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 103 112 dlllistmutex.enter(); 104 113 loadLibDlls.Push((ULONG)this); … … 411 420 tlsAttachThread(); //setup TLS (main thread) 412 421 413 if( fSkipEntryCalls ||dllEntryPoint == NULL) {422 if(dllEntryPoint == NULL) { 414 423 dprintf(("attachProcess not required for dll %s", szModule)); 415 424 if(fSetExceptionHandler) { … … 458 467 BOOL rc; 459 468 460 if( fSkipEntryCalls ||dllEntryPoint == NULL) {469 if(dllEntryPoint == NULL) { 461 470 tlsDetachThread(); //destroy TLS (main thread) 462 471 fUnloaded = TRUE; … … 501 510 BOOL rc; 502 511 503 if(fSkip EntryCalls || dllEntryPoint == NULL)512 if(fSkipThreadEntryCalls || dllEntryPoint == NULL) 504 513 return(TRUE); 505 514 … … 519 528 BOOL rc; 520 529 521 if(fSkip EntryCalls || dllEntryPoint == NULL)530 if(fSkipThreadEntryCalls || dllEntryPoint == NULL) 522 531 return(TRUE); 523 532 … … 630 639 631 640 dlllistmutex.leave(); 641 dprintf(("Win32DllBase::deleteDynamicLibs end")); 632 642 } 633 643 //****************************************************************************** … … 800 810 //****************************************************************************** 801 811 //****************************************************************************** 802 void Win32DllBase::setThreadLibraryCalls(BOOL fEnable)803 {804 // if fEnable == true, do call the ATTACH_THREAD, DETACH_THREAD functions805 // if fEnable == false, do not call the ATTACH_THREAD, DETACH_THREAD functions806 fSkipEntryCalls = !fEnable;807 }808 809 //******************************************************************************810 //******************************************************************************811 812 Win32DllBase *Win32DllBase::head = NULL; 812 813 Queue Win32DllBase::loadLibDlls; -
trunk/src/kernel32/windllbase.h
r3704 r3854 1 /* $Id: windllbase.h,v 1. 3 2000-06-14 02:27:33 phallerExp $ */1 /* $Id: windllbase.h,v 1.4 2000-07-18 18:37:29 sandervl Exp $ */ 2 2 3 3 /* … … 50 50 51 51 char *getName() { return szModule; }; 52 void setNoEntryCalls() { fSkipEntryCalls = TRUE; }; 52 53 //do not call the ATTACH_THREAD, DETACH_THREAD functions 54 void disableThreadLibraryCalls() { fSkipThreadEntryCalls = TRUE; }; 53 55 54 56 Win32DllBase *getNext() { return next; }; … … 71 73 BOOL attachThread(); 72 74 BOOL detachThread(); 73 74 // enable / disable thread attach/detach calls75 void setThreadLibraryCalls(BOOL fEnable);76 75 77 76 //This counter is incremented when the dll has been loaded with LoadLibrary(Ex) … … 126 125 #endif 127 126 128 BOOL fSkip EntryCalls, fUnloaded, fAttachedToProcess;127 BOOL fSkipThreadEntryCalls, fUnloaded, fAttachedToProcess; 129 128 130 129 WIN32DLLENTRY dllEntryPoint; -
trunk/src/kernel32/windlllx.cpp
r3375 r3854 1 /* $Id: windlllx.cpp,v 1.1 0 2000-04-14 22:35:27sandervl Exp $ */1 /* $Id: windlllx.cpp,v 1.11 2000-07-18 18:37:29 sandervl Exp $ */ 2 2 3 3 /* … … 143 143 { 144 144 if(EntryPoint == NULL) { 145 fSkip EntryCalls = TRUE;145 fSkipThreadEntryCalls = TRUE; 146 146 fAttachedToProcess = TRUE; 147 147 } -
trunk/src/kernel32/wprocess.cpp
r3804 r3854 1 /* $Id: wprocess.cpp,v 1.8 3 2000-07-06 21:18:45sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.84 2000-07-18 18:37:30 sandervl Exp $ */ 2 2 3 3 /* … … 831 831 if (dwFlags & (DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_AS_DATAFILE)) 832 832 { 833 peldrDll-> setNoEntryCalls();833 peldrDll->disableThreadLibraryCalls(); 834 834 //peldrDll->setDontProcessImports(); not implemented? 835 835 } … … 866 866 if (peldrDll->init(0)) 867 867 { 868 peldrDll->incDynamicLib();869 868 peldrDll->AddRef(); 870 if (peldrDll->attachProcess()) 869 if (peldrDll->attachProcess()) { 871 870 hDll = peldrDll->getInstanceHandle(); 871 //Must be called *after* attachprocess, since attachprocess may also 872 //trigger LoadLibrary calls 873 //Those dlls must not be put in front of this dll in the dynamic 874 //dll list; or else the unload order is wrong: 875 //i.e. RPAP3260 loads PNRS3260 in DLL_PROCESS_ATTACH 876 // this means that in ExitProcess, PNRS3260 needs to be removed 877 // first since RPAP3260 depends on it 878 peldrDll->incDynamicLib(); 879 } 872 880 else 873 881 { … … 1480 1488 { 1481 1489 // don't call ATTACH/DETACH thread functions in DLL 1482 winmod-> setThreadLibraryCalls(FALSE);1490 winmod->disableThreadLibraryCalls(); 1483 1491 return TRUE; 1484 1492 }
Note:
See TracChangeset
for help on using the changeset viewer.