Identify a cd-rom (is there a SID in a cd ?)
Hi,
I need to create an application which will be writted on many CD-ROM (10.000 cd), each cd is same as other, there isn't any possibility to write a different file on each cd,
But I need to authenticate each cd without needing a manual entry (serial number...) by user.
So, I'm looking if it exist a SID on each CD, like the MAC address for network card and how getting it in C++.
Thanks all.
Re: Identify a cd-rom (is there a SID in a cd ?)
Check out the fourth parameter: GetVolumeInformation()
Re: Identify a cd-rom (is there a SID in a cd ?)
and it will be enought ?
each number got on each cd will be different ?
Re: Identify a cd-rom (is there a SID in a cd ?)
I can only guess. The best thing would be to burn two exactly identical CDs and try it.
Re: Identify a cd-rom (is there a SID in a cd ?)
Yes, I'll do that to check,
thanks.
Re: Identify a cd-rom (is there a SID in a cd ?)
How getting the drive where is running the .exe ?
thx
Re: Identify a cd-rom (is there a SID in a cd ?)
You can use GetDriveType() to check every drive letter until you get a CD-drive.
Re: Identify a cd-rom (is there a SID in a cd ?)
I got it
Code:
if(::GetCurrentDirectory(sizeof(szDir) - 1, szDir)){
driver = szDir;
p = driver.Find("\\");
driver = driver.Left(p+1);
driver.MakeUpper();
bSuccess= GetVolumeInformation( driver, szVolName,MAX_PATH,
&dwVolSerialNumber,
&dwMaxNameLength,
&dwFileSystemFlags,
szSystemName,MAX_PATH);
}
:ehh: But are you sure this number is really single ?
it's composed of 10 numerics digits so it allow 10.000.000.000 - 1 possibilities, I thinks it's a little bit small for all of us seeing each CD are burnst each days
Re: Identify a cd-rom (is there a SID in a cd ?)
The number is DWORD which is 32 bit = 4 byte = 4.294.967.296 different values possible.
But besides this I can not guarantee anything, because I am no serial number specialist. Hopefully you will find one.
EDIT: The question is not if there exists a CD with the same serial number anywhere on the world, but if it is possible for a person without much effort to create a CD with an arbitrary serial and if he can also get to know what number he has to use.