Exemplo n.º 1
0
static bool writeIconDir( FullIconDir * dir, WResID * name, ResMemFlags flags,
                         int *err_code )
/****************************************************************************/
{
    bool                error;
    FullIconDirEntry *  entry;
    ResLocation         loc;

    loc.start = SemStartResource();
    error = ResWriteIconCurDirHeader( &(dir->Header), CurrResFile.handle );

    for( entry = dir->Head; !error && entry != NULL; entry = entry->Next ) {
        error = ResWriteIconDirEntry( &(entry->Entry.Res), CurrResFile.handle );
    }

    if( !error ) {
        loc.len = SemEndResource( loc.start );
#ifdef PREPROC_BUG
        SemAddResourceFree( name, WResIDFromNum( (long)(pointer_int)RT_GROUP_ICON ),
                            flags, loc );
#else
        SemAddResourceFree( name, WResIDFromNum( (long)14 ),
                            flags, loc );
#endif
    } else {
        *err_code = LastWresErr();
    }

    return( error );
} /* writeIconDir */
Exemplo n.º 2
0
static bool writeIconDir( FullIconDir * dir, WResID * name, ResMemFlags flags,
                         int *err_code )
/****************************************************************************/
{
    bool                error;
    FullIconDirEntry *  entry;
    ResLocation         loc;

    loc.start = SemStartResource();
    error = ResWriteIconCurDirHeader( &(dir->Header), CurrResFile.fid );

    for( entry = dir->Head; !error && entry != NULL; entry = entry->Next ) {
        error = ResWriteIconDirEntry( &(entry->Entry.Res), CurrResFile.fid );
    }

    if( !error ) {
        loc.len = SemEndResource( loc.start );
        SemAddResourceFree( name, WResIDFromNum( RESOURCE2INT( RT_GROUP_ICON ) ), flags, loc );
    } else {
        *err_code = LastWresErr();
    }

    return( error );
} /* writeIconDir */