[AaruFormat] Implement ReadMediaTag.

This commit is contained in:
2025-10-11 21:33:49 +01:00
parent 31c8166738
commit 5d06b49781
2 changed files with 22 additions and 3 deletions

View File

@@ -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)])]

View File

@@ -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();