GetVolumeInformation Bug
3 messages in this thread
All,
When GetVolumeInformation() is called for a network redirected drive, it
returns a bogus volume label if the volume label is only stored in the boot
sector. Backgrounder: Starting with DOS 4.0, the volume label can appear in
the boot sector, or can be a specially marked file in the root directory.
Apparently, GetVolumeInformation will return bogus values if it does not find a
file in the root directory with the VOLID attribute. This is very important
for my application because I juggle removeable media on network drives. Help!
I have tested this on Win32s with Novell, Chicago Beta1, NT 3.5 Beta and it
fails the same on all systems. If the drive only has a volume label in the
boot sector, the api returns either the first file in the root directory, or
the first subdir name in the root directory if there are no files.
If this is not the right place to report this where is?
Larry Bank
Read action !
I reported a different bug with GetVolumeInformation()… or at least I think
it's a bug. See message 79238 if it's still around. (It should be.)
I've continued to tinker with this and I can't get it to work. I've used both
the GetLogicalDrives and GetLogicalDriveStrings to find the valid drives in the
system, but when I call GetVolumeInformation, I get "no disk in drive" dialogs
for each floppy drive, as well as any CDROMs that have once been mounted, but
have been ejected.
A deeper question – how does the Common Dialog get such nice volume names
(including the \\xxx\xx network names)? (And why isn't there an easy function
to get a Network button that we can add to any file dialog of our own
creation?)
I've tried all permutations of arguments to GetVolumeInformation, between NULLs
and pointers to local variables. It looks like there hasn't been a Sysop visit
here in days, our messages are still (X) flagged. Perhaps we can help each
other.
There is 1 Reply.
Read action !
John,
I don't think I can help you, but I have come up with a workaround for my
problem that is not too inconvenient for my customers. The workaround is to
use the LABEL command after formatting a drive to make sure that the volume
label appears in the root directory since format only puts it in the boot
sector. This is not too much to ask the user and seems to work reliably after
this is done. I'm sorry but I don't have an answer for your other questions.
Call MS support directly and get them to work on it.
Larry Bank
Read action !