Ignore:
Timestamp:
Jun 15, 2001, 11:42:49 AM (24 years ago)
Author:
bird
Message:

Corrected Pe2Lx bug in LoadLibrary. Added isPe2LxDLL.

File:
1 edited

Legend:

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

    r5974 r6015  
    1 /* $Id: wprocess.cpp,v 1.124 2001-06-12 17:03:34 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.125 2001-06-15 09:42:49 bird Exp $ */
    22
    33/*
     
    789789
    790790    /** @sketch
    791      *  IF dwFlags == 0 && (!fPeLoader || !fPE) THEN
     791     *  IF (!fPeLoader || fPE == failure) THEN
    792792     *      Try load the executable using LoadLibrary
    793793     *      IF successfully loaded THEN
     
    802802     */
    803803    //only call OS/2 if LX binary or win32k process
    804     if(!fPeLoader || fPE != ERROR_SUCCESS)
     804    if (!fPeLoader || fPE != ERROR_SUCCESS)
    805805    {
    806806        hDll = OSLibDosLoadModule(szModname);
     
    808808        {
    809809            /* OS/2 dll, system dll, converted dll or win32k took care of it. */
    810             pModule = (Win32DllBase *)Win32LxDll::findModuleByOS2Handle(hDll);
    811             if(pModule)
     810            pModule = Win32DllBase::findModuleByOS2Handle(hDll);
     811            if (pModule)
    812812            {
    813                 if(pModule->isLxDll())
     813                if (pModule->isLxDll())
    814814                {
    815                         ((Win32LxDll *)pModule)->setDllHandleOS2(hDll);
    816                         if(fPeLoader)
    817                         {
    818                             if(pModule->AddRef() == -1) {//-1 -> load failed (attachProcess)
    819                                 dprintf(("Dll %s refused to be loaded; aborting", szModname));
    820                                 delete pModule;
    821                                 return 0;
    822                             }
    823                         }
     815                    ((Win32LxDll *)pModule)->setDllHandleOS2(hDll);
     816                    if (fPeLoader && pModule->AddRef() == -1)
     817                    {   //-1 -> load failed (attachProcess)
     818                        delete pModule;
     819                        SetLastError(ERROR_INVALID_EXE_SIGNATURE);
     820                        dprintf(("Dll %s refused to be loaded; aborting", szModname));
     821                        return 0;
     822                    }
     823
    824824                }
    825825                pModule->incDynamicLib();
    826826            }
    827             else
    828             if(fExeStarted) {
     827            else if (fExeStarted) {
    829828                OSLibDosFreeModule(hDll);
    830829                SetLastError(ERROR_INVALID_EXE_SIGNATURE);
     
    15651564#ifdef DEBUG
    15661565    if(lpStartupInfo) {
    1567         dprintf(("lpStartupInfo->lpReserved %x", lpStartupInfo->lpReserved));
    1568         dprintf(("lpStartupInfo->lpDesktop %x", lpStartupInfo->lpDesktop));
    1569         dprintf(("lpStartupInfo->lpTitle %s", lpStartupInfo->lpTitle));
    1570         dprintf(("lpStartupInfo->dwX %x", lpStartupInfo->dwX));
    1571         dprintf(("lpStartupInfo->dwY %x", lpStartupInfo->dwY));
    1572         dprintf(("lpStartupInfo->dwXSize %x", lpStartupInfo->dwXSize));
    1573         dprintf(("lpStartupInfo->dwYSize %x", lpStartupInfo->dwYSize));
    1574         dprintf(("lpStartupInfo->dwXCountChars %x", lpStartupInfo->dwXCountChars));
    1575         dprintf(("lpStartupInfo->dwYCountChars %x", lpStartupInfo->dwYCountChars));
    1576         dprintf(("lpStartupInfo->dwFillAttribute %x", lpStartupInfo->dwFillAttribute));
    1577         dprintf(("lpStartupInfo->dwFlags %x", lpStartupInfo->dwFlags));
    1578         dprintf(("lpStartupInfo->wShowWindow %x", lpStartupInfo->wShowWindow));
    1579         dprintf(("lpStartupInfo->hStdInput %x", lpStartupInfo->hStdInput));
    1580         dprintf(("lpStartupInfo->hStdOutput %x", lpStartupInfo->hStdOutput));
    1581         dprintf(("lpStartupInfo->hStdError %x", lpStartupInfo->hStdError));
     1566    dprintf(("lpStartupInfo->lpReserved %x", lpStartupInfo->lpReserved));
     1567    dprintf(("lpStartupInfo->lpDesktop %x", lpStartupInfo->lpDesktop));
     1568    dprintf(("lpStartupInfo->lpTitle %s", lpStartupInfo->lpTitle));
     1569    dprintf(("lpStartupInfo->dwX %x", lpStartupInfo->dwX));
     1570    dprintf(("lpStartupInfo->dwY %x", lpStartupInfo->dwY));
     1571    dprintf(("lpStartupInfo->dwXSize %x", lpStartupInfo->dwXSize));
     1572    dprintf(("lpStartupInfo->dwYSize %x", lpStartupInfo->dwYSize));
     1573    dprintf(("lpStartupInfo->dwXCountChars %x", lpStartupInfo->dwXCountChars));
     1574    dprintf(("lpStartupInfo->dwYCountChars %x", lpStartupInfo->dwYCountChars));
     1575    dprintf(("lpStartupInfo->dwFillAttribute %x", lpStartupInfo->dwFillAttribute));
     1576    dprintf(("lpStartupInfo->dwFlags %x", lpStartupInfo->dwFlags));
     1577    dprintf(("lpStartupInfo->wShowWindow %x", lpStartupInfo->wShowWindow));
     1578    dprintf(("lpStartupInfo->hStdInput %x", lpStartupInfo->hStdInput));
     1579    dprintf(("lpStartupInfo->hStdOutput %x", lpStartupInfo->hStdOutput));
     1580    dprintf(("lpStartupInfo->hStdError %x", lpStartupInfo->hStdError));
    15821581    }
    15831582#endif
     
    17011700
    17021701    dprintf(("KERNEL32: CreateProcess %s\n", cmdline));
    1703    
     1702
    17041703    DWORD Characteristics, SubSystem, fNEExe;
    17051704    if(Win32ImageBase::isPEImage(exename, &Characteristics, &SubSystem, &fNEExe) == 0) {
     
    17091708        }
    17101709        else lpszPE = "PE.EXE";
    1711    
     1710
    17121711        //SvL: Allright. Before we call O32_CreateProcess, we must take care of
    17131712        //     lpCurrentDirectory ourselves. (Open32 ignores it!)
    17141713        if(lpCurrentDirectory) {
    17151714            char *newcmdline;
    1716    
     1715
    17171716            newcmdline = (char *)malloc(strlen(lpCurrentDirectory) + strlen(cmdline) + 32);
    17181717            sprintf(newcmdline, "%s /OPT:[CURDIR=%s] %s", lpszPE, lpCurrentDirectory, cmdline);
     
    17331732                               lpProcessInfo);
    17341733    }
    1735     else 
     1734    else
    17361735    if(fNEExe) {//16 bits windows app
    17371736        char *newcmdline;
    1738        
     1737
    17391738        newcmdline = (char *)malloc(strlen(cmdline) + 16);
    17401739        sprintf(newcmdline, "w16odin.exe %s", cmdline);
Note: See TracChangeset for help on using the changeset viewer.