Added ATA IOCTLs.

This commit is contained in:
2015-10-07 02:15:31 +01:00
parent 97c8d54b72
commit 7fa4c3fbeb
7 changed files with 140 additions and 5 deletions

View File

@@ -16,8 +16,8 @@ namespace DiscImageChef.Devices.Windows
[MarshalAs(UnmanagedType.U4)] FileAttributes flagsAndAttributes,
IntPtr templateFile);
[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool DeviceIoControl(
[DllImport("Kernel32.dll", SetLastError = true, EntryPoint="ioctl", CharSet = CharSet.Auto)]
public static extern bool DeviceIoControlScsi(
SafeFileHandle hDevice,
uint IoControlCode,
ref ScsiPassThroughDirectAndSenseBuffer InBuffer,
@@ -28,6 +28,18 @@ namespace DiscImageChef.Devices.Windows
IntPtr Overlapped
);
[DllImport("Kernel32.dll", SetLastError = true, EntryPoint="ioctl", CharSet = CharSet.Auto)]
public static extern bool DeviceIoControlAta(
SafeFileHandle hDevice,
uint IoControlCode,
ref AtaPassThroughDirect InBuffer,
uint nInBufferSize,
ref AtaPassThroughDirect OutBuffer,
uint nOutBufferSize,
ref uint pBytesReturned,
IntPtr Overlapped
);
[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool CloseHandle(SafeFileHandle hDevice);
}