All pastes #751073 Raw Edit

Untitled

public text v1 · immutable
#751073 ·published 2007-10-27 00:56 UTC
rendered paste body
io_service_t    platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault,
								   IOServiceMatching("IOPlatformExpertDevice"));

if (platformExpert) {
	CFTypeRef serialNumberAsCFString =
		IORegistryEntryCreateCFProperty(platformExpert,
										CFSTR(kIOPlatformSerialNumberKey),
										kCFAllocatorDefault, 0);
	if (serialNumberAsCFString) {
		NSLog(@"SN: %@",serialNumberAsCFString);
	}

	IOObjectRelease(platformExpert);
}