You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iPadOS 16.1下使用IORegistryEntryCreateCFProperties无法获取Driver属性

DriverKit驱动属性读取异常问题

我们使用DriverKit开发驱动程序,客户端App可成功发现驱动,但调用IORegistryEntryCreateCFProperties读取IORegistry属性时,仅能获取到IOClass这一项属性,其他属性均无法读取。

客户端App中用于读取属性的代码如下:

private func debugRegistry(device: io_object_t) {
    var dictionary: Unmanaged<CFMutableDictionary>?
    IORegistryEntryCreateCFProperties(device, &dictionary, kCFAllocatorDefault, .zero)
    if let dictionary = dictionary {
        let values = dictionary.takeUnretainedValue()
        print(values)
    }
}

输出结果为:

{
    IOClass = IOUserService;
}

在macOS上测试相同代码时,输出包含20多个属性。由此推测iPadOS上的IOKit限制了除IOClass外的其他属性读取权限。

环境信息

  • Xcode:Version 14.1 beta 2 (14B5024i)
  • iPadOS:iOS 16.1 (20B5050f)

内容的提问来源于stack exchange,提问作者Myurik

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 07:55:20