site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com thank you very much Justin the following code does the job { const char *computerSerialNumber = NULL; CFTypeRef CFComputerSerialNumber = NULL; io_object_t ioEntry; io_iterator_t ioIterator; kern_return_t kernResult; mach_port_t masterPort; kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort); On May 21, 2005, at 4:10 PM, Justin Walker wrote: On May 21, 2005, at 8:52, Dmitry Markman wrote: Hi is it possible to access PROM data? specifically we need to obtain computer's serial number thanks Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for General Semantics -------- Some people have a mental horizon of radius zero, and call it their point of view. -- David Hilbert -------- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/dmarkman%40mac.com This email sent to dmarkman@mac.com Dmitry Markman _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... if(kernResult == KERN_SUCCESS) { kernResult = IORegistryCreateIterator (masterPort,kIOServicePlane,0,&ioIterator); } if(kernResult == KERN_SUCCESS) { ioEntry = IOIteratorNext(ioIterator); if(ioEntry != 0) { CFComputerSerialNumber = IORegistryEntrySearchCFProperty(ioEntry,kIOServicePlane,CFSTR (kIOPlatformSerialNumberKey),kCFAllocatorDefault,0); IOObjectRelease(ioEntry); } IOObjectRelease(ioIterator); } if(CFComputerSerialNumber != NULL) { if(CFStringGetTypeID() == CFGetTypeID (CFComputerSerialNumber)) { computerSerialNumber = CFStringGetCStringPtr ((CFStringRef)CFComputerSerialNumber,kCFStringEncodingMacRoman); } CFRelease(CFComputerSerialNumber); } if(computerSerialNumber != NULL) printf("Serial Number: % s\n",computerSerialNumber); } however I suppose that there is a more elegant way by using some matching facility I don't know how to do that, but 'ioreg -l' will show you the system's serial number (IOPlatformSerialNumber). Digging through the source may help; I took a quick look (IOKitTools project), but nothing said "here I am" ;-/ This email sent to site_archiver@lists.apple.com
participants (1)
-
Dmitry Markman