• 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
Identifying CD drives across reboots
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Identifying CD drives across reboots


  • Subject: Identifying CD drives across reboots
  • From: "Stephen F. Booth" <email@hidden>
  • Date: Fri, 14 Dec 2007 19:56:55 -0800

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?

Thanks,
Stephen
 _______________________________________________
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: Andre-John Mas <email@hidden>
  • Prev by Date: How-to: fcntl + F_PREALLOCATE + F_ALLOCATECONTIG and mmap
  • Next by Date: raw access to system disk
  • Previous by thread: How-to: fcntl + F_PREALLOCATE + F_ALLOCATECONTIG and mmap
  • Next by thread: Re: Identifying CD drives across reboots
  • Index(es):
    • Date
    • Thread