mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[AaruFormat] On Open retrieve geometry from library.
This commit is contained in:
@@ -79,4 +79,11 @@ public sealed partial class AaruFormat
|
||||
[LibraryImport("libaaruformat", EntryPoint = "aaruf_get_drive_firmware_revision", SetLastError = true)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
|
||||
private static partial Status aaruf_get_drive_firmware_revision(IntPtr context, byte[] buffer, ref int length);
|
||||
|
||||
// AARU_EXPORT int32_t AARU_CALL aaruf_get_geometry(const void *context, uint32_t *cylinders, uint32_t *heads,
|
||||
// uint32_t *sectors_per_track)
|
||||
[LibraryImport("libaaruformat", EntryPoint = "aaruf_get_geometry", SetLastError = true)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
|
||||
private static partial Status aaruf_get_geometry(IntPtr context, out uint cylinders, out uint heads,
|
||||
out uint sectorsPerTrack);
|
||||
}
|
||||
@@ -201,7 +201,15 @@ public sealed partial class AaruFormat
|
||||
_imageInfo.DriveFirmwareRevision = StringHandlers.CToString(buffer, Encoding.Unicode, true);
|
||||
}
|
||||
|
||||
// TODO: geometry
|
||||
ret = aaruf_get_geometry(_context, out uint cylinders, out uint heads, out uint sectorsPerTrack);
|
||||
|
||||
if(ret == Status.Ok)
|
||||
{
|
||||
_imageInfo.Cylinders = cylinders;
|
||||
_imageInfo.Heads = heads;
|
||||
_imageInfo.SectorsPerTrack = sectorsPerTrack;
|
||||
}
|
||||
|
||||
// TODO: metadata from media tags
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
|
||||
Reference in New Issue
Block a user