- iter = IORegistryIterator::iterateOver( gIOServicePlane,
- kIORegistryIterateRecursively );
- if( iter) {
- do {
- iter->reset();
- while( (service = (IOService *) iter->getNextObject())) {
- if( (inState == (service->__state[0] & inState))
- && (0 == (service->__state[0] & kIOServiceInactiveState))
- && service->passiveMatch( matching )) {
-
- if( options & kIONotifyOnce) {
- current = service;
- break;
- }
- if( current)
- ((OSSet *)current)->setObject( service );
- else
- current = OSSet::withObjects(
- (const OSObject **) &service, 1, 1 );
- }
- }
- } while( !service && !iter->isValid());
- iter->release();
+ if(true
+ && (obj = matching->getObject(gIOProviderClassKey))
+ && gIOResourcesKey
+ && gIOResourcesKey->isEqualTo(obj)
+ && (service = gIOResources))
+ {
+ if( (inState == (service->__state[0] & inState))
+ && (0 == (service->__state[0] & kIOServiceInactiveState))
+ && service->passiveMatch( matching ))
+ {
+ if( options & kIONotifyOnce)
+ current = service;
+ else
+ current = OSSet::withObjects(
+ (const OSObject **) &service, 1, 1 );
+ }
+ }
+ else
+ {
+ iter = IORegistryIterator::iterateOver( gIOServicePlane,
+ kIORegistryIterateRecursively );
+ if( iter) {
+ do {
+ iter->reset();
+ while( (service = (IOService *) iter->getNextObject())) {
+ if( (inState == (service->__state[0] & inState))
+ && (0 == (service->__state[0] & kIOServiceInactiveState))
+ && service->passiveMatch( matching )) {
+
+ if( options & kIONotifyOnce) {
+ current = service;
+ break;
+ }
+ if( current)
+ ((OSSet *)current)->setObject( service );
+ else
+ current = OSSet::withObjects(
+ (const OSObject **) &service, 1, 1 );
+ }
+ }
+ } while( !service && !iter->isValid());
+ iter->release();
+ }