• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Identifying CD drives across reboots
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying CD drives across reboots


  • Subject: Re: Identifying CD drives across reboots
  • From: Andre-John Mas <email@hidden>
  • Date: Mon, 17 Dec 2007 21:53:36 -0500


On 14-Dec-07, at 22:56 , Stephen F. Booth wrote:

Hello all,

I need to store some metadata about various CD drives, and have that information be accessible across reboots. I have a few ideas but I haven't figured out the best way to handle things yet. My current code does the following:

1) Registers with DiskArbitration for IOCDMedia events
2) When an event occurs, I grab the IOPath from the DADisk's description and match that with an io_service_t
3) I inspect the io_service_t's properties, particularly for kIOPropertySCSITaskUserClientInstanceGUID
4) I use the GUID to uniquely identify the device


Here is where I am a stuck; I would have expected that the GUID remains the same across reboots, but empirical evidence suggests this is not the case. So I can't use the GUID as a key for drive identification. This may be a good thing, since ROM drives may not be STUC devices and as such wouldn't have a GUID anyway.

My next idea was to use the drive's serial number via kIOPropertyProductSerialNumberKey, but while IOStorageDeviceCharacteristics.h says the key is mandatory it is missing for my drive:

    "Device Characteristics" =     {
        "BD Features" = 0;
        "CD Features" = 1791;
        "DVD Features" = 503;
        "Low Power Polling" = 1;
        "Power Off" = 0;
        "Product Name" = "DVD-R   UJ-845E";
        "Product Revision Level" = DMP2;
        "Vendor Name" = MATSHITA;
    };

So obviously this won't work either.

My third idea is to use the IOPath of the device, but is this a reliable way to uniquely identify a CD device? I have a feeling it isn't, but I'm not quite sure.

Is there another way to accomplish what I am trying to do?

While I can't necessarily provide the answer you are looking for, what I can suggest is checking to see if IORegistryExplorer can see a serial number for your drive. If it does, then it would suggest that there is a way to get it.


Andre

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Identifying CD drives across reboots
      • From: "Stephen F. Booth" <email@hidden>
References: 
 >Identifying CD drives across reboots (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Re: Unable to read DHCP offer packet
  • Next by Date: Re: Identifying CD drives across reboots
  • Previous by thread: Identifying CD drives across reboots
  • Next by thread: Re: Identifying CD drives across reboots
  • Index(es):
    • Date
    • Thread