Ignore:
Timestamp:
Aug 11, 2000, 12:56:27 PM (25 years ago)
Author:
sandervl
Message:

Updates for fake system dll headers

File:
1 edited

Legend:

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

    r3975 r3993  
    1 /* $Id: wprocess.cpp,v 1.85 2000-08-09 18:59:03 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.86 2000-08-11 10:56:20 sandervl Exp $ */
    22
    33/*
     
    2525#include "winexepeldr.h"
    2626#include "winfakepeldr.h"
     27#include "windlllx.h"
    2728#include <vmutex.h>
    2829#include <handlemanager.h>
     
    5152//******************************************************************************
    5253//******************************************************************************
    53 BOOL      fFreeLibrary = FALSE;
    5454BOOL      fIsOS2Image = FALSE;  //TRUE  -> Odin32 OS/2 application (not converted!)
    5555                            //FALSE -> otherwise
     
    448448        return(TRUE);
    449449    }
    450     dprintf(("KERNEL32: FreeLibrary %s %X\n", OSLibGetDllName(hinstance), hinstance));
    451 
    452     //TODO: Not thread safe
    453     fFreeLibrary  = TRUE; //ditch dll
    454     rc = O32_FreeLibrary(hinstance);
    455     fFreeLibrary = FALSE;
    456     dprintf(("FreeLibrary returned %X\n", rc));
     450    dprintf(("WARNING: KERNEL32: FreeLibrary %s %x NOT FOUND!", OSLibGetDllName(hinstance), hinstance));
    457451    return(TRUE);
    458452}
     
    707701    if (pModule)
    708702    {
    709         if (pModule->isLxDll() && !pModule->isLoaded() && fPeLoader)
    710         {
    711             //can happen with i.e. wininet
    712             //wininet depends on wsock32; when the app loads wsock32 afterwards
    713             //with LoadLibrary or as a child of another dll, we need to make
    714             //sure it's loaded once with DosLoadModule
    715             pModule->setLoadLibrary();
    716         }
    717703        pModule->incDynamicLib();
    718704        pModule->AddRef();
     
    771757        {
    772758            /* OS/2 dll, system dll, converted dll or win32k took care of it.*/
    773             pModule = Win32DllBase::findModule(hDll);
    774             if (pModule)
     759            pModule = (Win32DllBase *)Win32LxDll::findModuleByOS2Handle(hDll);
     760            if(pModule)
    775761            {
    776                 if (pModule->isLxDll() && fPeLoader)
     762               
     763                if(pModule->isLxDll())
    777764                {
    778                     pModule->setLoadLibrary();
    779                     pModule->AddRef();
     765                        ((Win32LxDll *)pModule)->setDllHandleOS2(hDll);
     766                        if(fPeLoader) {
     767                                pModule->AddRef();
     768                        }
    780769                }
    781770                pModule->incDynamicLib();
    782771            }
     772            else {
     773                return hDll; //happens when LoadLibrary is called in kernel32's initterm (nor harmful)
     774            }
    783775            dprintf(("KERNEL32: LoadLibraryExA(%s, 0x%x, 0x%x): returns 0x%x. Loaded %s using O32_LoadLibrary.",
    784776                     lpszLibFile, hFile, dwFlags, hDll, szModname));
    785             return hDll;
     777            return pModule->getInstanceHandle();
    786778        }
    787779        dprintf(("KERNEL32: LoadLibraryExA(%s, 0x%x, 0x%x): O32_LoadLibrary(%s) failed. LastError=%d",
     
    10991091        lpszPath[rc-1] = 0;
    11001092  }
     1093  //only needed for call inside kernel32's initterm (profile init)
    11011094  else  rc = O32_GetModuleFileName(hinstModule, lpszPath, cchPath);
    11021095
    11031096  if(rc) {
    1104     dprintf(("KERNEL32: GetModuleFileName %s %d\n", lpszPath, hinstModule));
    1105   }
     1097        dprintf(("KERNEL32: GetModuleFileName %s %d\n", lpszPath, hinstModule));
     1098  }
     1099  else  dprintf(("KERNEL32: WARNING: GetModuleFileName %x not found!", hinstModule));
    11061100  return(rc);
    11071101}
     
    11321126  if(lpszModule == NULL) {
    11331127    if(WinExe)
    1134         hMod = WinExe->getInstanceHandle();
     1128            hMod = WinExe->getInstanceHandle();
    11351129    else    hMod = -1;
    11361130  }
    1137   else {
     1131  else
     1132  {
    11381133    strcpy(szModule, OSLibStripPath((char *)lpszModule));
    11391134    strupr(szModule);
     
    11581153        windll = Win32DllBase::findModule(szModule);
    11591154        if(windll) {
    1160             hMod = windll->getInstanceHandle();
    1161         }
    1162         else    hMod = OSLibiGetModuleHandleA((char *)lpszModule);
     1155              hMod = windll->getInstanceHandle();
     1156        }
    11631157    }
    11641158  }
Note: See TracChangeset for help on using the changeset viewer.