Changeset 130 for trunk/src


Ignore:
Timestamp:
Jun 20, 1999, 2:46:34 PM (26 years ago)
Author:
sandervl
Message:

Activated Win32 TIB code and fixes some other things (see ChangeLog)

Location:
trunk/src/kernel32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/except.h

    r126 r130  
    1 /* $Id: except.h,v 1.5 1999-06-20 10:55:36 sandervl Exp $ */
     1/* $Id: except.h,v 1.6 1999-06-20 12:46:08 sandervl Exp $ */
    22
    33/*
     
    1818void  ChangeTIBStack();
    1919#endif
    20 void __cdecl SetExceptionChain(DWORD);
     20void  __cdecl SetExceptionChain(DWORD);
    2121
    2222void  DisableFPUExceptions();
  • trunk/src/kernel32/initterm.cpp

    r126 r130  
    1 /* $Id: initterm.cpp,v 1.5 1999-06-20 10:55:36 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.6 1999-06-20 12:46:09 sandervl Exp $ */
    22
    33/*
     
    119119                return 0UL;
    120120
    121             rc = DosExitList(0x00002A00|EXLST_ADD, Win32DllExitList);
    122             if (rc)
    123                 return 0UL;
    124 
    125121            /* knut: check for high memory support */
    126122            rc = DosQuerySysInfo(QSV_VIRTUALADDRESSLIMIT, QSV_VIRTUALADDRESSLIMIT, &sysinfo, sizeof(sysinfo));
     
    150146static void APIENTRY cleanup(ULONG ulReason)
    151147{
    152     dprintf(("kernel32 exit\n"));
     148    dprintf(("kernel32 exit %d\n", ulReason));
    153149    _dump_allocated(10);    /*PLF Wed  98-03-18 23:55:07*/
    154150    DestroyTIB();
  • trunk/src/kernel32/os2native.cpp

    r120 r130  
    1 /* $Id: os2native.cpp,v 1.3 1999-06-19 10:54:42 sandervl Exp $ */
     1/* $Id: os2native.cpp,v 1.4 1999-06-20 12:46:09 sandervl Exp $ */
    22
    33/*
     
    108108                        rc = DosAllocMem(&Address, cbSize, flag | flAllocMem );
    109109                }
    110                 else    dprintf(("Unexpected DosSetMem error %x", rc));
     110                else   
     111                if(rc)  dprintf(("Unexpected DosSetMem error %x", rc));
    111112        }
    112113  }
  • trunk/src/kernel32/windll.cpp

    r120 r130  
    1 /* $Id: windll.cpp,v 1.4 1999-06-19 10:54:43 sandervl Exp $ */
     1/* $Id: windll.cpp,v 1.5 1999-06-20 12:46:09 sandervl Exp $ */
    22
    33/*
     
    3636void _System SetLastError(ULONG ulError);
    3737
    38 
    3938//******************************************************************************
    4039//******************************************************************************
     
    5049  UpCase(szModule);
    5150  char *dot = strstr(szModule, ".");
     51  while(dot) {
     52        char *newdot = strstr(dot+1, ".");
     53        if(newdot == NULL)      break;
     54        dot = newdot;
     55  }
    5256  if(dot)
    5357        *dot = 0;
     58  dprintf(("Win32Dll::Win32Dll %s %s", szFileName, szModule));
    5459}
    5560//******************************************************************************
     
    6974  UpCase(szModule);
    7075  char *dot = strstr(szModule, ".");
     76  while(dot) {
     77        char *newdot = strstr(dot+1, ".");
     78        if(newdot == NULL)      break;
     79        dot = newdot;
     80  }
    7181  if(dot)
    7282        *dot = 0;
    7383
     84  dprintf(("Win32Dll::Win32Dll %s", szModule));
    7485}
    7586//******************************************************************************
     
    8596  UpCase(szModule);
    8697  char *dot = strstr(szModule, ".");
     98  while(dot) {
     99        char *newdot = strstr(dot+1, ".");
     100        if(newdot == NULL)      break;
     101        dot = newdot;
     102  }
    87103  if(dot)
    88104        *dot = 0;
     
    95111{
    96112 Win32Dll *dll = head;
     113
     114  dprintf(("Win32Dll::~Win32Dll %s", szModule));
    97115
    98116  //first remove it from the linked list so converted win32 dlls won't
     
    111129        dll->next = next;
    112130  }
    113   if(errorState == NO_ERROR && !fUnloaded) {
    114         if(fNativePEImage) {
     131  if(errorState == NO_ERROR && !fUnloaded)
     132  {
     133        if(!fSystemDll) {
    115134                detachProcess();
    116         }
    117         else {
    118                 if(!fSystemDll) //let OS/2 unload them, unless ordered by FreeLibrary (see ::Release)
    119                         DosFreeModule((HMODULE)hinstance);
    120         }
     135        }       
    121136  }
    122137}
     
    185200                      "WNETAP32", "MPR", "OLE32", "ADVAPI32", "COMMDLG",
    186201                      "WINSPOOL", "SHELL32", "TAPI32", "CAPI32", "VERSION",
    187                       "WSOCK32"};
     202                      "WSOCK32", "COMCTL32"};
    188203//******************************************************************************
    189204BOOL Win32Dll::isSystemDll(char *szFileName)
     
    249264    }
    250265
    251     //Add to lookkup table, so we don't have to call DosQueryProcAddr
     266    //Add to lookup table, so we don't have to call DosQueryProcAddr
    252267    //multiple times for the same api (when imported by other dlls)
    253268    AddNameExport(apiaddr, name, 0);
  • trunk/src/kernel32/wprocess.cpp

    r126 r130  
    1 /* $Id: wprocess.cpp,v 1.11 1999-06-20 10:55:36 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.12 1999-06-20 12:46:09 sandervl Exp $ */
    22
    33/*
     
    3737USHORT    ProcessTIBSel = 0;
    3838DWORD    *TIBFlatPtr    = 0;
     39
     40extern "C" ULONG QueryExceptionChain();
    3941
    4042//******************************************************************************
     
    104106   }
    105107   dprintf(("InitializeTIB setup TEB with selector %x", tibsel));
     108   dprintf(("InitializeTIB: FS(%x):[0] = %x", GetFS(), QueryExceptionChain()));
    106109   return winteb;
    107110#else
     
    119122 THDB  *thdb;
    120123
    121    dprintf(("DestroyTIB: FS = %x", GetFS()));
     124   dprintf(("DestroyTIB: FS     = %x", GetFS()));
     125   dprintf(("DestroyTIB: FS:[0] = %x", QueryExceptionChain()));
    122126
    123127   winteb = (TEB *)TIBFlatPtr;
     
    134138   else dprintf(("Already destroyed TIB"));
    135139
     140   dprintf(("DestroyTIB: FS(%x):[0] = %x", GetFS(), QueryExceptionChain()));
    136141   TIBFlatPtr = NULL;
    137142   return;
     
    225230  RegisterExe(Win32TableId, NameTableId, VersionResId, Pe2lxVersion, hinstance);
    226231
    227   dprintf(("RegisterResourceUsage: FS = %x", GetFS()));
     232  dprintf(("RegisterResourceUsage: FS(%x):[0] = %x", GetFS(), QueryExceptionChain()));
    228233}
    229234//******************************************************************************
     
    315320{
    316321  dprintf(("KERNEL32:  ExitProcess %d\n", exitcode));
    317 
    318 #ifdef WIN32_TIBSEL
    319   //Restore original OS/2 TIB selector
    320   DestroyTIB();
    321 #endif
     322  dprintf(("KERNEL32:  ExitProcess FS = %x\n", GetFS()));
    322323
    323324  //avoid crashes since win32 & OS/2 exception handler aren't identical
     
    327328    iConsoleWaitClose();
    328329
    329   try {
    330      Win32DllExitList(-1);
    331   }
    332   catch(...) {
    333     dprintf(("dll exitlist exception\n"));
    334   }
    335 
    336 #ifndef WIN32_TIBSEL
     330  Win32DllExitList(0);
     331
     332  //Restore original OS/2 TIB selector
     333  DestroyTIB();
    337334  SetExceptionChain((ULONG)-1);
    338 #endif
     335
    339336  O32_ExitProcess(exitcode);
    340337}
Note: See TracChangeset for help on using the changeset viewer.