Link to home
Start Free TrialLog in
Avatar of tomcruisew
tomcruisew

asked on

IDE Units and Logical Units

How can I discover which letter (logical unit, like C:, D:, etc) is IDE Primary Master, Primary Slave, etc. I already know how to use File System Object but I think it can't show me what I want. In addition, I would say that I have a routine that I can pass a number as a parameter which represents IDE sequence and it returns me all the information about the disk. Of course I know that I can have more than one partition in the same disk. The goal here is to associate the Hard Disk Serial Number with the logical unit from where the application has started. This is necessary because I have developered a mechanism associated with ActiveLock which returns a different System Code for each instalation and then the liberation key can be generated. The problem is, if a smart user knows how to use a tool like the Norton Ghost he can fool this mechanism. So, what I intend to do to avoid this is to save the the hd serial number from where the app has run for the first time (based in the logical drive letter) and then to compare against the hd serial number each time the app runs.  

Thanks in advance for any help
Avatar of aeklund
aeklund

Private 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

Private Sub Main()
  Dim sDriveLetter As String
  sDriveLetter = "C:\"
 
  Dim lError As Long
  Dim sName As String
  Dim lSize As Long
  Dim lSerNum As Long
  Dim lMaxLen As Long
  Dim lSysFlag As Long
  Dim sFileSys As String
  Dim lFileSys As Long
 
  lError = GetVolumeInformation(sDriveLetter, sName, lSize, lSerNum, lMaxLen, lSysFlag, sFileSys, lFileSys)
  MsgBox lSerNum
 
End Sub
Avatar of DanRollins
Hi tomcruisew,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

tomcruisew, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial