From 3d84ad19bebd93ab85a6317bc39168a5ba14bf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 13 Jan 2026 10:12:14 +0800 Subject: [PATCH] macOS: uses `MACH_PORT_NULL` to maintain compatibility with older SDKs Fixes #2140 --- src/detection/bootmgr/bootmgr_apple.c | 4 ++-- src/detection/physicalmemory/physicalmemory_apple.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detection/bootmgr/bootmgr_apple.c b/src/detection/bootmgr/bootmgr_apple.c index c7e1bde73..2e00f7f23 100644 --- a/src/detection/bootmgr/bootmgr_apple.c +++ b/src/detection/bootmgr/bootmgr_apple.c @@ -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"; diff --git a/src/detection/physicalmemory/physicalmemory_apple.m b/src/detection/physicalmemory/physicalmemory_apple.m index 2812f7707..64b73d9b3 100644 --- a/src/detection/physicalmemory/physicalmemory_apple.m +++ b/src/detection/physicalmemory/physicalmemory_apple.m @@ -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";