Package com.sun.jna.platform.mac
Klasse IOKitUtil
java.lang.Object
com.sun.jna.platform.mac.IOKitUtil
Provides utilities for IOKit.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetBSDNameMatchingDict
(String bsdName) Convenience method to get the IO dictionary matching a bsd name.static int
Gets a pointer to the Mach Master Port.static IOKit.IOService
getMatchingService
(CoreFoundation.CFDictionaryRef matchingDictionary) Opens a the first IOService matching a dictionary.static IOKit.IOService
getMatchingService
(String serviceName) Opens a the first IOService matching a service name.static IOKit.IOIterator
getMatchingServices
(CoreFoundation.CFDictionaryRef matchingDictionary) Convenience method to get IOService objects matching a dictionary.static IOKit.IOIterator
getMatchingServices
(String serviceName) Convenience method to get IOService objects matching a service name.static IOKit.IORegistryEntry
getRoot()
Gets the IO Registry root.
-
Methodendetails
-
getMasterPort
public static int getMasterPort()Gets a pointer to the Mach Master Port.- Gibt zurück:
- The master port.
Multiple calls to
getMasterPort()
will not result in leaking ports (each call toIOKit.IOMasterPort(int, com.sun.jna.ptr.IntByReference)
adds another send right to the port) but it is considered good programming practice to deallocate the port when you are finished with it, usingSystemB.mach_port_deallocate(int, int)
.
-
getRoot
Gets the IO Registry root.- Gibt zurück:
- a handle to the IORoot. Callers should release when finished, using
IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.
-
getMatchingService
Opens a the first IOService matching a service name.- Parameter:
serviceName
- The service name to match- Gibt zurück:
- a handle to an IOService if successful,
null
if failed. Callers should release when finished, usingIOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.
-
getMatchingService
Opens a the first IOService matching a dictionary.- Parameter:
matchingDictionary
- The dictionary to match. This method will consume a reference to the dictionary.- Gibt zurück:
- a handle to an IOService if successful,
null
if failed. Callers should release when finished, usingIOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.
-
getMatchingServices
Convenience method to get IOService objects matching a service name.- Parameter:
serviceName
- The service name to match- Gibt zurück:
- a handle to an IOIterator if successful,
null
if failed. Callers should release when finished, usingIOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.
-
getMatchingServices
public static IOKit.IOIterator getMatchingServices(CoreFoundation.CFDictionaryRef matchingDictionary) Convenience method to get IOService objects matching a dictionary.- Parameter:
matchingDictionary
- The dictionary to match. This method will consume a reference to the dictionary.- Gibt zurück:
- a handle to an IOIterator if successful,
null
if failed. Callers should release when finished, usingIOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.
-
getBSDNameMatchingDict
Convenience method to get the IO dictionary matching a bsd name.- Parameter:
bsdName
- The bsd name of the registry entry- Gibt zurück:
- The dictionary ref if successful,
null
if failed. Callers should release when finished, usingIOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.
-