CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2006
    Location
    Marseille, France
    Posts
    94

    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.

  2. #2
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    Re: Identify a cd-rom (is there a SID in a cd ?)

    Check out the fourth parameter: GetVolumeInformation()
    Please don't forget to rate users who helped you!

  3. #3
    Join Date
    Jan 2006
    Location
    Marseille, France
    Posts
    94

    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 ?

  4. #4
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    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.
    Please don't forget to rate users who helped you!

  5. #5
    Join Date
    Jan 2006
    Location
    Marseille, France
    Posts
    94

    Re: Identify a cd-rom (is there a SID in a cd ?)

    Yes, I'll do that to check,

    thanks.

  6. #6
    Join Date
    Jan 2006
    Location
    Marseille, France
    Posts
    94

    Re: Identify a cd-rom (is there a SID in a cd ?)

    How getting the drive where is running the .exe ?

    thx

  7. #7
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    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.
    Please don't forget to rate users who helped you!

  8. #8
    Join Date
    Jan 2006
    Location
    Marseille, France
    Posts
    94

    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);
    	 }

    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

  9. #9
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    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.
    Last edited by philkr; April 27th, 2006 at 12:57 PM.
    Please don't forget to rate users who helped you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured