ATA pass through needs buffer position to be relative to structure so use accordingly.

This commit is contained in:
2017-09-07 16:48:25 +01:00
parent 8cc805f031
commit 95e0d3f596
3 changed files with 135 additions and 103 deletions

View File

@@ -74,6 +74,7 @@ namespace DiscImageChef.Devices.Windows
/// <summary>
/// Indicates transfer direction and kind of operation
/// </summary>
[MarshalAs(UnmanagedType.U2)]
public AtaFlags AtaFlags;
/// <summary>
/// Indicates IDE port or bus, set by driver
@@ -104,7 +105,7 @@ namespace DiscImageChef.Devices.Windows
/// </summary>
public uint ReservedAsUlong;
/// <summary>
/// Pointer to data buffer
/// Pointer to data buffer relative to start of this structure
/// </summary>
public IntPtr DataBuffer;
/// <summary>
@@ -117,6 +118,15 @@ namespace DiscImageChef.Devices.Windows
public AtaTaskFile CurrentTaskFile;
}
[StructLayout(LayoutKind.Sequential)]
struct AtaPassThroughDirectWithBuffer
{
public AtaPassThroughDirect aptd;
public uint filler;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64 * 512)]
public byte[] dataBuffer;
}
[StructLayout(LayoutKind.Explicit)]
struct AtaTaskFile
{