BOOL CAtaSmart::FillSmartThreshold(ATA_SMART_INFO* asi) { int count = 0; for(int i = 0; i < MAX_ATTRIBUTE; i++) { SMART_THRESHOLD* pst = (SMART_THRESHOLD*)&(asi->SmartReadThreshold[i * sizeof(SMART_THRESHOLD) + 2]); if(pst->Id != 0) { for(int j = 0; j < asi->AttributeCount; j++) { if(pst->Id == asi->Attribute[j].Id) { memcpy(&(asi->Threshold[j]), pst, sizeof(SMART_THRESHOLD)); count++; } } } } ... }