devxlogo

Identify Networked CD Drives

Identify Networked CD Drives

The 32-bit API is much richer than the 16-bit API. However, theGetDriveType still reports networked CD drives as just a DRIVE_REMOTE(i.e., a networked drive). While true, it is not particularlyhelpful. Combine the GetDriveType call with the GetVolumeInformationcall to determine that it is both a network drive and a CD drive.

The next-to-last parameter of this call returns a string thatgives the type of file system on that volume: FAT, NTFS, HPFS,CDFS (CD File System):

 Declare Function GetVolumeInformation _        Lib "kernel32" Alias _        "GetVolumeInformationA" (ByVal _        lpRootPathName As String, ByVal _        lpVolumeNameBuffer As String,_        ByVal nVolumeNameSize As Long, _        lpVolumeSerialNumber As Long, _        lpMaximumComponentLength As Long, _        lpFileSystemFlags As Long, ByVal _        lpFileSystemNameBuffer As String, _        ByVal nFileSystemNameSize As _        Long) As Long        pstrRootPath = "E:"        pstrVolName = Space$(256)        pstrSystemType = Space$(32)        plngSysTypeSize = CLng(Len(pstrSystemType))        plngVolNameSize =       CLng(Len(pstrVolName))        plngRtn = GetVolumeInformation_                (pstrRootPath, pstrVolName, _                plngVolNameSize, plngVolSerialNum, _                plngMaxFilenameLen, plngSysFlags, _                pstrSystemType, plngSysTypeSize)
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist