コード例 #1
0
ファイル: IOCommandGate.cpp プロジェクト: SbIm/xnu-env
IOCommandGate *
IOCommandGate::commandGate(OSObject *inOwner, Action inAction)
{
    IOCommandGate *me = new IOCommandGate;

    if (me && !me->init(inOwner, inAction)) {
        me->release();
        return 0;
    }

    return me;
}
コード例 #2
0
ファイル: AppleUSBCDC.cpp プロジェクト: Kiichi77/MacOSX
IOReturn AppleUSBCDC::setProperties( OSObject * properties )
{
	IOReturn result = kIOReturnError;
	IOCommandGate *cg;
	
	XTRACE(this, 0, 0, "setProperties");
	
	cg = getCommandGate();
	
	if ( cg != NULL )
	{
        //<radar://problem/7488030> retain the CommandGate in case device gets pulled when we are setting the properties..
        cg->retain();
		result = cg->runAction( setPropertiesAction, (void *)properties );
        cg->release();
	}
	
	XTRACE(this, 0, 0, "setProperties - Exit");
	
	return result;
}