Changeset 7811 for trunk/src


Ignore:
Timestamp:
Feb 6, 2002, 5:33:40 PM (24 years ago)
Author:
sandervl
Message:

SetWin32TIB update + force change to win32 FS selector for calling PE image entrypoints

Location:
trunk/src/kernel32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.DEF

    r7797 r7811  
    1 ; $Id: KERNEL32.DEF,v 1.128 2002-02-03 13:16:22 sandervl Exp $
     1; $Id: KERNEL32.DEF,v 1.129 2002-02-06 16:33:38 sandervl Exp $
    22
    33;Basis is Windows95 KERNEL32
     
    10961096
    10971097   RestoreOS2TIB        = _RestoreOS2TIB@0                        @1228 NONAME
    1098    SetWin32TIB          = _SetWin32TIB@0                          @1229 NONAME
     1098   SetWin32TIB          = _SetWin32TIB@4                          @1229 NONAME
    10991099   RestoreOS2FS         = RestoreOS2FS                            @1230 NONAME
    11001100
  • trunk/src/kernel32/windllbase.cpp

    r6249 r7811  
    1 /* $Id: windllbase.cpp,v 1.27 2001-07-08 11:02:10 sandervl Exp $ */
     1/* $Id: windllbase.cpp,v 1.28 2002-02-06 16:33:38 sandervl Exp $ */
    22
    33/*
     
    407407    if(fSetExceptionHandler) {
    408408        OS2SetExceptionHandler((void *)&exceptFrame);
    409         sel = SetWin32TIB();
     409        sel = SetWin32TIB(isPEImage() ? TIB_SWITCH_FORCE_WIN32 : TIB_SWITCH_DEFAULT);
    410410    }
    411411
     
    482482
    483483    fUnloaded = TRUE;
    484     sel = SetWin32TIB();
     484    sel = SetWin32TIB(isPEImage() ? TIB_SWITCH_FORCE_WIN32 : TIB_SWITCH_DEFAULT);
    485485
    486486    // @@@PH 2000/06/13 lpvReserved, Starcraft STORM.DLL
     
    497497    rc = dllEntryPoint(hinstance, DLL_PROCESS_DETACH, lpvReserved);
    498498
    499     SetFS(sel);
     499    SetFS(sel);           //restore FS
    500500    tlsDetachThread();    //destroy TLS (main thread)
    501501    tlsDelete();
  • trunk/src/kernel32/winexebase.cpp

    r6133 r7811  
    1 /* $Id: winexebase.cpp,v 1.18 2001-06-27 19:09:36 sandervl Exp $ */
     1/* $Id: winexebase.cpp,v 1.19 2002-02-06 16:33:38 sandervl Exp $ */
    22
    33/*
     
    108108  //      in OS/2
    109109  OS2SetExceptionHandler((void *)&exceptFrame);
    110   SetWin32TIB();
     110  USHORT sel = SetWin32TIB(isPEImage() ? TIB_SWITCH_FORCE_WIN32 : TIB_SWITCH_DEFAULT);
    111111
    112112  //Set FPU control word to 0x27F (same as in NT)
     
    115115          (void*)entryPoint ));
    116116  rc = CallEntryPoint(entryPoint, NULL);
    117   RestoreOS2TIB();
     117
     118  SetFS(sel);           //restore FS
    118119
    119120  OS2UnsetExceptionHandler((void *)&exceptFrame);
  • trunk/src/kernel32/winimagebase.cpp

    r6412 r7811  
    1 /* $Id: winimagebase.cpp,v 1.33 2001-07-30 12:01:25 sandervl Exp $ */
     1/* $Id: winimagebase.cpp,v 1.34 2002-02-06 16:33:39 sandervl Exp $ */
    22
    33/*
     
    4949    tlsAddress(0), tlsIndexAddr(0), tlsInitSize(0), tlsTotalSize(0),
    5050    tlsCallBackAddr(0), tlsIndex(-1), pResRootDir(NULL),
    51     ulRVAResourceSection(0)
     51    ulRVAResourceSection(0), fIsPEImage(FALSE)
    5252{
    5353  char *name;
  • trunk/src/kernel32/winimagebase.h

    r6975 r7811  
    1 /* $Id: winimagebase.h,v 1.20 2001-10-09 20:25:20 sandervl Exp $ */
     1/* $Id: winimagebase.h,v 1.21 2002-02-06 16:33:39 sandervl Exp $ */
    22
    33/*
     
    123123virtual ULONG getImageSize();
    124124
    125 virtual BOOL  isDll() = 0;
     125virtual BOOL  isDll()     = 0;
     126        BOOL  isPEImage() { return fIsPEImage; };
    126127
    127128static Win32ImageBase * findModule(HMODULE hModule);
     
    145146
    146147    HINSTANCE               hinstance;
     148    BOOL                    fIsPEImage;
    147149
    148150    LPVOID                  tlsAddress;         //address of TLS data
  • trunk/src/kernel32/winimagepeldr.cpp

    r7670 r7811  
    1 /* $Id: winimagepeldr.cpp,v 1.94 2001-12-22 12:34:06 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.95 2002-02-06 16:33:39 sandervl Exp $ */
    22
    33/*
     
    119119 HFILE  dllfile;
    120120
     121    fIsPEImage = TRUE;
     122
    121123    strcpy(szFileName, pszFileName);
    122124    strupr(szFileName);
     
    624626    //they get TLS index 0 for their main executable
    625627    {
    626       USHORT sel = SetWin32TIB();
     628      USHORT sel = SetWin32TIB(TIB_SWITCH_FORCE_WIN32);
    627629      tlsAlloc();
    628630      tlsAttachThread();  //setup TLS (main thread)
  • trunk/src/kernel32/wprocess.cpp

    r7794 r7811  
    1 /* $Id: wprocess.cpp,v 1.142 2002-02-02 14:19:01 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.143 2002-02-06 16:33:40 sandervl Exp $ */
    22
    33/*
     
    372372}
    373373/******************************************************************************/
     374//Switch to WIN32 TIB (FS selector)
     375//NOTE: This is not done for Odin32 applications (LX), unless
     376//      fForceSwitch is TRUE)
    374377/******************************************************************************/
    375 USHORT WIN32API SetWin32TIB()
     378USHORT WIN32API SetWin32TIB(BOOL fForceSwitch)
    376379{
    377380 SHORT  win32tibsel;
     
    380383    //If we're running an Odin32 OS/2 application (not converted!), then we
    381384    //we don't switch FS selectors
    382     if(fIsOS2Image) {
     385    if(fIsOS2Image && !fForceSwitch) {
    383386        return GetFS();
    384387    }
Note: See TracChangeset for help on using the changeset viewer.