From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/common/impl/kmod_apple.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/common/impl/kmod_apple.c (limited to 'src/common/impl/kmod_apple.c') diff --git a/src/common/impl/kmod_apple.c b/src/common/impl/kmod_apple.c new file mode 100644 index 0000000..82edc49 --- /dev/null +++ b/src/common/impl/kmod_apple.c @@ -0,0 +1,12 @@ +#include "common/kmod.h" +#include "common/apple/cf_helpers.h" +#include +#include + +bool ffKmodLoaded(const char* modName) { + FF_CFTYPE_AUTO_RELEASE CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, modName, kCFStringEncodingUTF8); + FF_CFTYPE_AUTO_RELEASE CFArrayRef identifiers = CFArrayCreate(kCFAllocatorDefault, (const void**) &name, 1, &kCFTypeArrayCallBacks); + FF_CFTYPE_AUTO_RELEASE CFArrayRef keys = CFArrayCreate(kCFAllocatorDefault, NULL, 0, NULL); + FF_CFTYPE_AUTO_RELEASE CFDictionaryRef kextInfo = KextManagerCopyLoadedKextInfo(identifiers, keys); + return CFDictionaryContainsKey(kextInfo, name); +} -- cgit v1.2.3