Changeset 6129 for trunk/src


Ignore:
Timestamp:
Jun 27, 2001, 3:35:47 PM (24 years ago)
Author:
sandervl
Message:

reset FPU before calling entrypoints; search executable in CreateProcess

Location:
trunk/src/kernel32
Files:
6 edited

Legend:

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

    r4407 r6129  
    1 /* $Id: cpu.cpp,v 1.11 2000-10-03 17:28:29 sandervl Exp $ */
     1/* $Id: cpu.cpp,v 1.12 2001-06-27 13:35:45 sandervl Exp $ */
    22/*
    33 * Odin win32 CPU apis
     
    232232  GetSystemInfo (&si); /* To ensure the information is loaded and cached */
    233233
    234   if (feature < 64)
     234  if (feature < 64) {
     235    dprintf(("IsProcessorFeaturePresent %x -> %x", feature, PF[feature]));
    235236    return PF[feature];
     237  }
    236238  else
    237239    return FALSE;
  • trunk/src/kernel32/initsystem.cpp

    r5425 r6129  
    1 /* $Id: initsystem.cpp,v 1.27 2001-04-01 14:33:50 sandervl Exp $ */
     1/* $Id: initsystem.cpp,v 1.28 2001-06-27 13:35:46 sandervl Exp $ */
    22/*
    33 * Odin system initialization (registry, directories & environment)
     
    6767        buffer1[12] = 0;
    6868        signature = GetCPUSignature();
    69         sprintf(buffer, "x86 Family %x Model %x Stepping %x, %s", (signature >> 8)&0xf, signature & 0xf, (signature >> 4)&0xf, buffer1);
     69        sprintf(buffer, "x86 Family %x Model %x Stepping %x, %s", (signature >> 8)&0xf, (signature >> 4) & 0xf, signature & 0xf, buffer1);
    7070        SetEnvironmentVariableA("PROCESSOR_IDENTIFIER", buffer);
    7171        sprintf(buffer, "%x", (signature >> 8)&0xf);
  • trunk/src/kernel32/thread.cpp

    r5354 r6129  
    1 /* $Id: thread.cpp,v 1.28 2001-03-22 18:16:41 sandervl Exp $ */
     1/* $Id: thread.cpp,v 1.29 2001-06-27 13:35:46 sandervl Exp $ */
    22
    33/*
     
    132132  Win32DllBase::attachThreadToAllDlls();          //send DLL_THREAD_ATTACH message to all dlls
    133133
    134   //Set default FPU control word (no exceptions); same as in NT
    135   CONTROL87(0x27F, 0xFFF);
     134  //Reset FPU to default values (control word 0x27F; same as in NT)
     135  _fpreset();
    136136  rc = AsmCallThreadHandler(winthread, userdata);
    137137
  • trunk/src/kernel32/winexebase.cpp

    r5962 r6129  
    1 /* $Id: winexebase.cpp,v 1.15 2001-06-11 09:49:36 phaller Exp $ */
     1/* $Id: winexebase.cpp,v 1.16 2001-06-27 13:35:46 sandervl Exp $ */
    22
    33/*
     
    110110  SetWin32TIB();
    111111
    112   //Set default FPU control word (no exceptions); same as in NT
    113   CONTROL87(0x27F, 0xFFF);
    114  
     112  //Reset FPU to default values (control word 0x27F; same as in NT)
     113  _fpreset();
    115114  dprintf(("KERNEL32: Win32ExeBase::start exe at %08xh\n",
    116115          (void*)entryPoint ));
  • trunk/src/kernel32/winimagepeldr.cpp

    r5959 r6129  
    1 /* $Id: winimagepeldr.cpp,v 1.87 2001-06-10 22:32:17 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.88 2001-06-27 13:35:47 sandervl Exp $ */
    22
    33/*
     
    775775        }
    776776    }
     777    if(fPageCmd == COMPLETE_SECTION && section->type == SECTION_DEBUG) {//ignore
     778        return TRUE;
     779    }
    777780    //Check range of pages with the same attributes starting at virtAddress
    778781    //(some pages might already have been loaded)
  • trunk/src/kernel32/wprocess.cpp

    r6022 r6129  
    1 /* $Id: wprocess.cpp,v 1.126 2001-06-15 18:58:39 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.127 2001-06-27 13:35:47 sandervl Exp $ */
    22
    33/*
     
    16601660    }
    16611661
    1662     char szAppName[255];
     1662    char szAppName[MAX_PATH];
     1663    char buffer[MAX_PATH];
    16631664    DWORD fileAttr;
    1664     char *exename = szAppName;
    1665     strncpy(szAppName, cmdline, sizeof(szAppName));
    1666     szAppName[254] = 0;
     1665    char *exename = buffer;
     1666    strncpy(buffer, cmdline, sizeof(szAppName));
     1667    buffer[MAX_PATH-1] = 0;
    16671668    if(*exename == '"') {
    16681669        exename++;
     
    16731674             *exename = 0;
    16741675        }
    1675         exename = &szAppName[1];
     1676        exename++;
     1677        if (SearchPathA( NULL, &buffer[1], ".exe", sizeof(szAppName), szAppName, NULL ) ||
     1678            SearchPathA( NULL, &buffer[1], NULL, sizeof(szAppName), szAppName, NULL ))
     1679        {
     1680            //
     1681        }
    16761682    }
    16771683    else {
     
    16871693                  fTerminate = TRUE;
    16881694             }
    1689 
    1690              fileAttr = GetFileAttributesA(szAppName);
    1691              if(fileAttr != -1 && !(fileAttr & FILE_ATTRIBUTE_DIRECTORY)) {
    1692                   break;
     1695             dprintf(("Trying '%s'", buffer ));
     1696             if (SearchPathA( NULL, buffer, ".exe", sizeof(szAppName), szAppName, NULL ) ||
     1697                 SearchPathA( NULL, buffer, NULL, sizeof(szAppName), szAppName, NULL ))
     1698             {
     1699                 if(fTerminate) exename++;
     1700                 break;
    16931701             }
     1702
    16941703             if(fTerminate) {
    16951704                  *exename = ' ';
     
    16981707             }
    16991708        }
    1700         exename = szAppName;
    1701     }
    1702     fileAttr = GetFileAttributesA(exename);
     1709    }
     1710    lpCommandLine = exename; //start of command line parameters
     1711
     1712    fileAttr = GetFileAttributesA(szAppName);
    17031713    if(fileAttr == -1 || (fileAttr & FILE_ATTRIBUTE_DIRECTORY)) {
    17041714        dprintf(("CreateProcess: can't find executable!"));
     
    17071717    }
    17081718
    1709     dprintf(("KERNEL32: CreateProcess %s\n", cmdline));
     1719    dprintf(("KERNEL32: CreateProcess %s %s", szAppName, lpCommandLine));
    17101720
    17111721    DWORD Characteristics, SubSystem, fNEExe;
    1712     if(Win32ImageBase::isPEImage(exename, &Characteristics, &SubSystem, &fNEExe) == 0) {
     1722    if(Win32ImageBase::isPEImage(szAppName, &Characteristics, &SubSystem, &fNEExe) == 0) {
    17131723        char *lpszPE;
    17141724        if(SubSystem == IMAGE_SUBSYSTEM_WINDOWS_CUI) {
     
    17221732            char *newcmdline;
    17231733
    1724             newcmdline = (char *)malloc(strlen(lpCurrentDirectory) + strlen(cmdline) + 32);
    1725             sprintf(newcmdline, "%s /OPT:[CURDIR=%s] %s", lpszPE, lpCurrentDirectory, cmdline);
     1734            newcmdline = (char *)malloc(strlen(lpCurrentDirectory) + strlen(szAppName) + strlen(lpCommandLine) + 32);
     1735            sprintf(newcmdline, "%s /OPT:[CURDIR=%s] %s %s", lpszPE, lpCurrentDirectory, szAppName, lpCommandLine);
    17261736            free(cmdline);
    17271737            cmdline = newcmdline;
     
    17301740            char *newcmdline;
    17311741
    1732             newcmdline = (char *)malloc(strlen(cmdline) + 16);
    1733             sprintf(newcmdline, "%s %s", lpszPE, cmdline);
     1742            newcmdline = (char *)malloc(strlen(szAppName) + strlen(lpCommandLine) + 16);
     1743            sprintf(newcmdline, "%s %s %s", lpszPE, szAppName, lpCommandLine);
    17341744            free(cmdline);
    17351745            cmdline = newcmdline;
     
    17441754        char *newcmdline;
    17451755
    1746         newcmdline = (char *)malloc(strlen(cmdline) + 16);
    1747         sprintf(newcmdline, "w16odin.exe %s", cmdline);
     1756        newcmdline = (char *)malloc(strlen(szAppName) + strlen(cmdline) + 16);
     1757        sprintf(newcmdline, "w16odin.exe %s", szAppName, lpCommandLine);
    17481758        free(cmdline);
    17491759        cmdline = newcmdline;
     
    17561766    }
    17571767    else {//os/2 app??
    1758         rc = O32_CreateProcess(NULL, (LPCSTR)cmdline,lpProcessAttributes,
     1768        rc = O32_CreateProcess(szAppName, (LPCSTR)lpCommandLine, lpProcessAttributes,
    17591769                               lpThreadAttributes, bInheritHandles, dwCreationFlags,
    17601770                               lpEnvironment, lpCurrentDirectory, lpStartupInfo,
Note: See TracChangeset for help on using the changeset viewer.