///< 获取系统中所有的盘符
int GetAllDrives(std::vector<CStringA>& vecDrives)
{
char szbuf[MAX_PATH] = {0};
GetLogicalDriveStringsA(MAX_PATH,szbuf);
int nCount = 0;
char * pDrive = szbuf;
for(int nlen =strlen(szbuf); nlen == 3 ;nCount++)
{
CStringA strDrive = pDrive;
vecDrives.push_back(strDrive);
pDrive +=4;
nlen = strlen(pDrive);
}
return nCount;
}
///< 判断系统中是否有DVD 盘符,如果要判断是否有DVD光盘,还要对获取到的盘符里的内容进行下一步判断,如有没有vs_table及.ifo文件存在.
bool HasDVDDrive()
{
char szbuf[MAX_PATH] = {0};
GetLogicalDriveStringsA(MAX_PATH,szbuf);
int nCount = 0;
char * pDrive = szbuf;
for(int nlen =strlen(szbuf); nlen == 3 ;)
{
if( GetDriveTypeA(pDrive) == DRIVE_CDROM )
{
strcpy_s(szDrive,4,pDrive);
return true;
}
pDrive +=4;
nlen = strlen(pDrive);
}
return false;
}