Solved

IDE Units and Logical Units

Posted on 2002-07-23
3
232 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:tomcruisew
3 Comments
 
LVL 10

Expert Comment

by:aeklund
ID: 7180758
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
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8040416
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
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8095738
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question