本文整理汇总了C++中IOService::free方法的典型用法代码示例。如果您正苦于以下问题:C++ IOService::free方法的具体用法?C++ IOService::free怎么用?C++ IOService::free使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOService
的用法示例。
在下文中一共展示了IOService::free方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
IOService * IODTPlatformExpert::createNub( IORegistryEntry * from )
{
IOService * nub;
nub = new IOPlatformDevice;
if( nub) {
if( !nub->init( from, gIODTPlane )) {
nub->free();
nub = 0;
}
}
return( nub);
}
示例2: return
IOService * ARMIO::createNub( IORegistryEntry * from )
{
IOService * nub;
nub = new ARMIODevice;
if( nub && !nub->init( from, gIODTPlane )) {
nub->free();
nub = 0;
}
return( nub);
}
示例3: createNubs
//.........这里部分代码省略.........
next = provider->childFromPath(buffer, gIODTPlane);
if (!next)
{
next = new IOService;
if (next && !next->init())
{
next->release();
next = 0;
}
if (!next)
continue;
next->setLocation(&buffer[1]);
if (!next->attachToParent(provider, gIODTPlane))
continue;
}
OSObject * obj = dict->getObject(key);
next->setProperty(keyChrs, dict->getObject(key));
if (!strcmp(keyChrs, "name"))
{
OSData * data = OSDynamicCast(OSData, obj);
if (data)
next->setName((const char *) data->getBytesNoCopy());
}
next->release();
provider->removeProperty(key);
}
keys->release();
}
}
iter = IORegistryIterator::iterateOver( provider, gIODTPlane, 0 );
toDo = OSArray::withCapacity(2);
if (iter && toDo)
{
bool haveDoneLibInit = false;
UInt32 index = 0;
do
{
while ((next = (IORegistryEntry *) iter->getNextObject()))
{
firstLevel = (provider == next->getParentEntry(gIODTPlane));
if (firstLevel)
{
data = OSDynamicCast( OSData, next->getProperty("device_type"));
if (!data || (0 != strcmp("display", (char *) data->getBytesNoCopy())))
continue;
if (!haveDoneLibInit)
{
haveDoneLibInit = (kIOReturnSuccess == _IONDRVLibrariesInitialize(provider));
if (!haveDoneLibInit)
continue;
}
next->setProperty( kIOFBDependentIDKey, (uintptr_t) provider, 64 );
next->setProperty( kIOFBDependentIndexKey, index, 32 );
next->setProperty( kIONDRVIgnoreKey, kOSBooleanTrue );
index++;
}
toDo->setObject( next );
iter->enterEntry();
}
}
while (iter->exitEntry());
}
if (iter)
iter->release();
if (toDo)
{
OSObject * obj;
OSArray * deviceMemory;
obj = provider->copyProperty(gIODeviceMemoryKey);
deviceMemory = OSDynamicCast(OSArray, obj);
for (unsigned int i = 0;
(next = (IORegistryEntry *) toDo->getObject(i));
i++)
{
newNub = new IONDRVDevice;
if (!newNub)
continue;
if (!newNub->init(next, gIODTPlane))
{
newNub->free();
newNub = 0;
continue;
}
if (deviceMemory)
newNub->setDeviceMemory(deviceMemory);
newNub->attach(provider);
newNub->registerService(kIOServiceSynchronous);
}
if (obj)
obj->release();
toDo->release();
}
}