Windows NT ( 2)



         

- 9


lpLogicalDriveStrings = malloc(dwDriveStringsSpace);

//

GetLogicalDriveStrings(dwDriveStringsSpace,

lpLogicalDriveStrings);

// ,

// ,

nNumDirves = 0;

for(lpTemp = lpLogicalDriveStrings;

*lpTemp != 0; nNumDirves++)

{

lpTemp = strchr(lpTemp, 0) + 1;

}

//

//

pdi = malloc(nNumDirves * sizeof(DISKINFO));

// DISKINFO

for(i = 0, lpTemp = lpLogicalDriveStrings;

i < nNumDirves; i ++)

{

//

strcpy((pdi + i)->szDriveName, lpTemp);

//

(pdi + i)->nDriveType = GetDriveType(lpTemp);

//

// DISKINFO

switch ((pdi + i)->nDriveType)

{

// CD-ROM

//

case DRIVE_REMOVABLE:

{

// 0

(pdi + i)->iImage = 0;

strcpy((pdi + i)->szVolumeName, "<Unknown>");

(pdi + i)->dwVolumeSerialNumber = 0;

(pdi + i)->dwMaxFileNameLength = 0;

(pdi + i)->dwFileSystemFlags = 0;

strcpy((pdi + i)->szFileSystemName, "?");

(pdi + i)->dwFreeSpace = 0;

(pdi + i)->dwTotalSpace = 0;

break;

}

case DRIVE_CDROM:

{

(pdi + i)->iImage = 2;

strcpy((pdi + i)->szVolumeName, "<Unknown>");

(pdi + i)->dwVolumeSerialNumber = 0;

(pdi + i)->dwMaxFileNameLength = 0;

(pdi + i)->dwFileSystemFlags = 0;