本文整理汇总了C++中IOService::getProvider方法的典型用法代码示例。如果您正苦于以下问题:C++ IOService::getProvider方法的具体用法?C++ IOService::getProvider怎么用?C++ IOService::getProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOService
的用法示例。
在下文中一共展示了IOService::getProvider方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
IOHIDKeyboardDevice *
IOHIDKeyboardDevice::newKeyboardDeviceAndStart(IOService * owner, UInt32 location)
{
IOService * provider = owner;
while ( NULL != (provider = provider->getProvider()) )
{
if(OSDynamicCast(IOHIDDevice, provider) || OSDynamicCast(IOHIDevice, provider))
return 0;
}
IOHIDKeyboardDevice * device = new IOHIDKeyboardDevice;
if (device)
{
if ( device->initWithLocation(location) && device->attach(owner) )
{
if (!device->start(owner))
{
device->detach(owner);
device->release();
device = 0;
}
}
else
{
device->release();
device = 0;
}
}
return device;
}
示例2: IOPolledFilePollersIODone
IOReturn
IOPolledFilePollersOpen(IOPolledFileIOVars * filevars, uint32_t state, bool abortable)
{
IOPolledFilePollers * vars = filevars->pollers;
IOBufferMemoryDescriptor * ioBuffer;
IOPolledInterface * poller;
IOService * next;
IOReturn err = kIOReturnError;
int32_t idx;
vars->abortable = abortable;
ioBuffer = 0;
if (kIOPolledAfterSleepState == state)
{
vars->ioStatus = 0;
vars->io = false;
}
(void) IOPolledFilePollersIODone(vars, false);
if ((kIOPolledPreflightState == state) || (kIOPolledPreflightCoreDumpState == state))
{
ioBuffer = vars->ioBuffer;
if (!ioBuffer)
{
vars->ioBuffer = ioBuffer = IOBufferMemoryDescriptor::withOptions(kIODirectionInOut,
2 * kDefaultIOSize, page_size);
if (!ioBuffer) return (kIOReturnNoMemory);
}
}
for (idx = vars->pollers->getCount() - 1; idx >= 0; idx--)
{
poller = (IOPolledInterface *) vars->pollers->getObject(idx);
err = poller->open(state, ioBuffer);
if ((kIOReturnSuccess != err) && (kIOPolledPreflightCoreDumpState == state))
{
err = poller->open(kIOPolledPreflightState, ioBuffer);
}
if (kIOReturnSuccess != err)
{
HIBLOG("IOPolledInterface::open[%d] 0x%x\n", idx, err);
break;
}
}
if (kIOReturnSuccess == err)
{
next = vars->media;
while (next)
{
next->setProperty(kIOPolledInterfaceActiveKey, kOSBooleanTrue);
next = next->getProvider();
}
}
return (err);
}
示例3: GetOwnerProvider
static IOUSBDevice* GetOwnerProvider(const IOService *us)
{
IOService *prov = us->getProvider(), *provprov;
if (prov == NULL)
return NULL;
provprov = prov->getProvider();
if (provprov == NULL)
return NULL;
return OSDynamicCast(IOUSBDevice, provprov);
}
示例4: getProvider
IOFireWireUnit * IOFireWireSBP2LUN::getFireWireUnit( void )
{
IOService * unit = NULL;
IOService * provider = getProvider();
if( provider )
{
unit = provider->getProvider();
}
return (IOFireWireUnit*)unit;
}
示例5: getResources
IOReturn ARMIODevice::getResources( void )
{
IOService *macIO = this;
if (getDeviceMemory() != 0) return kIOReturnSuccess;
while (macIO && ((macIO = macIO->getProvider()) != 0))
if (strcmp("arm-io", macIO->getName()) == 0) break;
if (macIO == 0) return kIOReturnError;
IODTResolveAddressing(this, "reg", macIO->getDeviceMemoryWithIndex(0));
return kIOReturnSuccess;
}
示例6: handleStart
bool IOHIDDeviceShim::handleStart( IOService * provider )
{
IOService *device = 0;
if (!super::handleStart(provider))
return false;
if ((_hiDevice = OSDynamicCast(IOHIDevice, provider)))
{
if (_hiDevice->getProperty(kIOHIDVirtualHIDevice) == kOSBooleanTrue)
return false;
device = _hiDevice;
do {
if ((_device = (IOService *)device->metaCast("IOHIDDevice")))
{
break;
}
if ((_device = (IOService *)device->metaCast("IOUSBDevice")) || (_device = (IOService *)device->metaCast("IOUSBInterface")))
{
_transport = kIOHIDTransportUSB;
break;
}
if (_device = (IOService *)device->metaCast("IOADBDevice"))
{
_transport = kIOHIDTransportADB;
break;
}
if (_device = (IOService *)device->metaCast("ApplePS2Controller"))
{
_transport = kIOHIDTransportPS2;
break;
}
} while (device = device->getProvider());
}
return true;
}