Rocket Division Software
http://www.starburnsoftware.com/forum/

C# wrapper crashes upgrading to 7.1.10
http://www.starburnsoftware.com/forum/starburn-sdk-f3/wrapper-crashes-upgrading-t970.html
Page 1 of 1

Author:  mbat [ Mon Apr 02, 2007 3:11 pm ]
Post subject:  C# wrapper crashes upgrading to 7.1.10

hi!
I developed a c# wrapper for starburn api that work quite well with version 6.6.30, but crashes randomly with 7.1.10. The api and the various structures don't seem to have changed from 6.6.30.
What could it be?

thanks,
Massimo

Author:  anton (staff) [ Mon Apr 02, 2007 4:24 pm ]
Post subject:  Re: C# wrapper crashes upgrading to 7.1.10

I think you've originally had some bugs inside your code... With 7.1.10 (and 7.2.20 we've just released) we've used newer version of WDK to build the code. So environment, libraries etc changed. This could be a reason.

In any case you can send us your application (better in source of course) and we'll be happy to take a look at it.

Thanks!

mbat wrote:
hi!
I developed a c# wrapper for starburn api that work quite well with version 6.6.30, but crashes randomly with 7.1.10. The api and the various structures don't seem to have changed from 6.6.30.
What could it be?

thanks,
Massimo

Author:  mbat [ Tue Apr 03, 2007 7:19 am ]
Post subject: 

Upgraded to 7.2.20. After more accurate analisys, the problem seems related to this call:

Code:
[DllImport("StarBurn.dll", CharSet = CharSet.Ansi)]
public static extern EXCEPTION_NUMBER
StarBurn_CdvdBurnerGrabber_GetTOCInformation(int
  CdvdBurnerGrabber, StringBuilder pExceptionText,
  int ExceptionTextSize, ref int SystemError,
  ref CDB_FAILURE_INFORMATION PCDB_FAILURE_INFORMATION,
  ref TOC_INFORMATION PTOC_INFORMATION);


I suppose TOC_INFORMATION is the key.
My TOC_INFORMATION declaration is:

Code:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public struct TOC_INFORMATION
    {
        public Byte IsValid;
        public Byte IsDVD;
        public UInt16 ProtectedDVDRegions;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=5, ArraySubType=UnmanagedType.AsAny)]
        public Byte[] BusKeyForDiscKey;
        public Byte NumberOfSessions;
        public Byte NumberOfTracks;
        public Byte NumberOfUnsortedEntries;

        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3400, ArraySubType = UnmanagedType.AsAny)]
        public Byte[] my_TOC_ENTRY; //TOC_ENTRY
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1100, ArraySubType = UnmanagedType.AsAny)]
        public Byte[] my_FULL_TOC_ENTRY_RAW; //FULL_TOC_ENTRY_RAW
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1100, ArraySubType = UnmanagedType.AsAny)]
        public Byte[] my_FULL_TOC_ENTRY_RAW__Unsorted; //FULL_TOC_ENTRY_RAW
    }


[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public struct TOC_ENTRY
    {
        public Byte IsValid;
        public Byte TrackNumber;
        public Byte SessionNumber;
        public Int32 StartingLBA;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=3, ArraySubType=UnmanagedType.AsAny)]
        public Byte[] StartingMSF;
        public Int32 EndingLBA;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=3, ArraySubType=UnmanagedType.AsAny)]
        public Byte[] EndingMSF;
        public Byte IsMCNAvailable;
        public Byte IsISRCAvailable;
        public Byte IsFourChannelsAudio;
        public Byte IsPreEmphasisAudio;
        public Byte IsData;
        public Byte IsAudio;
        public Byte IsDigitalCopyProhibited;
        public Byte TrackMode;
        public Byte MODE2Form;
        public UInt32 LBSizeInBytes;
        public Int32 Index00;
    }


[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public struct FULL_TOC_ENTRY_RAW
    {
        public Byte SessionNumber;
        public Byte CONTROL_ADR; // :4, :4
        public Byte TNO;
        public Byte POINT;
        public Byte Min;
        public Byte Sec;
        public Byte Frame;
        public Byte Zero;
        public Byte PMIN;
        public Byte PSEC;
        public Byte PFRAME;
    }



thanks a lot for support :D
Massimo

Author:  anton (staff) [ Tue Apr 03, 2007 7:33 am ]
Post subject: 

Massimo,

sizeof( TOC ) changed after 6.6.30 (b/c we had to support more tracks, old format was not working for very large number of sessions + reserved and system tracks). Please synchronize your declaration with the one from StarBurn.h.

We're really sorry but there was no way to keep it AS IS and backward compatible. For most of the people (who did re-built of their projects with the upgrade) it worked, but not for you... Sorry again!

Thank you!

Author:  mbat [ Tue Apr 03, 2007 8:14 am ]
Post subject: 

Solved!
The problem was the following:
v6.6.30 - NUMBER_OF_TRACKS = NUMBER_OF_RAW_TRACKS = 100
v7.2.20 - NUMBER_OF_TRACKS = NUMBER_OF_RAW_TRACKS * 4 + 1

In the C# declaration, the last filed of TOC_INFORMATION must change the 'SizeConst' parameter from 11*100=1100 to 11*(100*4+1) = 4411

thanks for quick answers!

Massimo.

Author:  anton (staff) [ Tue Apr 03, 2007 8:24 am ]
Post subject: 

Nice to know everything is fine now :)

mbat wrote:
Solved!
The problem was the following:
v6.6.30 - NUMBER_OF_TRACKS = NUMBER_OF_RAW_TRACKS = 100
v7.2.20 - NUMBER_OF_TRACKS = NUMBER_OF_RAW_TRACKS * 4 + 1

In the C# declaration, the last filed of TOC_INFORMATION must change the 'SizeConst' parameter from 11*100=1100 to 11*(100*4+1) = 4411

thanks for quick answers!

Massimo.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/