Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetDriveType() appears to hang

Status
Not open for further replies.

EzehM

Programmer
Feb 27, 2003
86
GB
Can GetDriveType() cause a program to hang?

This is my code snippet

if (GetDriveType(TargetDir) != DRIVE_FIXED)
{
DebugMsg("Write via NFS. Checking CRC on files %s and %s", lpExistingFileName, path);
…..
}

Where TargetDir is a shared folder on a Solrais box, accessed by my application via NFS (Hummingbird NFS Maestro 6.1)

If it does, is there another API that I could use to get the drive type?

Thanks in advance

Milton

 
Here is some old code I used to determine drive types that seemed to work ok

Code:
for(int i = 2;i<26;i++)
{
	CString temp;
	temp.Format("%c:\\",'A'+i);
	unsigned int type = GetDriveType(temp);

        // switch types here
}

You can also combine the above code with "GetLogicalDrives" which returns a 32 bit value with bits set if the drive exists.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top