Ich mache es unter MacOS folgendermaßen:
Delphi-Quellcode:
var PlatformExpert: io_service_t;
M: CFMutableDictionaryRef;
SerialNumberAsCFString: CFTypeRef;
_AnsiChar: PAnsiChar;
begin
M := IOServiceMatching('IOPlatformExpertDevice');
PlatformExpert := IOServiceGetMatchingService(kIOMasterPortDefault,CFDictionaryRef(M));
SerialNumberAsCFString := IORegistryEntryCreateCFProperty(PlatformExpert, CFSTR('IOPlatformSerialNumber'),kCFAllocatorDefault,0);
_AnsiChar := CFStringGetCStringPtr(SerialNumberAsCFString,0);
Result := String(AnsiString(_AnsiChar));
IOObjectRelease(PlatformExpert);
end;