Exemple #1
0
bool BrkCheckWatchLimit( address loc, mad_type_handle th )
{
    bool                enough_iron;
    unsigned long       mult;
    brkp                *wp;
    mad_type_info       mti;
    unsigned            size;

    if( th != MAD_NIL_TYPE_HANDLE ) {
        MADTypeInfo( th, &mti );
        size = mti.b.bits / BITS_PER_BYTE;
        enough_iron = RemoteSetWatch( loc, size, &mult );
    } else {
        enough_iron = TRUE;
    }
    for( wp = BrkList; wp != NULL; wp = wp->next ) {
        if( wp->th == MAD_NIL_TYPE_HANDLE ) continue;
        MADTypeInfo( wp->th, &mti );
        if( !RemoteSetWatch( wp->loc.addr, mti.b.bits / BITS_PER_BYTE, &mult ) ) {
            enough_iron = FALSE;
        }
    }
    if( th != MAD_NIL_TYPE_HANDLE ) {
        RemoteRestoreWatch( loc, size );
    }
    for( wp = BrkList; wp != NULL; wp = wp->next ) {
        if( wp->th == MAD_NIL_TYPE_HANDLE ) continue;
        MADTypeInfo( wp->th, &mti );
        RemoteRestoreWatch( wp->loc.addr, mti.b.bits / BITS_PER_BYTE );
    }
    if( !enough_iron ) {
        return( DlgAreYouNuts( mult ) );
    }
    return( TRUE );
}
Exemple #2
0
static void RemoveOneWP( brkp *bp )
{
    mad_type_info       mti;

    if( bp->status.b.in_place && SectIsLoaded( bp->loc.addr.sect_id,OVL_MAP_EXE ) ) {
        bp->status.b.in_place = false;
        MADTypeInfo( bp->th, &mti );
        RemoteRestoreWatch( bp->loc.addr, mti.b.bits / BITS_PER_BYTE );
    }
}