Changeset 8436


Ignore:
Timestamp:
May 16, 2002, 3:45:32 PM (23 years ago)
Author:
sandervl
Message:

TLS fix for pe2lx images

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/kernel32/winexepe2lx.cpp

    r6211 r8436  
    1 /* $Id: winexepe2lx.cpp,v 1.10 2001-07-08 02:49:47 bird Exp $ */
     1/* $Id: winexepe2lx.cpp,v 1.11 2002-05-16 13:45:32 sandervl Exp $ */
    22
    33/*
     
    2828#include <win32k.h>
    2929#include "winexepe2lx.h"
     30#include <cpuhlp.h>
     31#include <wprocess.h>
     32#include <win32api.h>
    3033
    3134#include "cio.h"            // I/O
     
    3336#include "conwin.h"         // Windows Header for console only
    3437#include "console.h"
     38
     39#include "exceptions.h"
     40#include "exceptutil.h"
    3541
    3642#define DBG_LOCALLOG    DBG_winexepe2lx
     
    198204    return FALSE;
    199205}
    200 
     206//******************************************************************************
     207//******************************************************************************
     208ULONG Win32Pe2LxExe::start()
     209{
     210 WINEXCEPTION_FRAME exceptFrame;
     211 ULONG rc;
     212
     213  dprintf(("Start executable %X\n", WinExe));
     214
     215  fExeStarted  = TRUE;
     216
     217  //Allocate TLS index for this module
     218  tlsAlloc();
     219  tlsAttachThread();    //setup TLS (main thread)
     220
     221  //Note: The Win32 exception structure references by FS:[0] is the same
     222  //      in OS/2
     223  OS2SetExceptionHandler((void *)&exceptFrame);
     224  USHORT sel = SetWin32TIB(isPEImage() ? TIB_SWITCH_FORCE_WIN32 : TIB_SWITCH_DEFAULT);
     225
     226  //Set FPU control word to 0x27F (same as in NT)
     227  CONTROL87(0x27F, 0xFFF);
     228  dprintf(("KERNEL32: Win32ExeBase::start exe at %08xh\n",
     229          (void*)entryPoint ));
     230  rc = CallEntryPoint(entryPoint, NULL);
     231
     232  SetFS(sel);           //restore FS
     233
     234  OS2UnsetExceptionHandler((void *)&exceptFrame);
     235
     236  ExitProcess(rc);
     237  return rc;
     238}
     239//******************************************************************************
     240//******************************************************************************
  • TabularUnified trunk/src/kernel32/winexepe2lx.h

    r6211 r8436  
    1 /* $Id: winexepe2lx.h,v 1.4 2001-07-08 02:49:47 bird Exp $ */
     1/* $Id: winexepe2lx.h,v 1.5 2002-05-16 13:45:32 sandervl Exp $ */
    22
    33/*
     
    3232    static BOOL earlyInit();
    3333
     34    virtual ULONG start();
     35
    3436public:
    3537    static BOOL fEarlyInit;
Note: See TracChangeset for help on using the changeset viewer.