Announcement

Collapse
No announcement yet.

C conversion help: Starburn API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • C conversion help: Starburn API

    Below is some of the C header code for a function I am trying to convert to work in PB. The issue, I believe, is in the DAO_DISC_LAYOUT_ENTRY specifically the __CHAR__TrackName member of the struct. I’ve tried several different ideas but haven't had success. Anyone have any ideas?

    Specific questions:

    How would one create the DAO_DISC_LAYOUT and ENTRY datatypes?
    How would the DECLARE for the DAO_DISC_LAYOUT parameter be passed in the function StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFileAudioUnicode?

    The structure DAO_DISC_LAYOUT contains a dynamic array of entries. How would one do this in PB? Should I just create an area of memory with GLOBALMEM (PB 9 feature) and fill it in the manner required?

    Thanks,

    Brian



    C Structures

    Code:
    //
    // Structure that represents DAO disc layout entry (track)
    //
    // <TABLE>
    // Member                               Definition
    // ----------                           ---------------
    // m__LONG__TrackSizeInLBs              Track size in LBs (logical blocks)
    // m__LONG__TrackStartingLBA            Track starting LBA (logical block address)
    // m__BOOLEAN__IsUnicode				Is name in Unicode format or not (see below)
    // m__CHAR__TrackName					Track name (absolute path & name) in ANSI or Unicode format (see above)
    // m__PVOID__File                       Pointer to internally created disk file object (NULL initially)
    // m__BOOLEAN__IsDataTrack              Is this data track (audio otherwise)
    // m__BOOLEAN__IsRawTrack				Is this raw track (MDF image)
    // m__BOOLEAN__IsAudioExTrack			Is this extended audio track (2448 UCHARs/logical block)
    // </TABLE>
    
    typedef struct _DAO_DISC_LAYOUT_ENTRY
    {
        LONG m__LONG__TrackSizeInLBs;					// Track size in LBs (logical blocks)
    
        LONG m__LONG__TrackStartingLBA;					// Track starting LBA (logical block address)
    
    	BOOLEAN m__BOOLEAN__IsUnicode;					// Is name in Unicode format or not (see below)
    
        CHAR m__CHAR__TrackName[ ( MAX_PATH * 3 ) ];	// Track name (absolute path & name) in ANSI or Unicode format (see above)
    
        PVOID m__PVOID__File;							// Pointer to internally created disk file object (NULL initially)
    		
        BOOLEAN m__BOOLEAN__IsDataTrack;				// Is this data track (audio otherwise)
    
    	BOOLEAN m__BOOLEAN__IsRawTrack;					// Is this raw track (MDF image)
    
    	BOOLEAN m__BOOLEAN__IsAudioExTrack;				// Is this extended audio track (2448 UCHARs/logical block)
    
    } *PDAO_DISC_LAYOUT_ENTRY, DAO_DISC_LAYOUT_ENTRY;
    
    //
    // Structure that represents DAO disc layout 
    //
    // <TABLE>
    // Member                               Definition
    // ----------                           ---------------
    // m__LONG__NumberOfEntries             Number of entries
    // m__DAO_DISC_LAYOUT_ENTRY             DAO disc layout entries
    // </TABLE>
    
    typedef struct _DAO_DISC_LAYOUT
    {
        LONG m__LONG__NumberOfEntries;										// Number of entries
    
        DAO_DISC_LAYOUT_ENTRY m__DAO_DISC_LAYOUT_ENTRY[ NUMBER_OF_TRACKS ];	// DAO disc layout entries
    
    } *PDAO_DISC_LAYOUT, DAO_DISC_LAYOUT;
    C Function Call

    Code:
    STARBURN_IMPEX_API
    EXCEPTION_NUMBER
    __stdcall
    StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFileAudioUnicode(
        IN PVOID p__PVOID__CdvdBurnerGrabber,
        OUT PCHAR p__PCHAR__ExceptionText,
        IN ULONG p__ULONG__ExceptionTextSizeInUCHARs,
        OUT PULONG p__PULONG__SystemError,
        OUT PCDB_FAILURE_INFORMATION p__PCDB_FAILURE_INFORMATION,
        IN PDAO_DISC_LAYOUT p__PDAO_DISC_LAYOUT,
        IN BOOLEAN p__BOOLEAN__IsXA,
        IN BOOLEAN p__BOOLEAN__IsTestWrite,
        IN BOOLEAN p__BOOLEAN__IsNextSessionAllowed,
    	IN BOOLEAN p__BOOLEAN__IsSubChannelRepairRequired,
        IN ULONG p__ULONG__WriteReportDelayInSeconds,
        IN ULONG p__ULONG__BufferStatusReportDelayInSeconds
        );

  • #2
    How would one create the DAO_DISC_LAYOUT and ENTRY datatypes?
    Code:
    TYPE DAO_DISC_LAYOUT_ENTRY
       m__LONG__TrackSizeInLBs AS LONG
       m__LONG__TrackStartingLBA AS LONG
       m__BOOLEAN__IsUnicode AS BYTE
       m__CHAR__TrackName AS ASCIIZ * %MAX_PATH * 3
       m__PVOID__File AS DWORD
       m__BOOLEAN__IsDataTrack AS BYTE
       m__BOOLEAN__IsRawTrack AS BYTE
       m__BOOLEAN__IsAudioExTrack AS BYTE
    END TYPE
    
    TYPE DAO_DISC_LAYOUT
       m__LONG__NumberOfEntries AS LONG
       m__DAO_DISC_LAYOUT_ENTRY (0 TO %NUMBER_OF_TRACKS - 1) AS DAO_DISC_LAYOUT_ENTRY
    END TYPE
    Where %NUMBER_OF_TRACKS will be the maximum to be used. There is no problem if there are more than the number specified by m__LONG__NumberOfEntries because the called function will only read m__LONG__NumberOfEntries elements.

    How would the DECLARE for the DAO_DISC_LAYOUT parameter be passed in the function StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFile AudioUnicode?
    Declare it as BYREF p__PDAO_DISC_LAYOUT AS DAO_DISC_LAYOUT and pass a variable DIMed as DAO_DISC_LAYOUT.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment

    Working...
    X