| | |
| | | const DWORD dwSize = MAX_PATH; |
| | | char szLogicalDrives[MAX_PATH] = {0}; |
| | | |
| | | FUNCTION_RETURN return_value = FUNC_RET_NOT_AVAIL; |
| | | FUNCTION_RETURN return_value; |
| | | const DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); |
| | | |
| | | if (dwResult > 0) { |
| | |
| | | DiskInfo diskInfo = {}; |
| | | diskInfo.id = (int)ndrives; |
| | | diskInfo.label_initialized = true; |
| | | mstrlcpy(diskInfo.device, volName, min(std::size_t{MAX_PATH}, sizeof(volName))); |
| | | mstrlcpy(diskInfo.label, fileSysName, min(sizeof(diskInfos[ndrives].label), sizeof(fileSysName))); |
| | | license::mstrlcpy(diskInfo.device, volName, min(std::size_t{MAX_PATH}, sizeof(volName))); |
| | | license::mstrlcpy(diskInfo.label, fileSysName, min(sizeof(diskInfos[ndrives].label), sizeof(fileSysName))); |
| | | memcpy(diskInfo.disk_sn, &volSerial, sizeof(DWORD)); |
| | | diskInfo.sn_initialized = true; |
| | | diskInfo.preferred = (szSingleDrive[0] == 'C'); |
| | |
| | | return_value = FUNC_RET_OK; |
| | | } else { |
| | | return_value = FUNC_RET_NOT_AVAIL; |
| | | LOG_INFO("No fixed drive were detected"); |
| | | LOG_DEBUG("No fixed drive were detected"); |
| | | } |
| | | |
| | | return return_value; |