|
crystaldiskinfo源码中判断ATA盘类型的语句在这儿:
DWORD CAtaSmart::GetTransferMode(WORD w63, WORD w76, WORD w88, CString ¤t, CString &max, CString &type, INTERFACE_TYPE* interfaceType)
{
DWORD tm = TRANSFER_MODE_PIO;
current = max = _T("");
type = _T("Parallel ATA");
*interfaceType = INTERFACE_TYPE_PATA;
// Multiword DMA or PIO
if(w63 & 0x0700)
{
tm = TRANSFER_MODE_PIO_DMA;
current = max = _T("PIO / DMA");
}
// Ultara DMA Max Transfer Mode
if(w88 & 0x0040){tm = TRANSFER_MODE_ULTRA_DMA_133; max = _T("Ultra DMA/133");}
else if(w88 & 0x0020){tm = TRANSFER_MODE_ULTRA_DMA_100; max = _T("Ultra DMA/100");}
else if(w88 & 0x0010){tm = TRANSFER_MODE_ULTRA_DMA_66; max = _T("Ultra DMA/66");}
else if(w88 & 0x0008){tm = TRANSFER_MODE_ULTRA_DMA_44; max = _T("Ultra DMA/44");}
else if(w88 & 0x0004){tm = TRANSFER_MODE_ULTRA_DMA_33; max = _T("Ultra DMA/33");}
else if(w88 & 0x0002){tm = TRANSFER_MODE_ULTRA_DMA_25; max = _T("Ultra DMA/25");}
else if(w88 & 0x0001){tm = TRANSFER_MODE_ULTRA_DMA_16; max = _T("Ultra DMA/16");}
// Ultara DMA Current Transfer Mode
if(w88 & 0x4000){current = _T("Ultra DMA/133");}
else if(w88 & 0x2000){current = _T("Ultra DMA/100");}
else if(w88 & 0x1000){current = _T("Ultra DMA/66");}
else if(w88 & 0x0800){current = _T("Ultra DMA/44");}
else if(w88 & 0x0400){current = _T("Ultra DMA/33");}
else if(w88 & 0x0200){current = _T("Ultra DMA/25");}
else if(w88 & 0x0100){current = _T("Ultra DMA/16");}
// Serial ATA
if(w76 != 0x0000 && w76 != 0xFFFF)
{
current = max = _T("SATA/150");
type = _T("Serial ATA");
*interfaceType = INTERFACE_TYPE_SATA;
}
if(w76 & 0x0010){tm = TRANSFER_MODE_UNKNOWN; current = max = _T("Unknown");}
else if(w76 & 0x0008){tm = TRANSFER_MODE_SATA_600; current = max = _T("SATA/600");}
else if(w76 & 0x0004){tm = TRANSFER_MODE_SATA_300; current = max = _T("SATA/300");}
else if(w76 & 0x0002){tm = TRANSFER_MODE_SATA_150; current = max = _T("SATA/150");}
return tm;
} |
|