Changeset 1403


Ignore:
Timestamp:
Oct 22, 1999, 8:07:24 PM (26 years ago)
Author:
sandervl
Message:

exception handler changes + EB's HeapReAlloc fix

Location:
trunk/src/kernel32
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/kernel32/KERNEL32.CPP

    r1291 r1403  
    1 /* $Id: KERNEL32.CPP,v 1.22 1999-10-14 15:15:22 phaller Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.23 1999-10-22 18:07:20 sandervl Exp $ */
    22
    33/*
     
    577577{
    578578    dprintf(("KERNEL32:  OS2MulDiv %d*%d/%d\n", arg1, arg2, arg3));
     579    if(arg3 == 0)
     580        return 0;
     581
    579582    return O32_MulDiv(arg1, arg2, arg3);
    580583}
     
    808811
    809812//  return(WIN32OS2_VERSION);
    810   return (0x0);
     813  return (0x00000400);
    811814}
    812815//******************************************************************************
  • TabularUnified trunk/src/kernel32/exceptions.cpp

    r1287 r1403  
    1 /* $Id: exceptions.cpp,v 1.25 1999-10-14 12:30:01 sandervl Exp $ */
     1/* $Id: exceptions.cpp,v 1.26 1999-10-22 18:07:18 sandervl Exp $ */
    22
    33/*
     
    7171static PEXCEPTION_HANDLER           StartupCodeHandler = NULL;
    7272
    73 extern "C" PWINEXCEPTION_FRAME QueryExceptionChain();
    7473extern "C" PWINEXCEPTION_FRAME GetExceptionRecord(ULONG offset, ULONG segment);
    7574
     
    10251024                }
    10261025        }
     1026        else    return XCPT_CONTINUE_SEARCH; //pass on to OS/2 RTL or app exception handler
     1027
    10271028        dprintf(("KERNEL32: OS2ExceptionHandler: Continue and kill\n"));
    10281029        pCtxRec->ctx_RegEip = (ULONG)KillWin32Process;
     
    10731074
    10741075  DosSetExceptionHandler(pExceptRec);
     1076  dprintf(("OS2SetExceptionHandler: exception chain %x (old %x)", pExceptRec, pExceptRec->prev_structure));
    10751077}
    10761078
     
    11271129    return;
    11281130
    1129   orgframe = QueryExceptionChain();
     1131  orgframe = (PWINEXCEPTION_FRAME)QueryExceptionChain();
    11301132  if((int)orgframe == 0 ||
    11311133     (int)orgframe == -1)
  • TabularUnified trunk/src/kernel32/exceptutil.h

    r634 r1403  
    1 /* $Id: exceptutil.h,v 1.2 1999-08-22 22:11:21 sandervl Exp $ */
     1/* $Id: exceptutil.h,v 1.3 1999-10-22 18:07:19 sandervl Exp $ */
    22
    33/*
     
    2020void  __cdecl SetExceptionChain(DWORD);
    2121
     22extern "C" PVOID QueryExceptionChain();
     23
    2224void  DisableFPUExceptions();
    2325ULONG GetDllEntryPoint();
  • TabularUnified trunk/src/kernel32/lfile.cpp

    r1155 r1403  
    1 /* $Id: lfile.cpp,v 1.4 1999-10-06 15:00:27 phaller Exp $ */
     1/* $Id: lfile.cpp,v 1.5 1999-10-22 18:07:21 sandervl Exp $ */
    22
    33/*
     
    175175   ULONG rc;
    176176
    177    dprintf(("KERNEL32: _lread(%08xh, %08xh, %08xh)\n",
    178             arg1,
    179             arg2,
    180             arg3));
     177//   dprintf(("KERNEL32: _lread(%08xh, %08xh, %08xh)\n",
     178//            arg1,
     179//            arg2,
     180//            arg3));
    181181
    182182   if (!ReadFile(arg1,
     
    187187      rc = -1;
    188188
    189    dprintf(("KERNEL32: _lread returns %08xh.",
    190             rc));
     189//   dprintf(("KERNEL32: _lread returns %08xh.",
     190//            rc));
    191191
    192192   return rc;
  • TabularUnified trunk/src/kernel32/os2heap.cpp

    r1118 r1403  
    1 /* $Id: os2heap.cpp,v 1.11 1999-10-04 09:55:56 sandervl Exp $ */
     1/* $Id: os2heap.cpp,v 1.12 1999-10-22 18:07:21 sandervl Exp $ */
    22
    33/*
     
    262262  HEAPELEM *helem = (HEAPELEM *)((char *)lpMem - sizeof(HEAPELEM));
    263263  LPVOID lpNewMem;
    264   int    i;
     264  int    i, oldSize;
    265265
    266266  if (dwBytes == 0) return NULL;         // intercept stupid parameters
     
    277277  }
    278278
    279   if (Size(0,lpMem) == dwBytes) return lpMem; // if reallocation with same size
    280                                                 // don't do anything
    281 
    282 //  dprintf(("OS2Heap::ReAlloc %X %X %d\n", dwFlags, lpMem, dwBytes));
     279  oldSize = Size(0,lpMem);
     280  if (oldSize == dwBytes) return lpMem; // if reallocation with same size
     281                                        // don't do anything
    283282  lpNewMem = Alloc(dwFlags, dwBytes);
    284   memcpy(lpNewMem, lpMem, Size(0, lpMem));
     283  memcpy(lpNewMem, lpMem, dwBytes < oldSize ? dwBytes : oldSize);
    285284  Free(0, lpMem);
    286285
    287   dassert(lpNewMem, ("OS2Heap::ReAlloc, no more memory left\n"));
     286  if(lpNewMem == NULL)
     287  {
     288     dprintf(("OS2Heap::ReAlloc, no more memory left\n"));
     289  }
    288290
    289291  return(lpNewMem);
  • TabularUnified trunk/src/kernel32/wprocess.cpp

    r1284 r1403  
    1 /* $Id: wprocess.cpp,v 1.38 1999-10-14 09:57:38 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.39 1999-10-22 18:07:24 sandervl Exp $ */
    22
    33/*
     
    5252DWORD    *TIBFlatPtr    = 0;
    5353
    54 extern "C" ULONG QueryExceptionChain();
    55 
    56 
    5754//******************************************************************************
    5855//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.