I am kinda stuck with this api GetDriveType(). Every time this api returns me DRIVE_NO_ROOT_DIR, I am passing drive letters like this "c:\" etc. Even for my primary drive "c:\" the api returns the same thing.
I have called GetLogicalDrives() before this to retrieve.
OS: WinXP sp3, NTFS file system
code: compiler VS2005
int main() {
bool folder;
String * filename;
char individualdrive[4],alldrives[100];
memset(alldrives,0,100);
GetLogicalDriveStringsA(100,alldrives);
for(int i=0;(i<100)&&(alldrives[i]);i+=4) {
memset(individualdrive,0,4);
strncpy(individualdrive,alldrives+i,4); //extracting individual drive strings.
if(DRIVE_FIXED == GetDriveTypeW((LPCWSTR)individualdrive))
getfile((System::String*)individualdrive, filename,folder); }
return 0; }
{}button above the editor.