mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[AaruFormat] Implement ReadMediaTag.
This commit is contained in:
@@ -7,6 +7,28 @@ namespace Aaru.Images;
|
||||
|
||||
public sealed partial class AaruFormat
|
||||
{
|
||||
#region IWritableOpticalImage Members
|
||||
|
||||
/// <inheritdoc />
|
||||
public ErrorNumber ReadMediaTag(MediaTagType tag, out byte[] buffer)
|
||||
{
|
||||
buffer = null;
|
||||
|
||||
uint length = 0;
|
||||
|
||||
Status res = aaruf_read_media_tag(_context, buffer, tag, ref length);
|
||||
|
||||
if(res != Status.Ok) return StatusToErrorNumber(res);
|
||||
|
||||
buffer = new byte[length];
|
||||
|
||||
res = aaruf_read_media_tag(_context, buffer, tag, ref length);
|
||||
|
||||
return StatusToErrorNumber(res);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// AARU_EXPORT int32_t AARU_CALL aaruf_read_media_tag(void *context, uint8_t *data, const int32_t tag, uint32_t *length)
|
||||
[LibraryImport("libaaruformat", EntryPoint = "aaruf_read_media_tag", SetLastError = true)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
|
||||
|
||||
@@ -21,9 +21,6 @@ public sealed partial class AaruFormat
|
||||
|
||||
#region IWritableOpticalImage Members
|
||||
|
||||
/// <inheritdoc />
|
||||
public ErrorNumber ReadMediaTag(MediaTagType tag, out byte[] buffer) => throw new NotImplementedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer) => throw new NotImplementedException();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user