开发者

Does Mac OS UUID depend on hard disk?

I use this code to get UUID on Mac OS

NSString* getComputerId()
{   
    io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
    CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
    IOObjectRelease(ioRegistryRoot);
    return (NSString*) uuidCf;
}

Does this UUID depend on hard disk? Will UUID change if users 开发者_运维百科replace their hard disk?


There's no mention of the HDD in the CFUUID documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜