mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Added helper application to create device reports on Linux systems without .NET framework available.
This commit is contained in:
22
DiscImageChef.Device.Report/atapi.c
Normal file
22
DiscImageChef.Device.Report/atapi.c
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by claunia on 12/12/17.
|
||||
//
|
||||
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "ata.h"
|
||||
#include "atapi.h"
|
||||
|
||||
int IdentifyPacket(int fd, unsigned char **buffer, AtaErrorRegistersCHS **errorRegisters)
|
||||
{
|
||||
*buffer = malloc(512);
|
||||
memset(*buffer, 0, 512);
|
||||
AtaRegistersCHS registers;
|
||||
memset(®isters, 0, sizeof(AtaRegistersCHS));
|
||||
|
||||
registers.command = ATA_IDENTIFY_PACKET_DEVICE;
|
||||
|
||||
int error = SendAtaCommandChs(fd, registers, errorRegisters, ATA_PROTOCOL_PIO_IN, ATA_TRANSFER_NONE, *buffer, 512, 0);
|
||||
|
||||
return error;
|
||||
}
|
||||
Reference in New Issue
Block a user