Changeset 3993 for trunk/src/kernel32/winimagepeldr.cpp
- Timestamp:
- Aug 11, 2000, 12:56:27 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimagepeldr.cpp
r3948 r3993 1 /* $Id: winimagepeldr.cpp,v 1.5 1 2000-08-04 21:12:10sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.52 2000-08-11 10:56:19 sandervl Exp $ */ 2 2 3 3 /* … … 42 42 #include "winimagepeldr.h" 43 43 #include "windllpeldr.h" 44 #include "windlllx.h" 44 45 #include <pefile.h> 45 46 #include <unicode.h> … … 1218 1219 ULONG ulCurFixup; 1219 1220 int Size; 1220 Win32 PeLdrDll*WinDll;1221 Win32DllBase *WinDll; 1221 1222 Section *section; 1222 1223 … … 1335 1336 dprintf((LOG, "************** Import Module %s ", pszCurModule )); 1336 1337 dprintf((LOG, "**********************************************************************" )); 1337 WinDll = (Win32PeLdrDll *)Win32DllBase::findModule(pszCurModule);1338 WinDll = Win32DllBase::findModule(pszCurModule); 1338 1339 1339 1340 if(WinDll == NULL) … … 1350 1351 char szModuleFailure[CCHMAXPATH] = ""; 1351 1352 ULONG hInstanceNewDll; 1353 Win32LxDll *lxdll; 1352 1354 1353 1355 char *dot = strchr(modname, '.'); … … 1363 1365 return(FALSE); 1364 1366 } 1365 WinDll = (Win32PeLdrDll *)Win32DllBase::findModule(hInstanceNewDll);1366 if( WinDll == NULL) {//shouldn't happen!1367 lxdll = Win32LxDll::findModuleByOS2Handle(hInstanceNewDll); 1368 if(lxdll == NULL) {//shouldn't happen! 1367 1369 dprintf((LOG, "Just loaded the dll, but can't find it anywhere?!!?")); 1368 1370 errorState = ERROR_INTERNAL; 1369 1371 return(FALSE); 1370 1372 } 1371 //Mark this dll as loaded by DosLoadModule1372 WinDll->setLoadLibrary();1373 WinDll->AddRef();1373 lxdll->setDllHandleOS2(hInstanceNewDll); 1374 lxdll->AddRef(); 1375 WinDll = (Win32DllBase*)lxdll; 1374 1376 } 1375 1377 else { 1376 WinDll = new Win32PeLdrDll(modname, this); 1377 1378 if(WinDll == NULL) { 1379 dprintf((LOG, "WinDll: Error allocating memory" )); 1378 Win32PeLdrDll *pedll; 1379 1380 pedll = new Win32PeLdrDll(modname, this); 1381 if(pedll == NULL) { 1382 dprintf((LOG, "pedll: Error allocating memory" )); 1380 1383 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szMemErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 1381 1384 errorState = ERROR_INTERNAL; … … 1385 1388 dprintf((LOG, "********************** Loading Module *********************" )); 1386 1389 dprintf((LOG, "**********************************************************************" )); 1387 if( WinDll->init(0) == FALSE) {1388 dprintf((LOG, "Internal WinDll error ", WinDll->getError() ));1390 if(pedll->init(0) == FALSE) { 1391 dprintf((LOG, "Internal WinDll error ", pedll->getError() )); 1389 1392 return(FALSE); 1390 1393 } 1391 1394 #ifdef DEBUG 1392 WinDll->AddRef(getModuleName());1395 pedll->AddRef(getModuleName()); 1393 1396 #else 1394 WinDll->AddRef();1397 pedll->AddRef(); 1395 1398 #endif 1396 if( WinDll->attachProcess() == FALSE) {1399 if(pedll->attachProcess() == FALSE) { 1397 1400 dprintf((LOG, "attachProcess failed!" )); 1398 delete WinDll;1401 delete pedll; 1399 1402 errorState = ERROR_INTERNAL; 1400 1403 return(FALSE); 1401 1404 } 1405 WinDll = (Win32DllBase*)pedll; 1402 1406 } 1403 1407 … … 1407 1411 } 1408 1412 else { 1409 if(WinDll->isLxDll() && !WinDll->isLoaded()) {1410 //can happen with i.e. wininet1411 //wininet depends on wsock32; when the app loads wsock32 afterwards1412 //with LoadLibrary or as a child of another dll, we need to make1413 //sure it's loaded once with DosLoadModule1414 WinDll->loadLibrary();1415 }1416 1413 WinDll->AddRef(); 1417 1414 … … 1419 1416 } 1420 1417 //add the dll we just loaded to dependency list for this image 1421 addDependency( (Win32DllBase *)WinDll);1418 addDependency(WinDll); 1422 1419 1423 1420 //Make sure the dependency list is correct (already done
Note:
See TracChangeset
for help on using the changeset viewer.