Host (macOS): uses IORegistryEntryFromPath if applicatable

This commit is contained in:
李通洲
2026-01-04 15:37:49 +08:00
parent e23edae917
commit 6f87026b0c
+1 -2
View File
@@ -1,13 +1,12 @@
#include "host.h"
#include "common/sysctl.h"
#include "util/apple/cf_helpers.h"
#include "util/stringUtils.h"
#include <IOKit/IOKitLib.h>
const char* getProductNameWithIokit(FFstrbuf* result)
{
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t registryEntry = IOServiceGetMatchingService(MACH_PORT_NULL, IOServiceNameMatching("product"));
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t registryEntry = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/product");
if (!registryEntry)
return "IOServiceGetMatchingService() failed";