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. how to get cdrom serial number

how to get cdrom serial number

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
9 Posts 4 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.
  • E Offline
    E Offline
    EverettJF
    wrote on last edited by
    #1

    I use the software "Everest" to obtain detailed infomation about my cdroms, including description,serial number ,cach size and so on . Now I wonder how "Everest" obtain such detailed infomation. Now I just need the serial number of my cdrom. How? Thanks.

    C S M 3 Replies Last reply
    0
    • E EverettJF

      I use the software "Everest" to obtain detailed infomation about my cdroms, including description,serial number ,cach size and so on . Now I wonder how "Everest" obtain such detailed infomation. Now I just need the serial number of my cdrom. How? Thanks.

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      What about GetVolumeInformation[^] function? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      E 1 Reply Last reply
      0
      • C CPallini

        What about GetVolumeInformation[^] function? :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        E Offline
        E Offline
        EverettJF
        wrote on last edited by
        #3

        I have tested GetVolumeInformation(), it can only obtain the physical disk C:\ .. but it can not do with my H:\ (my cdrom)

        1 Reply Last reply
        0
        • E EverettJF

          I use the software "Everest" to obtain detailed infomation about my cdroms, including description,serial number ,cach size and so on . Now I wonder how "Everest" obtain such detailed infomation. Now I just need the serial number of my cdrom. How? Thanks.

          S Offline
          S Offline
          SachinBhave
          wrote on last edited by
          #4

          You can use Win32_CDROMDrive WMI class for retrieving all the information about CD ROM drive. Check out the MSDN page[^]

          E 1 Reply Last reply
          0
          • E EverettJF

            I use the software "Everest" to obtain detailed infomation about my cdroms, including description,serial number ,cach size and so on . Now I wonder how "Everest" obtain such detailed infomation. Now I just need the serial number of my cdrom. How? Thanks.

            M Offline
            M Offline
            Michel Godfroid
            wrote on last edited by
            #5

            You'll need to issue IOCTL_READ_TOC_EXT[^], with parameter CDROM_READ_TOC_EX_FORMAT_CDTEXT. Your serial number will then be in CDROM_CD_TEXT_PACK_DISC_ID, or CDROM_CD_TEXT_PACK_UPC_EAN, can't remember which one :-). Note that this is for commercial music cds. (and it doesn't work for all). There is also a bar code encoded in the innermost ring of CD's and DVD (flip one over, and take a close look at the inner ring, you'll see a huge barcode). This one is returned by http://msdn.microsoft.com/en-us/library/aa394346(VS.85).aspx[^] Serial Number (this works even for R/W devices, and it's how windows differentiates between CDs or DVDS used for writing. So you'll have to decide which one you want. The first one is mostly used for commercial cdroms, and is encoded in the subtext layer on recent cdroms. You'll need a drive that can read subtext, most of them do nowadays. The other one exists on all cd's/DVD's, again the drive must be capable of reading it. Recent ones all do.

            modified on Monday, April 26, 2010 6:05 AM

            E 1 Reply Last reply
            0
            • S SachinBhave

              You can use Win32_CDROMDrive WMI class for retrieving all the information about CD ROM drive. Check out the MSDN page[^]

              E Offline
              E Offline
              EverettJF
              wrote on last edited by
              #6

              yes, I just used Win32_CDROMDrive . But the member VolumeSerialNumber is empty , and SerialNumber Data type: uint16 Access type: Read-only Number supplied by the manufacturer that identifies the physical media. Example: WD-WM3493798728. Windows Server 2003, Windows XP, Windows 2000, Windows NT 4.0, and Windows Me/98/95: This property is not available. I am on Windows XP. Thanks :)

              S 1 Reply Last reply
              0
              • M Michel Godfroid

                You'll need to issue IOCTL_READ_TOC_EXT[^], with parameter CDROM_READ_TOC_EX_FORMAT_CDTEXT. Your serial number will then be in CDROM_CD_TEXT_PACK_DISC_ID, or CDROM_CD_TEXT_PACK_UPC_EAN, can't remember which one :-). Note that this is for commercial music cds. (and it doesn't work for all). There is also a bar code encoded in the innermost ring of CD's and DVD (flip one over, and take a close look at the inner ring, you'll see a huge barcode). This one is returned by http://msdn.microsoft.com/en-us/library/aa394346(VS.85).aspx[^] Serial Number (this works even for R/W devices, and it's how windows differentiates between CDs or DVDS used for writing. So you'll have to decide which one you want. The first one is mostly used for commercial cdroms, and is encoded in the subtext layer on recent cdroms. You'll need a drive that can read subtext, most of them do nowadays. The other one exists on all cd's/DVD's, again the drive must be capable of reading it. Recent ones all do.

                modified on Monday, April 26, 2010 6:05 AM

                E Offline
                E Offline
                EverettJF
                wrote on last edited by
                #7

                Nice ! I will test it ! Thanks a lot!

                1 Reply Last reply
                0
                • E EverettJF

                  yes, I just used Win32_CDROMDrive . But the member VolumeSerialNumber is empty , and SerialNumber Data type: uint16 Access type: Read-only Number supplied by the manufacturer that identifies the physical media. Example: WD-WM3493798728. Windows Server 2003, Windows XP, Windows 2000, Windows NT 4.0, and Windows Me/98/95: This property is not available. I am on Windows XP. Thanks :)

                  S Offline
                  S Offline
                  SachinBhave
                  wrote on last edited by
                  #8

                  You can try using Win32_PhysicalMedia WMI class. According to MSDN[^] it supports XP. Also there is no restriction documented on the OS for retrieving Serial number using Win32_PhysicalMedia.

                  E 1 Reply Last reply
                  0
                  • S SachinBhave

                    You can try using Win32_PhysicalMedia WMI class. According to MSDN[^] it supports XP. Also there is no restriction documented on the OS for retrieving Serial number using Win32_PhysicalMedia.

                    E Offline
                    E Offline
                    EverettJF
                    wrote on last edited by
                    #9

                    I tried Win32_PhysicalMedia , I do not know why I only got \\.\PHYSICALDRIVE0 , and almost all of the detailed infomation is NULL(such as "Name"). while I could get detailed infomation with Win32_CDROMDrive. Thanks anyway :)

                    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