Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Is there something like a CD/DVD GUID and how to obtain it if yes?

Is there something like a CD/DVD GUID and how to obtain it if yes?

Scheduled Pinned Locked Moved C / C++ / MFC
databasetutorialc++helpquestion
13 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Code o mat
    wrote on last edited by
    #1

    Hello folks. Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs and if yes, how would one go about retrieving this in VC++? Actually what i'd like to do is recognize the disc once it is loaded into an optical drive to e.g. have an autorun function that can be enabled/disabled per disk (program would respond on WM_DEVICECHANGE, query GUID, check against database and if enabled, autorun the disk, if not enabled, then do nothing, just an example).

    > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

    D C L 3 Replies Last reply
    0
    • C Code o mat

      Hello folks. Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs and if yes, how would one go about retrieving this in VC++? Actually what i'd like to do is recognize the disc once it is loaded into an optical drive to e.g. have an autorun function that can be enabled/disabled per disk (program would respond on WM_DEVICECHANGE, query GUID, check against database and if enabled, autorun the disk, if not enabled, then do nothing, just an example).

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Code-o-mat wrote:

      Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs...

      Check out: HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Man who follows car will be exhausted." - Confucius

      S C 2 Replies Last reply
      0
      • D David Crow

        Code-o-mat wrote:

        Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs...

        Check out: HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        S Offline
        S Offline
        Sauro Viti
        wrote on last edited by
        #3

        The key you pointed out holds informations about the CD/DVD drive... What the enquirer seems to ask for is something like an identifier of the disc

        1 Reply Last reply
        0
        • D David Crow

          Code-o-mat wrote:

          Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs...

          Check out: HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          Sauro Viti's right, i meant the medium itself, not the drive.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

          D 1 Reply Last reply
          0
          • C Code o mat

            Sauro Viti's right, i meant the medium itself, not the drive.

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            HDDs have a unique number stamped on them during manufacturing, but I'm not aware of any such thing existing for CDs and DVDs, especially those that the user creates.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            C 1 Reply Last reply
            0
            • D David Crow

              HDDs have a unique number stamped on them during manufacturing, but I'm not aware of any such thing existing for CDs and DVDs, especially those that the user creates.

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Man who follows car will be exhausted." - Confucius

              C Offline
              C Offline
              Code o mat
              wrote on last edited by
              #6

              Me neither, but i thought i ask, maybe someone knows better, thanks anyways for your reply.

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

              1 Reply Last reply
              0
              • C Code o mat

                Hello folks. Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs and if yes, how would one go about retrieving this in VC++? Actually what i'd like to do is recognize the disc once it is loaded into an optical drive to e.g. have an autorun function that can be enabled/disabled per disk (program would respond on WM_DEVICECHANGE, query GUID, check against database and if enabled, autorun the disk, if not enabled, then do nothing, just an example).

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                C Offline
                C Offline
                Chris Meech
                wrote on last edited by
                #7

                Somewhat off-topic, but here's an interesting link[^] to a what happens when someone thinks they can come up with a way of uniquely identifying all CD's. :)

                Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

                C 1 Reply Last reply
                0
                • C Chris Meech

                  Somewhat off-topic, but here's an interesting link[^] to a what happens when someone thinks they can come up with a way of uniquely identifying all CD's. :)

                  Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

                  C Offline
                  C Offline
                  Code o mat
                  wrote on last edited by
                  #8

                  Thanks for the link, just read it, it's instructive. It's easy to be smart afterwards, but i wonder why they didn't originally think of identifying discs, i mean, it's quite obvious it can be useful in certain situations. On the other hand, if i had generated a GUID and written it to a file called "DISC.GUID" in the root of every disc i ever burned then i'd be smarter now, but hey, who would ever think it could be useful sometimes in the future... :) I wonder what alternatives there could be...like scanning the first 10 file names + file sizes and generating a hash of those, or somesuch, but such aproaches might turn out to be rather slow. The ID itself doesn't have to be unique on this planet, just around my home. :)

                  > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                  P 1 Reply Last reply
                  0
                  • C Code o mat

                    Thanks for the link, just read it, it's instructive. It's easy to be smart afterwards, but i wonder why they didn't originally think of identifying discs, i mean, it's quite obvious it can be useful in certain situations. On the other hand, if i had generated a GUID and written it to a file called "DISC.GUID" in the root of every disc i ever burned then i'd be smarter now, but hey, who would ever think it could be useful sometimes in the future... :) I wonder what alternatives there could be...like scanning the first 10 file names + file sizes and generating a hash of those, or somesuch, but such aproaches might turn out to be rather slow. The ID itself doesn't have to be unique on this planet, just around my home. :)

                    > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                    P Offline
                    P Offline
                    Peter_in_2780
                    wrote on last edited by
                    #9

                    Code-o-mat wrote:

                    The ID itself doesn't have to be unique on this planet, just around my home.

                    Try something like one of these[^] ;P ;P

                    Software rusts. Simon Stephenson, ca 1994.

                    C 1 Reply Last reply
                    0
                    • C Code o mat

                      Hello folks. Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs and if yes, how would one go about retrieving this in VC++? Actually what i'd like to do is recognize the disc once it is loaded into an optical drive to e.g. have an autorun function that can be enabled/disabled per disk (program would respond on WM_DEVICECHANGE, query GUID, check against database and if enabled, autorun the disk, if not enabled, then do nothing, just an example).

                      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #10

                      This scheme might work for a limited set-up; it basically tries to identify a CD by hashing as few sectors as possible. 1. have a central database that stores one record per CD, holding a unique ID (auto assigned), a sectorCount number, and a CRC number. Also have a table that holds one number: numberOfSectors (it will start at 1, and increase monotonically over time). 2. have an app that allows to add new CDs to the system. 3. have a library that supports the recognition of known CDs. The add-a-new-CD algorithm would be like so: 1. read first few sectors (as determined by numberOfSectors). 2. for all occurring values of sectorCount, calculate CRC, and search DB for a match. 3. if none found, simply add the new disk, and terminate. 4. if one found with sectorCount<numberOfSectors, flag it as no longer valid; add the new disk; goto 5. 5. for the flagged disks, re-process them (this will yield a new CRC over a larger number of sectors). The recognize-a-CD algorithm would be like so: 1. read first few sectors (as determined by numberOfSectors). 2. for all occurring values of sectorCount, calculate CRC, and search DB for a match. 3. if one found, that is it. 4. if none found, this is an unknown CD, you can't handle it, you need the aad-a-new-CD algorithm. Possible refinement: on top of the above, you could also store the "total CRC" of a CD, so when one isn't recognized according to the above, you could still recognize it by brute force, then suggest the user officially adds it to the DB. :)

                      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                      modified on Wednesday, November 10, 2010 6:59 PM

                      C 1 Reply Last reply
                      0
                      • P Peter_in_2780

                        Code-o-mat wrote:

                        The ID itself doesn't have to be unique on this planet, just around my home.

                        Try something like one of these[^] ;P ;P

                        Software rusts. Simon Stephenson, ca 1994.

                        C Offline
                        C Offline
                        Code o mat
                        wrote on last edited by
                        #11

                        That's a good one, and damn the "programmer mind", i even started thinking how one could mount a web camera above the optical disc drive's tray and write a program that recognizes and reads the number stamped onto the disc as it passes... :laugh:

                        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                        1 Reply Last reply
                        0
                        • L Luc Pattyn

                          This scheme might work for a limited set-up; it basically tries to identify a CD by hashing as few sectors as possible. 1. have a central database that stores one record per CD, holding a unique ID (auto assigned), a sectorCount number, and a CRC number. Also have a table that holds one number: numberOfSectors (it will start at 1, and increase monotonically over time). 2. have an app that allows to add new CDs to the system. 3. have a library that supports the recognition of known CDs. The add-a-new-CD algorithm would be like so: 1. read first few sectors (as determined by numberOfSectors). 2. for all occurring values of sectorCount, calculate CRC, and search DB for a match. 3. if none found, simply add the new disk, and terminate. 4. if one found with sectorCount<numberOfSectors, flag it as no longer valid; add the new disk; goto 5. 5. for the flagged disks, re-process them (this will yield a new CRC over a larger number of sectors). The recognize-a-CD algorithm would be like so: 1. read first few sectors (as determined by numberOfSectors). 2. for all occurring values of sectorCount, calculate CRC, and search DB for a match. 3. if one found, that is it. 4. if none found, this is an unknown CD, you can't handle it, you need the aad-a-new-CD algorithm. Possible refinement: on top of the above, you could also store the "total CRC" of a CD, so when one isn't recognized according to the above, you could still recognize it by brute force, then suggest the user officially adds it to the DB. :)

                          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                          modified on Wednesday, November 10, 2010 6:59 PM

                          C Offline
                          C Offline
                          Code o mat
                          wrote on last edited by
                          #12

                          Sounds reasonable, thanks, will digest it some. :thumbsup:

                          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                          L 1 Reply Last reply
                          0
                          • C Code o mat

                            Sounds reasonable, thanks, will digest it some. :thumbsup:

                            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                            L Offline
                            L Offline
                            Luc Pattyn
                            wrote on last edited by
                            #13

                            you're welcome. :)

                            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                            Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups