Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filtering disk vs. partitions




On Aug 10, 2007, at 9:59:59AM, Eric Long wrote:

Yes.  One of the registry properties on IOMedia objects is "Whole"
with a boolean value.

true is (generally) a disk, false is a slice/partition.

Possible Exception: I'd have to do some further testing, but some
RAID drivers may show the merged of 2 (or more) disks as whole.

See, that's the thing. I'm not seeing anything sent to probe that has Whole
set to true.

Hmm... What's the matching dict in your Info.plist look like? Depending on your match, you may be filtering them out accidently/ incidentally.


Couple comments:
-I assume your passing your parent, not yourself into isWhole? For maximum robustness you might also consider doing a search below you for the first "Whole" property below you.


-I'd suggest replacing your OSBoolean cast with an OSDynamicCast. A little extra robustness is always good in the kernel...

I'm using this code to check:

bool    com_myCompany_driver_MyDriver::isWhole( IOService *object )
{
    bool        result = false;
    OSBoolean    *val = (OSBoolean*)(object->copyProperty("Whole",
gIOServicePlane));

    if (val != NULL)
    {
        result = val->isTrue();
        val->release();
    }

    return result;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-kernel/email@hidden

This email sent to email@hidden
References: 
 >Re: Filtering disk vs. partitions (From: Eric Long <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.