mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[AaruFormat] Implement ReadSectorLong
This commit is contained in:
@@ -62,6 +62,23 @@ public sealed partial class AaruFormat
|
|||||||
return StatusToErrorNumber(res);
|
return StatusToErrorNumber(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer)
|
||||||
|
{
|
||||||
|
buffer = null;
|
||||||
|
uint length = 0;
|
||||||
|
|
||||||
|
Status res = aaruf_read_sector_long(_context, sectorAddress, false, buffer, ref length, out _);
|
||||||
|
|
||||||
|
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
|
||||||
|
|
||||||
|
buffer = new byte[length];
|
||||||
|
|
||||||
|
res = aaruf_read_sector_long(_context, sectorAddress, false, buffer, ref length, out _);
|
||||||
|
|
||||||
|
return StatusToErrorNumber(res);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// AARU_EXPORT int32_t AARU_CALL aaruf_read_media_tag(void *context, uint8_t *data, const int32_t tag, uint32_t *length)
|
// AARU_EXPORT int32_t AARU_CALL aaruf_read_media_tag(void *context, uint8_t *data, const int32_t tag, uint32_t *length)
|
||||||
@@ -76,10 +93,18 @@ public sealed partial class AaruFormat
|
|||||||
private static partial Status aaruf_read_sector(IntPtr context, ulong sectorAddress,
|
private static partial Status aaruf_read_sector(IntPtr context, ulong sectorAddress,
|
||||||
[MarshalAs(UnmanagedType.I4)] bool negative, byte[] data,
|
[MarshalAs(UnmanagedType.I4)] bool negative, byte[] data,
|
||||||
ref uint length, out byte sectorStatus);
|
ref uint length, out byte sectorStatus);
|
||||||
// AARU_EXPORT int32_t AARU_CALL aaruf_read_track_sector(void *context, uint8_t *data, const uint64_t sector_address,
|
|
||||||
|
// AARU_EXPORT int32_t AARU_CALL aaruf_read_track_sector(void *context, uint8_t *data, const uint64_t sector_address,
|
||||||
// uint32_t *length, const uint8_t track, uint8_t *sector_status)
|
// uint32_t *length, const uint8_t track, uint8_t *sector_status)
|
||||||
[LibraryImport("libaaruformat", EntryPoint = "aaruf_read_track_sector", SetLastError = true)]
|
[LibraryImport("libaaruformat", EntryPoint = "aaruf_read_track_sector", SetLastError = true)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
|
||||||
private static partial Status aaruf_read_track_sector(IntPtr context, byte[] data, ulong sectorAddress,
|
private static partial Status aaruf_read_track_sector(IntPtr context, byte[] data, ulong sectorAddress,
|
||||||
ref uint length, byte track, out byte sectorStatus);
|
ref uint length, byte track, out byte sectorStatus);
|
||||||
|
// AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_long(void *context, const uint64_t sector_address, bool negative,
|
||||||
|
// uint8_t *data, uint32_t *length, uint8_t *sector_status)
|
||||||
|
[LibraryImport("libaaruformat", EntryPoint = "aaruf_read_sector_long", SetLastError = true)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
|
||||||
|
private static partial Status aaruf_read_sector_long(IntPtr context, ulong sectorAddress,
|
||||||
|
[MarshalAs(UnmanagedType.I4)] bool negative, byte[] data,
|
||||||
|
ref uint length, out byte sectorStatus);
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,6 @@ public sealed partial class AaruFormat
|
|||||||
|
|
||||||
#region IWritableOpticalImage Members
|
#region IWritableOpticalImage Members
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer) => throw new NotImplementedException();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer) =>
|
public ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer) =>
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
Reference in New Issue
Block a user