Solved

IDE Units and Logical Units

Posted on 2002-07-23
3
231 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now