Changeset 8548 for trunk/src


Ignore:
Timestamp:
Jun 2, 2002, 2:42:09 PM (23 years ago)
Author:
sandervl
Message:

LogExcpetion: check lockcount before changing it on entry

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

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

    r8339 r8548  
    1 /* $Id: exceptions.cpp,v 1.58 2002-04-30 09:36:09 sandervl Exp $ */
     1/* $Id: exceptions.cpp,v 1.59 2002-06-02 12:42:09 sandervl Exp $ */
    22
    33/*
     
    11331133  //SvL: Check if exception inside debug fprintf -> if so, clear lock so
    11341134  //     next dprintf won't wait forever
    1135   LogException(ENTER_EXCEPTION);
     1135  int prevlock = LogException(ENTER_EXCEPTION);
    11361136
    11371137  /* Access violation at a known location */
     
    13281328  }
    13291329continuesearch:
    1330   LogException(LEAVE_EXCEPTION);
     1330  LogException(LEAVE_EXCEPTION, prevlock);
    13311331  return XCPT_CONTINUE_SEARCH;
    13321332
    13331333continueexecution:
    1334   LogException(LEAVE_EXCEPTION);
     1334  LogException(LEAVE_EXCEPTION, prevlock);
    13351335  return XCPT_CONTINUE_EXECUTION;
    13361336}
  • trunk/src/kernel32/exceptutil.h

    r8401 r8548  
    1 /* $Id: exceptutil.h,v 1.13 2002-05-10 14:55:11 sandervl Exp $ */
     1/* $Id: exceptutil.h,v 1.14 2002-06-02 12:42:09 sandervl Exp $ */
    22
    33/*
     
    4242#define ENTER_EXCEPTION 0
    4343#define LEAVE_EXCEPTION 1
    44 void LogException(int state);
     44int LogException(int state, int prevlock = 0);
    4545
    4646
  • trunk/src/kernel32/misc.cpp

    r8021 r8548  
    1 /* $Id: misc.cpp,v 1.46 2002-02-26 17:01:23 sandervl Exp $ */
     1/* $Id: misc.cpp,v 1.47 2002-06-02 12:42:09 sandervl Exp $ */
    22
    33/*
     
    495495//handler will hang the process
    496496//******************************************************************************
    497 void LogException(int state)
     497int LogException(int state, int prevlock)
    498498{
    499499    TEB *teb = GetThreadTEB();
    500 
    501     if (!teb) return;
     500    int  ret = 0;
     501
     502    if (!teb) return 0;
    502503
    503504#if !defined(__EMX__)
     
    514515#endif
    515516#endif
     517        ret = (*lock);
    516518        if (state == ENTER_EXCEPTION)
    517519        {
    518             (*lock)--;
     520            if((*lock) > 0) (*lock)--;
    519521        }
    520522        else
    521523        { //LEAVE_EXCEPTION
    522             (*lock)++;
     524            if(prevlock) (*lock)++;
    523525        }
    524526    }
     
    528530// I wanna have this compile, so we'll address problems later.
    529531#endif
     532    return ret;
    530533}
    531534//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.