Вам, вероятно, лучше искать команду TRIM.
BOOL IsDriveSSD(){
DWORD dwBytesReturned;
HANDLE volhand = INVALID_HANDLE_VALUE;
try{
volhand = CreateFile("\\\\.\\PHYSICALDRIVE0", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
}
catch(...){
volhand = INVALID_HANDLE_VALUE;
}
if (volhand == INVALID_HANDLE_VALUE) return FALSE;
// Test 1: See if we have a TRIM command, if so, we're SSD.
STORAGE_PROPERTY_QUERY spq;
DEVICE_TRIM_DESCRIPTOR dtr;
memset(&dtr,0,sizeof(DEVICE_TRIM_DESCRIPTOR));
memset(&spq,0,sizeof(STORAGE_PROPERTY_QUERY));
spq.PropertyId=StorageDeviceTrimProperty;
spq.QueryType=PropertyStandardQuery;
BOOL ret = DeviceIoControl(volhand, IOCTL_STORAGE_QUERY_PROPERTY,
&spq,sizeof(spq),
&dtr,sizeof(dtr),
&dwBytesReturned,FALSE);
if(ret){
ret = dtr.TrimEnabled;
}
CloseHandle(volhand);
return ret;
}