Beispiel #1
0
ResLocation SemFlushDataElemList( DataElemList *head, bool call_startend )
/************************************************************************/
{
    DataElemList    *curnode;
    DataElemList    *nextnode;
    ResLocation     resLoc;
    int             i;

    curnode = head;
    nextnode = head;
    resLoc.len = 0;
    if( call_startend ) {
        resLoc.start = SemStartResource();
    } else {
        resLoc.start = 0;
    }
    while( nextnode != NULL ) {
        nextnode = curnode->next;
        for( i = 0; i < curnode->count; i++ ) {
            SemWriteRawDataItem( curnode->data[i] );
        }
        RESFREE( curnode );
        curnode = nextnode;
    }
    if( call_startend ) {
        if( CmdLineParms.MSResFormat
          && CmdLineParms.TargetOS == RC_TARGET_OS_WIN32 ) {
            ResWritePadDWord( CurrResFile.fid );
        }
        resLoc.len = SemEndResource( resLoc.start );
    }

    return( resLoc );
}
Beispiel #2
0
bool ResWriteDialogBoxExControl32( DialogBoxExControl32 *control, FILE *fp )
/**************************************************************************/
{
    bool            error;

    error = ResWriteUint32( control->HelpId, fp );
    if( !error ) {
        error = ResWriteUint32( control->ExtendedStyle, fp );
    }
    if( !error ) {
        error = ResWriteUint32( control->Style, fp );
    }
    if( !error ) {
        error = ResWriteDialogSizeInfo( &(control->SizeInfo), fp );
    }
    if( !error ) {
        error = ResWriteUint32( control->ID, fp );
    }
    if( !error ) {
        error = ResWriteDialogControlCommon32( control->ClassID, control->Text, control->ExtraBytes, fp );
    }

    if( !error ) {
        /* padding full record to dword boundary if necessary */
        error = ResWritePadDWord( fp );
    }
    return( error );
}
Beispiel #3
0
bool ResWriteDialogBoxHeader32( DialogBoxHeader32 *head, FILE *fp )
/*****************************************************************/
{
    bool            error;

    error = ResWriteUint32( head->Style, fp );
    if( !error ) {
        error = ResWriteUint32( head->ExtendedStyle, fp );
    }
    if( !error ) {
        error = ResWriteUint16( head->NumOfItems, fp );
    }
    if( !error ) {
        error = ResWriteDialogSizeInfo( &(head->SizeInfo), fp );
    }
    if( !error ) {
        error = ResWriteDialogHeaderCommon32( head, fp, false );
    }
    /* if the font was set output the font name and point size */
    if( !error && (head->Style & DS_SETFONT) ) {
        error = ResWriteUint16( head->PointSize, fp );
        if( !error ) {
            error = ResWriteString( head->FontName, true, fp );
        }
    }

    if( !error ) {
        /* padding full record to dword boundary if necessary */
        error = ResWritePadDWord( fp );
    }
    return( error );
}
Beispiel #4
0
bool ResWriteDialogBoxExHeader32( DialogBoxHeader32 *head, DialogBoxExHeader32short *exhead, FILE *fp )
/*****************************************************************************************************/
{
    bool            error;

    /* Write out the miscellaneous two WORDs 0x0001, 0xFFFF */

    error = ResWriteUint16( 0x0001, fp );
    if( !error ) {
        error = ResWriteUint16( 0xFFFF, fp );
    }
    if( !error ) {
        error = ResWriteUint32( exhead->HelpId, fp );
    }
    if( !error ) {
        error = ResWriteUint32( head->ExtendedStyle, fp );
    }
    if( !error ) {
        error = ResWriteUint32( head->Style, fp );
    }
    if( !error ) {
        error = ResWriteUint16( head->NumOfItems, fp );
    }
    if( !error ) {
        error = ResWriteDialogSizeInfo( &(head->SizeInfo), fp );
    }
    if( !error ) {
        error = ResWriteDialogHeaderCommon32( head, fp, true );
    }
    /* If the font was set, write the font information */
    if( !error && (head->Style & DS_SETFONT) ) {
        error = ResWriteUint16( head->PointSize, fp );
        if( !error ) {
            error = ResWriteUint16( exhead->FontWeight, fp );
        }
        if( !error ) {
            error = ResWriteUint8( exhead->FontItalic, fp );
        }
        if( !error ) {
            error = ResWriteUint8( exhead->FontCharset, fp );
        }
        if( !error ) {
            error = ResWriteString( head->FontName, true, fp );
        }
    }

    if( !error ) {
        /* padding full record to dword boundary if necessary */
        error = ResWritePadDWord( fp );
    }
    return( error );
}
Beispiel #5
0
static bool WRWriteResourceToWRES( WResTypeNode *tnode, WResResNode *rnode,
                                  WResDir new_dir, WResFileID src_fid,
                                  WResFileID dst_fid, bool is32bit )
{
    WResLangType    lt;
    WResLangNode    *lnode;
    uint_32         offset;
    bool            dup;

    if( is32bit ) {
        if( ResWritePadDWord( dst_fid ) ) {
            return( false );
        }
    }

    offset = RESTELL( dst_fid );

    lnode = rnode->Head;

    while( lnode != NULL ) {
        lt = lnode->Info.lang;
        if( WResAddResource( &tnode->Info.TypeName, &rnode->Info.ResName,
                             lnode->Info.MemoryFlags, offset,
                             lnode->Info.Length, new_dir,
                             &lt, &dup ) || dup ) {
            if( dup ) {
                displayDupMsg( &tnode->Info.TypeName, &rnode->Info.ResName );
            }
            return( false );
        }

        if( lnode->data != NULL ) {
            if( !WRCopyResFromDataToFile( lnode->data, lnode->Info.Length, dst_fid ) ) {
                return( false );
            }
        } else {
            if( !WRCopyResFromFileToFile( src_fid, lnode->Info.Offset,
                                          lnode->Info.Length, dst_fid ) ) {
                return( false );
            }
        }
        if( lnode == rnode->Tail ) {
            break;
        }
        lnode = lnode->Next;
        offset += lnode->Info.Length;
    }

    return( true );
}
Beispiel #6
0
bool MResWriteResourceHeader( MResResourceHeader *currhead, WResFileID handle, bool iswin32 )
/*******************************************************************************************/
{
    bool        error;

    if( !iswin32 ) {
        error = ResWriteNameOrOrdinal( currhead->Type, false, handle );
        if( !error ) {
            error = ResWriteNameOrOrdinal( currhead->Name, false, handle );
        }
        if( !error ) {
            error = ResWriteUint16( currhead->MemoryFlags, handle );
        }
        if( !error ) {
            error = ResWriteUint32( currhead->Size, handle );
        }
    } else {
        error = ResWriteUint32( currhead->Size, handle );
        if( !error ) {
            error = ResWriteUint32( MResFindHeaderSize( currhead, true ), handle  );
        }
        if( !error ) {
            error = ResWriteNameOrOrdinal( currhead->Type, true, handle );
        }
        if( !error ) {
            error = ResWriteNameOrOrdinal( currhead->Name, true, handle );
        }
        if( !error ) {
            error = ResWritePadDWord( handle );
        }
        if( !error ) {
            error = ResWriteUint32( currhead->DataVersion, handle );
        }
        if( !error ) {
            error = ResWriteUint16( currhead->MemoryFlags, handle );
        }
        if( !error ) {
            error = ResWriteUint16( currhead->LanguageId, handle );
        }
        if( !error ) {
            error = ResWriteUint32( currhead->Version, handle );
        }
        if( !error ) {
            error = ResWriteUint32( currhead->Characteristics, handle );
        }
    }

    return( error );
} /* MResWriteResourceHeader */