KextManager.h

Includes:
<CoreFoundation/CoreFoundation.h>
<libkern/OSReturn.h>
<sys/cdefs.h>

Overview

The KextManager API provides a simple interface for applications to load kernel extensions (kexts) via RPC to kextd, and to look up the URLs for kexts by bundle identifier.



Functions

KextManagerCreateURLForBundleIdentifier

Create a URL locating a kext with a given bundle identifier.

KextManagerLoadKextWithIdentifier

Request the kext loading system to load a kext with a given bundle identifier.

KextManagerLoadKextWithURL

Request the kext loading system to load a kext with a given URL.


KextManagerCreateURLForBundleIdentifier


Create a URL locating a kext with a given bundle identifier.

Parameters
allocator

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

kextIdentifier

The bundle identifier to look up.

Return Value

A CFURLRef locating a kext with the requested bundle identifier. Returns NULL if the kext cannot be found, or on error.

Discussion

Kexts are looked up first by whether they are loaded, second by version. Specifically, if kextIdentifier identifies a kext that is currently loaded, the returned URL will locate that kext if it's still present on disk. If the requested kext is not loaded, or if its bundle is not at the location it was originally loaded from, the returned URL will locate the latest version of the desired kext, if one can be found within the system extensions folder. If no version of the kext can be found, NULL is returned.


KextManagerLoadKextWithIdentifier


Request the kext loading system to load a kext with a given bundle identifier.

OSReturn KextManagerLoadKextWithIdentifier( 
    CFStringRef kextIdentifier, 
    CFArrayRef dependencyKextAndFolderURLs);  
Parameters
kextIdentifier

The bundle identifier of the kext to look up and load.

dependencyKextAndFolderURLs

An array of additional URLs, of individual kexts and of folders that may contain kexts.

Return Value

kOSReturnSuccess if the kext is successfully loaded (or is already loaded), otherwise returns on error.

Discussion

kextIdentifier is looked up in the system extensions folder and among any kexts from dependencyKextAndFolderURLs. Any non-kext URLs in dependencyKextAndFolderURLs are scanned at the top level for kexts and plugins of kexts.

Either the calling process must have an effective user id of 0 (superuser), or the kext being loaded and all its dependencies must reside in /System and have an OSBundleAllowUserLoad property of true.


KextManagerLoadKextWithURL


Request the kext loading system to load a kext with a given URL.

OSReturn KextManagerLoadKextWithURL( 
    CFURLRef kextURL, 
    CFArrayRef dependencyKextAndFolderURLs);  
Parameters
kextURL

The URL of the kext to load.

dependencyKextAndFolderURLs

An array of additional URLs, of individual kexts and of folders that may contain kexts.

Return Value

kOSReturnSuccess if the kext is successfully loaded (or is already loaded), otherwise returns on error.

Discussion

Any non-kext URLs in dependencyKextAndFolderURLs are scanned at the top level for kexts and plugins of kexts.

Either the calling process must have an effective user id of 0 (superuser), or the kext being loaded and all its dependencies must reside in /System and have an OSBundleAllowUserLoad property of true.

 

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-10-15