Ich habe den Code von Benmik getestet und merkwürdigerweise funktioniert er nur auf meinem Windows 10 PC. Auf einem Windows 7 PC mit der gleichen SSD bekomme ich hier:
Delphi-Quellcode:
if DeviceIoControl(h,IOCTL_ATA_PASS_THROUGH,
@ATAIdentifyDeviceQuery,SizeOf(ATAIdentifyDeviceQuery),
@ATAIdentifyDeviceQuery,SizeOf(ATAIdentifyDeviceQuery),
RSize,nil) = False then
begin
RaiseLastOSError;
end;
den Fehler:
The program issued a command but the command length is incorrect.
Ich vermute dass diese Struktur:
Delphi-Quellcode:
IOCTL_ATA_PASS_THROUGH = (IOCTL_SCSI_BASE shl 16) or
((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
($040B shl 2) or
(METHOD_BUFFERED);
nicht ganz richtig ist.
Für Hilfe wäre ich dankbar.