macOS: uses MACH_PORT_NULL to maintain compatibility with older SDKs

Fixes #2140
This commit is contained in:
李通洲
2026-01-13 10:12:14 +08:00
parent 57aa0cf499
commit 3d84ad19be
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -7,7 +7,7 @@
static const char* detectSecureBoot(bool* result)
{
#if __aarch64__
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(kIOMainPortDefault, "IODeviceTree:/chosen");
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/chosen");
if (!entryDevice)
return "IORegistryEntryFromPath() failed";
@@ -20,7 +20,7 @@ static const char* detectSecureBoot(bool* result)
*result = (bool) *CFDataGetBytePtr((CFDataRef) prop);
#else
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(kIOMainPortDefault, "IODeviceTree:/options");
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/options");
if (!entryDevice)
return "IORegistryEntryFromPath() failed";
@@ -123,7 +123,7 @@ static const char* detectFromSystemProfiler(FFlist* result)
FF_MAYBE_UNUSED static const char* detectFromIokit(FFlist* result)
{
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(kIOMainPortDefault, "IODeviceTree:/chosen");
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/chosen");
if (!entryDevice)
return "IORegistryEntryFromPath() failed";