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

LogExcpetion: check lockcount before changing it on entry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.