34
34
import com .sun .jna .platform .mac .CoreFoundation .CFMutableDictionaryRef ;
35
35
import com .sun .jna .platform .mac .CoreFoundation .CFStringRef ;
36
36
import com .sun .jna .platform .mac .CoreFoundation .CFTypeRef ;
37
+ import com .sun .jna .platform .mac .SystemB .MachPort ;
38
+ import com .sun .jna .platform .mac .SystemB .TaskPort ;
37
39
import com .sun .jna .ptr .IntByReference ;
38
40
import com .sun .jna .ptr .LongByReference ;
39
41
import com .sun .jna .ptr .PointerByReference ;
@@ -52,8 +54,6 @@ public interface IOKit extends Library {
52
54
double kIOPSTimeRemainingUnlimited = -2.0 ;
53
55
double kIOPSTimeRemainingUnknown = -1.0 ;
54
56
55
- MachPort MACH_PORT_NULL = new MachPort ();
56
-
57
57
/**
58
58
* IOKitLib implements non-kernel task access to common IOKit object types -
59
59
* IORegistryEntry, IOService, IOIterator etc. These functions are generic -
@@ -90,25 +90,6 @@ public int release() {
90
90
}
91
91
}
92
92
93
- /**
94
- * Communication between tasks is an important element of the Mach philosophy.
95
- * Mach supports a client/server system structure in which tasks (clients)
96
- * access services by making requests of other tasks (servers) via messages sent
97
- * over a communication channel.
98
- * <p>
99
- * The endpoints of these communication channels in Mach are called ports, while
100
- * port rights denote permission to use the channel.
101
- */
102
- class MachPort extends IOObject {
103
- public MachPort () {
104
- super ();
105
- }
106
-
107
- public MachPort (Pointer p ) {
108
- super (p );
109
- }
110
- }
111
-
112
93
/**
113
94
* An IOKit iterator handle.
114
95
*/
@@ -128,7 +109,7 @@ public IOIterator(Pointer p) {
128
109
* returned, otherwise zero is returned. The element should be released
129
110
* by the caller when it is finished.
130
111
*/
131
- public IOService next () {
112
+ public IORegistryEntry next () {
132
113
return INSTANCE .IOIteratorNext (this );
133
114
}
134
115
}
@@ -178,7 +159,7 @@ public IOConnect(Pointer p) {
178
159
* Returns the mach port used to initiate communication with IOKit.
179
160
*
180
161
* @param bootstrapPort
181
- * Pass {@link #MACH_PORT_NULL} for the default.
162
+ * Pass {@link SystemB #MACH_PORT_NULL} for the default.
182
163
* @param masterPort
183
164
* A pointer to the master port is returned. Multiple calls to
184
165
* IOMasterPort will not result in leaking ports (each call to
@@ -285,7 +266,7 @@ int IOServiceGetMatchingServices(MachPort masterPort, CFDictionaryRef matchingDi
285
266
* returned, otherwise zero is returned. The element should be released
286
267
* by the caller when it is finished.
287
268
*/
288
- IOService IOIteratorNext (IOIterator iterator );
269
+ IORegistryEntry IOIteratorNext (IOIterator iterator );
289
270
290
271
/**
291
272
* Create a CF representation of a registry entry's property.
@@ -463,7 +444,7 @@ CFTypeRef IORegistryEntrySearchCFProperty(IORegistryEntry entry, String plane, C
463
444
* {@link IOServiceClose}.
464
445
* @return A return code generated by {@code IOService::newUserClient}.
465
446
*/
466
- int IOServiceOpen (IOService service , MachPort owningTask , int type , PointerByReference connect );
447
+ int IOServiceOpen (IOService service , TaskPort owningTask , int type , PointerByReference connect );
467
448
468
449
/**
469
450
* Returns the busyState of an IOService.
0 commit comments