ok, heres the structure
VB Code:
<StructLayout(LayoutKind.Sequential)> _
Public Structure TOC
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> _
Dim TOC_LEN() As Byte
Dim FirstTrack As Byte
Dim LastTrack As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=800)> _
Dim TrackInfo() As Byte
End Structure
VB Code:
'Heres where the buffer is allocated
Dim xTOC as new TOC
Dim memptr As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(xToc))
Marshal.StructureToPtr(xToc, memptr, False)
'This is now passed to a api call to be filled
VB Code:
'Heres where i try to read the data the was put intot the structure by the api call
Dim Data As TOC = CType(Marshal.PtrToStructure(psrb.SRB_BufPointer, GetType(TOC)), TOC)
'none of the values in data are set???