Solved

IDE Units and Logical Units

Posted on 2002-07-23
3
230 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
Comment Utility
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
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

12 Experts available now in Live!

Get 1:1 Help Now