I wonder if there is any relation between Windows-Generated volume number and the HDD’s hardware serial number which is allocated by it’s vendor?
The problem is that we have distributed a software in which the licensing method is based on the Windows volume number, but that tends to change every time Windows is reinstalled even on the same computer.
We’re trying to figure out a way to validate volume numbers after windows re-installation in case of using the same system hardware every time.
I wonder if there is any relation between Windows-Generated volume number and the HDD’s
Share
No it’s not associated with hard drive serial number. It’s just an arbitrary number generated every format.
There is a less changing number residing in Master Boot Record called DiskID but that changes too in case of recreation of the MBR (such as antivirus repair or just some low level action). You could however read it using
diskpartcommand in Windows with commands:select disk 0,uniqueid disk.As a viable option you can send a
IOCTL_STORAGE_QUERY_PROPERTYrequest usingDeviceIoControl()andStorageDeviceUniqueIdPropertyas theSTORAGE_PROPERTYto the given device and retrieve a unique identifier.Another option is to enumerate devices using user PnP API and use PnP identifier to uniquely identify disks.
There is also an option to query WMI for
Win32_PhysicalMediaclass but I’m not sure how reliable it is.I believe all solutions would require administrative privileges.