You could use the System.Management namespace instead like
Dim diskClass As New ManagementClass("Win32_LogicalDisk")
Dim disks As ManagementObjectCollection = diskClass.GetInstances()
Dim disksEnumerator As _
ManagementObjectCollection.ManagementObjectEnumerator = _
disks.GetEnumerator()
While disksEnumerator.MoveNext()
Dim disk As ManagementObject = _
DirectCast(disksEnumerator.Current, ManagementObject)
'Drive letter is the caption, message is the type where
'NoRoot = 1, Removable = 2, LocalDisk = 3, Network = 4,CD = 5, RAMDrive = 6
MessageBox.Show(disk("DriveType").ToString, disk("deviceid").ToString)
End While
or alternatively change the declaration to
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Integer