1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#include <windows.h>
#define BUFSIZE 512
int main(int argc, char* argv[])
{
char szTemp[BUFSIZE];
szTemp[0] = '\0';
GetLogicalDriveStrings(BUFSIZE, szTemp);
char* pos = szTemp;
while( *pos != 0 )
{
switch( GetDriveType(pos) )
{
case DRIVE_UNKNOWN:
printf("Lecteur %s : inconnu\n", pos);
break;
case DRIVE_NO_ROOT_DIR:
printf("Lecteur %s : invalide\n", pos);
break;
case DRIVE_REMOVABLE:
printf("Lecteur %s : amovible (floppy, USB)\n", pos);
break;
case DRIVE_FIXED:
printf("Lecteur %s : fixe\n", pos);
break;
case DRIVE_REMOTE:
printf("Lecteur %s : réseau\n", pos);
break;
case DRIVE_CDROM:
printf("Lecteur %s : CD-ROM\n", pos);
break;
case DRIVE_RAMDISK:
printf("Lecteur %s : RAM-DISK\n", pos);
break;
}
pos = pos + strlen(pos) + 1;
}
return 0;
} |
Partager