element
Active member
I must admit this is the wierdest problem I have encountered with API and VB.NET...
Heres my simple debug code that I used to do some testing after my app was failing:
-- API --
And this is the actual code:
Both D and H are CD-ROM drives, as funnily enough I need to be able to filter out cd-rom drives from other drives. A:\ is a floppy, and the rest are hard drives.
These are my test results:
A:\ = 9222812402616107010
C:\ = 9222812402616107011
D:\ = 9222812402616107013
E:\ = 9222812402616107011
F:\ = 9222812402616107011
G:\ = 9222812402616107011
H:\ = 9222812402616107013
I:\ = 9222812402616107011
This seems to have no correspondence with the API specification, and although there is a pattern, how can I be sure that these strange numbers will be consistent on other machines etc???
Thanks for your help, Tom.
Heres my simple debug code that I used to do some testing after my app was failing:
-- API --
Code:
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Const DRIVE_CDROM = 5
Const DRIVE_FIXED = 3
Const DRIVE_NO_ROOT = 1
Const DRIVE_REMOTE = 4
Const DRIVE_REMOVABLE = 2
And this is the actual code:
Code:
Debug.WriteLine("A:\ = " & GetDriveType("A:\"))
Debug.WriteLine("C:\ = " & GetDriveType("C:\"))
Debug.WriteLine("D:\ = " & GetDriveType("D:\")) cd
Debug.WriteLine("E:\ = " & GetDriveType("E:\"))
Debug.WriteLine("F:\ = " & GetDriveType("F:\"))
Debug.WriteLine("G:\ = " & GetDriveType("G:\"))
Debug.WriteLine("H:\ = " & GetDriveType("H:\")) cd
Debug.WriteLine("I:\ = " & GetDriveType("I:\"))
Both D and H are CD-ROM drives, as funnily enough I need to be able to filter out cd-rom drives from other drives. A:\ is a floppy, and the rest are hard drives.
These are my test results:
A:\ = 9222812402616107010
C:\ = 9222812402616107011
D:\ = 9222812402616107013
E:\ = 9222812402616107011
F:\ = 9222812402616107011
G:\ = 9222812402616107011
H:\ = 9222812402616107013
I:\ = 9222812402616107011
This seems to have no correspondence with the API specification, and although there is a pattern, how can I be sure that these strange numbers will be consistent on other machines etc???
Thanks for your help, Tom.