Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get physical disk of a logical drive letter
Message
From
05/03/2002 08:24:55
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00627438
Message ID:
00628335
Views:
57
UPDATE: Ed, I just read the earlier messages and saw that the windows getvolumeinformation api is returning the same serial number for different logical drives on the same hard disk. I never noticed this before in my Delphi code--I'll have to test that tonight! :0(
Tracy

SNIP
>You could do it with a bit more trouble in Delphi or VB6 or later, but they have real strong datatyping and structures and pointers and unions, oh my!

Actually, I wouldn't do it that way at all in Delphi. Delphi has a function: GetMediaID that will examine a disk's serial number. GetMediaID is a wrapper around the Windows GetVolumeInformation API call.

Wouldn't something like the below Delphi code be useful in VFP?
var
  ID : MediaIDType;
begin
  GetMediaID2('C', ID);
  ListBox1.Items.Add('Volume Label = ' + 
    StrPas(ID.VolumeLabel));
  ListBox1.Items.Add('File System = ' + 
    StrPas(ID.FileSystemID));
  ListBox1.Items.Add('Serial Number = ' +
    IntToStr(ID.SerialNumber));
Actually, shouldn't the Windows Getvolumeinformation return the same information?

Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform