├── hid.subproj ├── IOHIDEvent.h ├── IOHIDService.c ├── IOHIDService.h ├── IOHIDSession.c ├── IOHIDSession.h ├── IOHIDEventQueue.c ├── IOHIDEventQueue.h ├── IOHIDEventServer.c ├── IOHIDEventServer.h ├── IOHIDEventSystem.c ├── IOHIDEventSystem.h ├── IOHIDNotification.c ├── IOHIDNotification.h ├── IOHIDPlugins.c ├── IOHIDServiceClient.c ├── IOHIDServiceClient.h ├── IOHIDServiceFilter.c ├── IOHIDServiceFilter.h ├── IOHIDServiceKeys.c ├── IOHIDServiceKeys.h ├── IOHIDServicePrivate.h ├── IOHIDSessionFilter.c ├── IOHIDSessionFilter.h ├── IOHIDSessionPrivate.h ├── IOHIDEventSystemClient.c ├── IOHIDEventSystemClient.h ├── IOHIDEventSystemKeys.h ├── IOHIDEventSystemMIG.defs ├── IOHIDEventSystemPrivate.c ├── IOHIDEventSystemPrivate.h ├── IOHIDServicePlugIn.h ├── IOHIDConnectionFilter.c ├── IOHIDEventSystemClientMIG.defs ├── IOHIDEventSystemClientPrivate.h ├── IOHIDEventSystemConnection.c ├── IOHIDEventSystemConnection.h ├── IOHIDEventSystemKeysPrivate.h ├── IOHIDServiceConnectionCache.c ├── IOHIDServiceConnectionCache.h ├── IOHIDServiceFilterPlugIn.h ├── IOHIDSessionFilterPlugIn.h ├── IOHIDConnectionFilter.h ├── IOHIDEventSystemConnectionPrivate.h ├── IOHIDDeviceObjc.m ├── IOHIDSessionObjc.m ├── IOHIDServiceObjc.m ├── HIDSessionBase.m ├── HIDEventBase.h ├── IOHIDElementObjc.m ├── HIDDeviceBase.h ├── HIDElementBase.h ├── HIDSessionBase.h ├── IOHIDConnectionObjc.m ├── HIDServiceBase.h ├── IOHIDServiceClientObjc.m ├── HIDConnectionBase.h ├── HIDServiceClientBase.h ├── HIDEventBasePrivate.h ├── IOHIDElementPrivate.h ├── Logging │ └── com.apple.iohid.service.plist ├── HIDServiceBase.m ├── HIDDeviceBase.m ├── IOHIDPlugins.h ├── HIDServiceClientBase.m ├── IOHIDDevicePrivate.h ├── IOHIDEventPrivate.h ├── IOHIDServiceClientPrivate.h ├── HIDConnectionBase.m ├── HIDElementBase.m ├── IOHIDEvent.c ├── HIDElementIvar.h ├── HIDEventIvar.h ├── IOHIDEventPrivateKeys.h ├── HIDSessionIvar.h ├── HIDServiceClientIvar.h ├── IOHIDLib.h ├── IOHIDTypes.h ├── HIDEventBase.m ├── HIDDeviceIvar.h ├── IOHIDEventObjc.m ├── IOHIDEventLegacySupport.h └── IOHIDPreferences.h ├── Modules ├── IOKit-Embedded.modulemap └── IOKit.private.modulemap ├── IOCFSerializeTest.c ├── en.lproj └── IODescription.strings ├── pwr_mgt.subproj └── IOPMLibPrivate.h ├── graphics.subproj ├── GetSymbolFromPEF.h └── IOGraphicsLibPrivate.h ├── hidsystem.subproj ├── event_status_driver.h ├── IOHIDLibSPI.h ├── setaccl.c └── HIDParamTest.c ├── iokitsimd.subproj ├── _iokitsimd ├── com.apple.iokitsimd.plist ├── interpose.c ├── main.c └── iokitsimd.defs ├── IOServiceAuthorizeAgent ├── en.lproj │ └── Localizable.strings ├── IOServiceAuthorizeAgent.entitlements ├── Info.plist ├── authorize.h ├── application.h ├── preferences.h ├── device.h ├── storage │ └── storage.h ├── usb │ └── usb.h └── preferences.m ├── kext.xcconfig ├── tests ├── Makefile ├── Resources │ └── kexts │ │ ├── DoNothing │ │ ├── DoNothing.c │ │ └── Info.plist │ │ └── DoNothing-10undef │ │ ├── Info.plist │ │ └── DoNothing_10undef.c └── IOKitLib-tests.c ├── IOKitPMUnitTests └── Stubs │ ├── EnergyTraceStubs.h │ ├── NotifyStubs.h │ ├── XPCStubs.h │ ├── DispatchStubs.h │ ├── EnergyTraceStubs.m │ └── IOKitPMStubs.h ├── ioserviceauthorized ├── ioserviceauthorized.entitlements ├── open.h └── Info.plist ├── CustomInfo.plist ├── audio_video.subproj ├── IOAVLib.c ├── IOAVLib.h ├── IOAVLibUtil.h ├── IOAVLibPrivate.h ├── IOAVDevice.c ├── IOAVDisplayMemory.c ├── IOAVControlInterface.h ├── IOAVController.c ├── IOAVDevice.h ├── IOAVService.c ├── IOAVService.h ├── IOAVAudioInterface.c ├── IOAVControlInterface.c ├── IOAVController.h ├── IOAVDisplayMemory.h ├── IOAVVideoInterface.c ├── IOAVAudioInterface.h └── IOAVVideoInterface.h ├── display_port.subproj ├── IODPLib.c ├── IODPLib.h ├── IODPHDMIController.h ├── IODPPort.c ├── IODPPort.h ├── IODPController.c ├── IODPDevice.c ├── IODPDevice.h ├── IODPService.c ├── IODPService.h └── IODPController.h ├── usb_device.subproj ├── IOUSBDeviceData.c ├── IOUSBDeviceData.h ├── IOUSBDevicePrivate.h ├── IOUSBDeviceController.c ├── IOUSBDeviceController.h ├── IOUSBDeviceControllerTypes.h ├── IOUSBDeviceDescription.c ├── IOUSBDeviceDescription.h ├── IOUSBDeviceControllerLib.c └── IOUSBDeviceControllerLib.h ├── network.subproj └── IOUserEthernetController.c ├── iokitmig.defs ├── iokitmig.c ├── iokitmig.h ├── IOKitUser.xcconfig ├── IOKitInternal.h ├── IOTrap.s ├── IOBundle.c ├── IOCFBundle.h ├── UnifdefHeaders.sh ├── kext.subproj ├── Architectures.hpp ├── cross_link.h ├── kernelmanagement_shims.h ├── printPList_new.h ├── kextmanager_types.h ├── misc_util.h ├── KextManagerPriv.h ├── misc_util.c └── cross_link.c ├── IOCFSerialize.h ├── usb.subproj └── IOUSBLib.c ├── IOCircularDataQueue.c ├── termclass.c ├── Info.plist ├── IOCFUnserialize.h ├── audio.subproj ├── IOAudioLib.h └── IOAudioLib.c ├── IOCFPlugIn.h ├── IODataQueueClientPrivate.h ├── alloccount.c ├── IOMIGMachPort.h ├── classcount.c ├── DeviceMIG.sh └── IOCFURLAccess.h /hid.subproj/IOHIDEvent.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDService.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDService.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSession.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSession.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventQueue.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventQueue.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventServer.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventServer.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystem.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystem.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDNotification.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDNotification.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDPlugins.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceClient.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceClient.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceFilter.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceFilter.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceKeys.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceKeys.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServicePrivate.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSessionFilter.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSessionFilter.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSessionPrivate.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Modules/IOKit-Embedded.modulemap: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemClient.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemClient.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemKeys.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemMIG.defs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemPrivate.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemPrivate.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServicePlugIn.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDConnectionFilter.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemClientMIG.defs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemClientPrivate.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemConnection.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemConnection.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemKeysPrivate.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceConnectionCache.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceConnectionCache.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceFilterPlugIn.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSessionFilterPlugIn.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDConnectionFilter.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventSystemConnectionPrivate.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /IOCFSerializeTest.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/IOKitUser/HEAD/IOCFSerializeTest.c -------------------------------------------------------------------------------- /en.lproj/IODescription.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/IOKitUser/HEAD/en.lproj/IODescription.strings -------------------------------------------------------------------------------- /pwr_mgt.subproj/IOPMLibPrivate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/IOKitUser/HEAD/pwr_mgt.subproj/IOPMLibPrivate.h -------------------------------------------------------------------------------- /graphics.subproj/GetSymbolFromPEF.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/IOKitUser/HEAD/graphics.subproj/GetSymbolFromPEF.h -------------------------------------------------------------------------------- /hidsystem.subproj/event_status_driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/IOKitUser/HEAD/hidsystem.subproj/event_status_driver.h -------------------------------------------------------------------------------- /iokitsimd.subproj/_iokitsimd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | INDIGO_PREFIX=${DYLD_ROOT_PATH} 4 | unset DYLD_ROOT_PATH 5 | 6 | exec ${INDIGO_PREFIX}/usr/sbin/iokitsimd "${@}" 7 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/IOKitUser/HEAD/IOServiceAuthorizeAgent/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /kext.xcconfig: -------------------------------------------------------------------------------- 1 | BUILD_VARIANTS = normal kasan 2 | // BUILD_VARIANTS[sdk=macosx*] = normal kasan 3 | // BUILD_VARIANTS[sdk=iphoneos*] = normal kasan 4 | CODE_SIGN_IDENTITY = - 5 | OTHER_CFLAGS_kasan = $(KASAN_DEFAULT_CFLAGS) 6 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | PROJECT := IOKitUser 2 | TEST_DIR := tests 3 | 4 | include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common 5 | 6 | OTHER_LDFLAGS += -framework IOKit -framework CoreFoundation 7 | 8 | include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets 9 | -------------------------------------------------------------------------------- /IOKitPMUnitTests/Stubs/EnergyTraceStubs.h: -------------------------------------------------------------------------------- 1 | // 2 | // EnergyTraceStubs.h 3 | // IOKitUser 4 | // 5 | // Created by Faramola Isiaka on 7/21/21. 6 | // 7 | 8 | #ifndef EnergyTraceStubs_h 9 | #define EnergyTraceStubs_h 10 | 11 | #include 12 | 13 | #endif /* EnergyTraceStubs_h */ 14 | -------------------------------------------------------------------------------- /IOKitPMUnitTests/Stubs/NotifyStubs.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotifyStubs.h 3 | // IOKitUser 4 | // 5 | // Created by Faramola Isiaka on 8/2/21. 6 | // 7 | 8 | #ifndef NotifyStubs_h 9 | #define NotifyStubs_h 10 | 11 | #include 12 | void NotifyStubsTeardown(void); 13 | 14 | #endif /* NotifyStubs_h */ 15 | -------------------------------------------------------------------------------- /IOKitPMUnitTests/Stubs/XPCStubs.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPCStubs.h 3 | // IOKitUser 4 | // 5 | // Created by Faramola Isiaka on 8/2/21. 6 | // 7 | 8 | #ifndef XPCStubs_h 9 | #define XPCStubs_h 10 | 11 | #include 12 | 13 | void addReplyForConnection(const char* connectionName, xpc_object_t reply); 14 | void XPCStubsTeardown(void); 15 | 16 | #endif /* XPCStubs_h */ 17 | -------------------------------------------------------------------------------- /ioserviceauthorized/ioserviceauthorized.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.private.tcc.allow 6 | 7 | kTCCServiceSystemPolicyRemovableVolumes 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IOKitPMUnitTests/Stubs/DispatchStubs.h: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchStubs.h 3 | // IOKitUser 4 | // 5 | // Created by Faramola Isiaka on 7/21/21. 6 | // 7 | 8 | #ifndef DispatchStubs_h 9 | #define DispatchStubs_h 10 | 11 | #include 12 | 13 | dispatch_time_t getCurrentTime(void); 14 | void advanceTime(dispatch_time_t newTime); 15 | void clearTime(void); 16 | void DispatchStubsTeardown(void); 17 | 18 | #endif /* DispatchStubs_h */ 19 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDDeviceObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDDeviceObjc.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/17/18. 6 | // 7 | 8 | #import 9 | #import "HIDDeviceBase.h" 10 | 11 | CFTypeID IOHIDDeviceGetTypeID(void) 12 | { 13 | return (CFTypeID)[HIDDevice self]; 14 | } 15 | 16 | IOHIDDeviceRef _IOHIDDeviceCreatePrivate(CFAllocatorRef allocator __unused) 17 | { 18 | return (__bridge IOHIDDeviceRef)[[HIDDevice alloc] init]; 19 | } 20 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDSessionObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDSessionObjc.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #include "HIDSessionBase.h" 9 | 10 | CFTypeID IOHIDSessionGetTypeID(void) 11 | { 12 | return (CFTypeID)[HIDSession self]; 13 | } 14 | 15 | IOHIDSessionRef _IOHIDSessionCreatePrivate(CFAllocatorRef allocator) 16 | { 17 | return (__bridge IOHIDSessionRef)[[HIDSession allocWithZone:(struct _NSZone *)allocator] init]; 18 | } 19 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDServiceObjc.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #include "HIDServiceBase.h" 9 | 10 | CFTypeID IOHIDServiceGetTypeID(void) 11 | { 12 | return (CFTypeID)[HIDEventService self]; 13 | } 14 | 15 | IOHIDServiceRef _IOHIDServiceCreatePrivate(CFAllocatorRef allocator) 16 | { 17 | return (__bridge IOHIDServiceRef)[[HIDEventService allocWithZone:(struct _NSZone *)allocator] init]; 18 | } 19 | -------------------------------------------------------------------------------- /hid.subproj/HIDSessionBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDSessionBase.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #import "IOHIDSessionPrivate.h" 9 | #import "HIDSessionBase.h" 10 | #import 11 | 12 | @implementation HIDSession 13 | 14 | - (CFTypeID)_cfTypeID { 15 | return IOHIDSessionGetTypeID(); 16 | } 17 | 18 | - (void)dealloc 19 | { 20 | _IOHIDSessionReleasePrivate((__bridge IOHIDSessionRef)self); 21 | [super dealloc]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /hid.subproj/HIDEventBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDEventBase.h 3 | // IOKitUser 4 | // 5 | // Created by Matt Dekom on 9/11/18. 6 | // 7 | 8 | #ifndef HIDEventBase_h 9 | #define HIDEventBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDEvent : NSObject { 18 | @protected 19 | HIDEventStruct _event; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | #endif /* HIDEventBase_h */ 27 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDElementObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDElementObjc.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/4/18. 6 | // 7 | 8 | #import 9 | #import 10 | #import "HIDElementBase.h" 11 | 12 | CFTypeID IOHIDElementGetTypeID(void) 13 | { 14 | return (CFTypeID)[HIDElement self]; 15 | } 16 | 17 | IOHIDElementRef _IOHIDElementCreatePrivate(CFAllocatorRef allocator __unused) 18 | { 19 | return (__bridge IOHIDElementRef)[[HIDElement alloc] init]; 20 | } 21 | -------------------------------------------------------------------------------- /hid.subproj/HIDDeviceBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDDeviceBase.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/17/18. 6 | // 7 | 8 | #ifndef HIDDeviceBase_h 9 | #define HIDDeviceBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDDevice : NSObject { 18 | @protected 19 | HIDDeviceStruct _device; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | #endif /* HIDDeviceBase_h */ 27 | -------------------------------------------------------------------------------- /hid.subproj/HIDElementBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDElementBase.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/4/18. 6 | // 7 | 8 | #ifndef HIDElementBase_h 9 | #define HIDElementBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDElement : NSObject { 18 | @protected 19 | HIDElementStruct _element; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | #endif /* HIDElementBase_h */ 27 | -------------------------------------------------------------------------------- /hid.subproj/HIDSessionBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDSessionBase.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #ifndef HIDSessionBase_h 9 | #define HIDSessionBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDSession : NSObject { 18 | @protected 19 | HIDSessionStruct _session; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | #endif /* HIDSessionBase_h */ 27 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDConnectionObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDConnectionObjc.m 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/16/18. 6 | // 7 | 8 | #include "HIDConnectionBase.h" 9 | 10 | CFTypeID IOHIDEventSystemConnectionGetTypeID(void) 11 | { 12 | return (CFTypeID)[HIDConnection self]; 13 | } 14 | 15 | IOHIDEventSystemConnectionRef _IOHIDEventSystemConnectionCreatePrivate(CFAllocatorRef allocator) 16 | { 17 | return (__bridge IOHIDEventSystemConnectionRef)[[HIDConnection allocWithZone:(struct _NSZone *)allocator] init]; 18 | } 19 | -------------------------------------------------------------------------------- /hid.subproj/HIDServiceBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDServiceBase.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #ifndef HIDServiceBase_h 9 | #define HIDServiceBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDEventService : NSObject { 18 | @protected 19 | HIDServiceStruct _service; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | 27 | #endif /* HIDServiceBase_h */ 28 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceClientObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDServiceClientObjc.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/5/18. 6 | // 7 | 8 | #import 9 | #import "HIDServiceClientBase.h" 10 | 11 | CFTypeID IOHIDServiceClientGetTypeID(void) 12 | { 13 | return (CFTypeID)[HIDServiceClient self]; 14 | } 15 | 16 | IOHIDServiceClientRef _IOHIDServiceClientCreatePrivate(CFAllocatorRef allocator __unused) 17 | { 18 | return (__bridge IOHIDServiceClientRef)[[HIDServiceClient alloc] init]; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /hid.subproj/HIDConnectionBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDConnectionBase.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/16/18. 6 | // 7 | 8 | #ifndef HIDConnectionBase_h 9 | #define HIDConnectionBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDConnection : NSObject { 18 | @protected 19 | HIDConnectionStruct _connection; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | #endif /* HIDConnectionBase_h */ 27 | -------------------------------------------------------------------------------- /hid.subproj/HIDServiceClientBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDServiceClientBase.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/5/18. 6 | // 7 | 8 | #ifndef HIDServiceClientBase_h 9 | #define HIDServiceClientBase_h 10 | 11 | #if __OBJC__ 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @interface HIDServiceClient : NSObject { 18 | @protected 19 | HIDServiceClientStruct _client; 20 | } 21 | 22 | @end 23 | 24 | #endif /* __OBJC__ */ 25 | 26 | #endif /* HIDServiceClientBase_h */ 27 | -------------------------------------------------------------------------------- /iokitsimd.subproj/com.apple.iokitsimd.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.apple.iokitsimd 7 | ProgramArguments 8 | 9 | /usr/sbin/_iokitsimd 10 | 11 | MachServices 12 | 13 | com.apple.iokitsimd 14 | 15 | 16 | EnableTransactions 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /hid.subproj/HIDEventBasePrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDEventBasePrivate.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/11/18. 6 | // 7 | 8 | #ifndef HIDEventBasePrivate_h 9 | #define HIDEventBasePrivate_h 10 | 11 | #import "HIDEventBase.h" 12 | 13 | @interface HIDEvent (Private) 14 | 15 | - (nullable instancetype)initWithSize:(NSUInteger)size 16 | type:(IOHIDEventType)type 17 | timestamp:(uint64_t)timestamp 18 | options:(uint32_t)options; 19 | 20 | @end 21 | 22 | #endif /* HIDEventBasePrivate_h */ 23 | -------------------------------------------------------------------------------- /tests/Resources/kexts/DoNothing/DoNothing.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DoNothing.kext 3 | * A bare do nothing kext. It should have zero undefined symbols. 4 | */ 5 | 6 | #include 7 | 8 | #define UNUSED __attribute__((unused)) 9 | 10 | kern_return_t DoNothing_start(kmod_info_t * ki, void *d); 11 | kern_return_t DoNothing_stop(kmod_info_t *ki, void *d); 12 | 13 | kern_return_t DoNothing_start(UNUSED kmod_info_t * ki, UNUSED void *d) 14 | { 15 | return KERN_SUCCESS; 16 | } 17 | 18 | kern_return_t DoNothing_stop(UNUSED kmod_info_t *ki, UNUSED void *d) 19 | { 20 | return KERN_SUCCESS; 21 | } 22 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDElementPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDElementPrivate.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 8/31/18. 6 | // 7 | 8 | #ifndef IOHIDElementPrivate_h 9 | #define IOHIDElementPrivate_h 10 | 11 | #include 12 | 13 | __BEGIN_DECLS 14 | 15 | CF_ASSUME_NONNULL_BEGIN 16 | CF_IMPLICIT_BRIDGING_ENABLED 17 | 18 | CF_EXPORT 19 | IOHIDElementRef _Nullable _IOHIDElementCreatePrivate(CFAllocatorRef _Nullable allocator); 20 | 21 | CF_EXPORT 22 | void _IOHIDElementReleasePrivate(IOHIDElementRef element); 23 | 24 | CF_IMPLICIT_BRIDGING_DISABLED 25 | CF_ASSUME_NONNULL_END 26 | 27 | __END_DECLS 28 | 29 | #endif /* IOHIDElementPrivate_h */ 30 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/IOServiceAuthorizeAgent.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.private.iokit.IOServiceSetAuthorizationID 6 | 7 | com.apple.security.application-groups 8 | 9 | group.com.apple.iokit.IOServiceAuthorizeAgent 10 | 11 | com.apple.private.security.restricted-application-groups 12 | 13 | group.com.apple.iokit.IOServiceAuthorizeAgent 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /hid.subproj/Logging/com.apple.iohid.service.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DEFAULT-OPTIONS 6 | 7 | Enable-Oversize-Messages 8 | 9 | 10 | service.carplay 11 | 12 | TTL 13 | 14 | Default 15 | 2 16 | 17 | 18 | hidsignpost 19 | 20 | Signpost-Scope 21 | Process 22 | Signpost-Persisted 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /hid.subproj/HIDServiceBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDServiceBase.m 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #import "IOHIDServicePrivate.h" 9 | #import "HIDServiceBase.h" 10 | #import 11 | 12 | @implementation HIDEventService 13 | 14 | - (CFTypeID)_cfTypeID { 15 | return IOHIDServiceGetTypeID(); 16 | } 17 | 18 | - (void)dealloc 19 | { 20 | _IOHIDServiceReleasePrivate((__bridge IOHIDServiceRef)self); 21 | [super dealloc]; 22 | } 23 | 24 | - (NSString *)description 25 | { 26 | NSString *desc = (__bridge NSString *)IOHIDServiceCopyDescription( 27 | (__bridge IOHIDServiceRef)self); 28 | return [desc autorelease]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /hid.subproj/HIDDeviceBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDDeviceBase.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/17/18. 6 | // 7 | 8 | #import "IOHIDDevicePrivate.h" 9 | #import "IOHIDLibPrivate.h" 10 | #import "HIDDeviceBase.h" 11 | #import 12 | 13 | @implementation HIDDevice 14 | 15 | - (CFTypeID)_cfTypeID { 16 | return IOHIDDeviceGetTypeID(); 17 | } 18 | 19 | - (void)dealloc 20 | { 21 | _IOHIDDeviceReleasePrivate((__bridge IOHIDDeviceRef)self); 22 | [super dealloc]; 23 | } 24 | 25 | - (NSString *)description 26 | { 27 | NSString *desc = (__bridge NSString *)IOHIDDeviceCopyDescription( 28 | (__bridge IOHIDDeviceRef)self); 29 | return [desc autorelease]; 30 | } 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDPlugins.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDFilterPlugins.h 3 | // IOKitUser 4 | // 5 | // Created by Cliff Russell on 3/8/11. 6 | // Copyright 2011 Apple Inc. All rights reserved. 7 | // 8 | 9 | CF_EXPORT 10 | const CFArrayCallBacks kIOHIDFilterPluginArrayCallBacks; 11 | 12 | CF_EXPORT 13 | CFArrayRef _IOHIDLoadBundles(); 14 | 15 | CF_EXPORT 16 | CFArrayRef _IOHIDLoadSessionFilterBundles(); 17 | 18 | CF_EXPORT 19 | CFArrayRef _IOHIDLoadServiceFilterBundles(); 20 | 21 | CF_EXPORT 22 | CFArrayRef _IOHIDLoadServicePluginBundles(); 23 | 24 | CF_EXPORT 25 | CFArrayRef _IOHIDLoadConnectionPluginBundles(); 26 | 27 | void _IOHIDPlugInInstanceCacheAdd (CFUUIDRef factory, const void *value); 28 | 29 | void _IOHIDPlugInInstanceCacheClear (); 30 | 31 | boolean_t _IOHIDPlugInInstanceCacheIsEmpty (); 32 | -------------------------------------------------------------------------------- /hid.subproj/HIDServiceClientBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDServiceClientBase.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/5/18. 6 | // 7 | 8 | #import "IOHIDServiceClientPrivate.h" 9 | #import "HIDServiceClientBase.h" 10 | #import 11 | 12 | @implementation HIDServiceClient 13 | 14 | - (CFTypeID)_cfTypeID { 15 | return IOHIDServiceClientGetTypeID(); 16 | } 17 | 18 | - (void)dealloc 19 | { 20 | _IOHIDServiceClientReleasePrivate((__bridge IOHIDServiceClientRef)self); 21 | [super dealloc]; 22 | } 23 | 24 | - (NSString *)description 25 | { 26 | NSString *desc = (__bridge NSString *)IOHIDServiceClientCopyDescription( 27 | (__bridge IOHIDServiceClientRef)self); 28 | return [desc autorelease]; 29 | } 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDDevicePrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDDevicePrivate.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 8/31/18. 6 | // 7 | 8 | #ifndef IOHIDDevicePrivate_h 9 | #define IOHIDDevicePrivate_h 10 | 11 | #include 12 | 13 | __BEGIN_DECLS 14 | 15 | CF_ASSUME_NONNULL_BEGIN 16 | CF_IMPLICIT_BRIDGING_ENABLED 17 | 18 | CF_EXPORT 19 | IOHIDDeviceRef _Nullable _IOHIDDeviceCreatePrivate(CFAllocatorRef _Nullable allocator); 20 | 21 | CF_EXPORT 22 | CFStringRef IOHIDDeviceCopyDescription(IOHIDDeviceRef device); 23 | 24 | CF_EXPORT 25 | void _IOHIDDeviceReleasePrivate(IOHIDDeviceRef device); 26 | 27 | uint64_t IOHIDDeviceGetRegistryEntryID(IOHIDDeviceRef device); 28 | 29 | CF_IMPLICIT_BRIDGING_DISABLED 30 | CF_ASSUME_NONNULL_END 31 | 32 | __END_DECLS 33 | 34 | #endif /* IOHIDDevicePrivate_h */ 35 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDEventPrivate.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 8/20/18. 6 | // 7 | 8 | #ifndef IOHIDEventPrivate_h 9 | #define IOHIDEventPrivate_h 10 | 11 | #include 12 | 13 | CF_EXPORT 14 | IOHIDEventRef _IOHIDEventCreate(CFAllocatorRef allocator, 15 | CFIndex dataSize, 16 | IOHIDEventType type, 17 | uint64_t timeStamp, 18 | IOOptionBits options); 19 | 20 | CF_EXPORT 21 | Boolean _IOHIDEventEqual(CFTypeRef cf1, CFTypeRef cf2); 22 | 23 | CF_EXPORT 24 | CFStringRef IOHIDEventCopyDescription(IOHIDEventRef event); 25 | 26 | CF_EXPORT 27 | CFStringRef _IOHIDEventDebugInfo(IOHIDEventRef event); 28 | 29 | #endif /* IOHIDEventPrivate_h */ 30 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDServiceClientPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDServiceClientPrivate.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 8/31/18. 6 | // 7 | 8 | #ifndef IOHIDServiceClientPrivate_h 9 | #define IOHIDServiceClientPrivate_h 10 | 11 | #include 12 | 13 | __BEGIN_DECLS 14 | 15 | CF_ASSUME_NONNULL_BEGIN 16 | CF_IMPLICIT_BRIDGING_ENABLED 17 | 18 | CF_EXPORT 19 | IOHIDServiceClientRef _Nullable _IOHIDServiceClientCreatePrivate(CFAllocatorRef _Nullable allocator); 20 | 21 | CF_EXPORT 22 | void _IOHIDServiceClientReleasePrivate(IOHIDServiceClientRef service); 23 | 24 | CF_EXPORT 25 | CFStringRef IOHIDServiceClientCopyDescription(IOHIDServiceClientRef service); 26 | 27 | CF_IMPLICIT_BRIDGING_DISABLED 28 | CF_ASSUME_NONNULL_END 29 | 30 | __END_DECLS 31 | 32 | #endif /* IOHIDServiceClientPrivate_h */ 33 | -------------------------------------------------------------------------------- /CustomInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | IOKit 9 | CFBundleGetInfoString 10 | I/O Kit Framework, Apple Computer Inc 11 | CFBundleIdentifier 12 | com.apple.framework.IOKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | I/O Kit Framework 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 2.0.2 21 | CFBundleSignature 22 | ???? 23 | 24 | 25 | -------------------------------------------------------------------------------- /hid.subproj/HIDConnectionBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDConnectionBase.m 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/16/18. 6 | // 7 | 8 | #import "IOHIDEventSystemConnectionPrivate.h" 9 | #import "HIDConnectionBase.h" 10 | #import 11 | 12 | @implementation HIDConnection 13 | 14 | - (CFTypeID)_cfTypeID { 15 | return IOHIDEventSystemConnectionGetTypeID(); 16 | } 17 | 18 | - (NSString *)description 19 | { 20 | NSString *desc = (__bridge NSString *)IOHIDEventSystemConnectionCopyDescription( 21 | (__bridge IOHIDEventSystemConnectionRef)self); 22 | return [desc autorelease]; 23 | } 24 | 25 | - (void)dealloc 26 | { 27 | _IOHIDEventSystemConnectionReleasePrivate( 28 | (__bridge IOHIDEventSystemConnectionRef)self); 29 | [super dealloc]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /tests/Resources/kexts/DoNothing/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | OSBundleLibraries 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/Resources/kexts/DoNothing-10undef/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | OSBundleLibraries 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /IOKitPMUnitTests/Stubs/EnergyTraceStubs.m: -------------------------------------------------------------------------------- 1 | // 2 | // EnergyTraceStubs.m 3 | // IOKitPMUnitTests 4 | // 5 | // Created by Faramola Isiaka on 7/21/21. 6 | // 7 | 8 | #include "EnergyTraceStubs.h" 9 | 10 | void entr_act_begin(__unused entr_component_t component, __unused entr_opcode_t activation_opcode, __unused entr_ident_t activation_id, __unused entr_quality_t activation_quality, __unused entr_value_t activation_value) 11 | { 12 | return; 13 | } 14 | 15 | void entr_act_end(__unused entr_component_t component, __unused entr_opcode_t activation_code, __unused entr_ident_t activation_id, __unused entr_quality_t activation_quality, __unused entr_value_t activation_value) 16 | { 17 | return; 18 | } 19 | 20 | void entr_act_modify(__unused entr_component_t component, __unused entr_opcode_t activation_opcode, __unused entr_ident_t activation_id, __unused entr_quality_t modification_quality, __unused entr_value_t modification_value) 21 | { 22 | return; 23 | } 24 | -------------------------------------------------------------------------------- /hid.subproj/HIDElementBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDElementBase.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/4/18. 6 | // 7 | 8 | #import "IOHIDElementPrivate.h" 9 | #import "HIDElementBase.h" 10 | #import 11 | 12 | @implementation HIDElement 13 | 14 | - (CFTypeID)_cfTypeID { 15 | return IOHIDElementGetTypeID(); 16 | } 17 | 18 | - (void)dealloc 19 | { 20 | _IOHIDElementReleasePrivate((__bridge IOHIDElementRef)self); 21 | [super dealloc]; 22 | } 23 | 24 | - (NSUInteger)hash 25 | { 26 | return (NSUInteger)IOHIDElementGetCookie((__bridge IOHIDElementRef)self); 27 | } 28 | 29 | - (BOOL)isEqual:(id)object { 30 | if (self == object) { 31 | return YES; 32 | } 33 | 34 | if (![object isKindOfClass:[HIDElement class]]) { 35 | return NO; 36 | } 37 | 38 | return (IOHIDElementGetCookie((__bridge IOHIDElementRef)self) == 39 | IOHIDElementGetCookie((__bridge IOHIDElementRef)object)); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /iokitsimd.subproj/interpose.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /iokitsimd.subproj/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVLib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVLibUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPLib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEvent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2008 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceData.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVLibPrivate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDevicePrivate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVDevice.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVDisplayMemory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017, 2024 Apple Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPHDMIController.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2024 Apple, Inc. All Rights Reserved. 4 | * 5 | * @APPLE_LICENSE_HEADER_START@ 6 | * 7 | * This file contains Original Code and/or Modifications of Original Code 8 | * as defined in and that are subject to the Apple Public Source License 9 | * Version 2.0 (the 'License'). You may not use this file except in 10 | * compliance with the License. Please obtain a copy of the License at 11 | * http://www.opensource.apple.com/apsl/ and read it before using this 12 | * file. 13 | * 14 | * The Original Code and all software distributed under the License are 15 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 19 | * Please see the License for the specific language governing rights and 20 | * limitations under the License. 21 | * 22 | * @APPLE_LICENSE_HEADER_END@ 23 | */ 24 | -------------------------------------------------------------------------------- /display_port.subproj/IODPPort.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /display_port.subproj/IODPPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceController.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVControlInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2013 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVController.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVDevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVService.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /display_port.subproj/IODPController.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPDevice.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPDevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /display_port.subproj/IODPService.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceControllerTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceDescription.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceDescription.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVAudioInterface.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVControlInterface.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2013 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVDisplayMemory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017, 2024 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVVideoInterface.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | -------------------------------------------------------------------------------- /display_port.subproj/IODPController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /network.subproj/IOUserEthernetController.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2021 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceControllerLib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /usb_device.subproj/IOUSBDeviceControllerLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVAudioInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /audio_video.subproj/IOAVVideoInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2011 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /iokitmig.defs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | -------------------------------------------------------------------------------- /hid.subproj/HIDElementIvar.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDElementIvar.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/4/18. 6 | // 7 | 8 | #ifndef HIDElementIvar_h 9 | #define HIDElementIvar_h 10 | 11 | #import 12 | #import 13 | #import // for objc_object 14 | 15 | #define HIDElementIvar \ 16 | IOHIDDeviceDeviceInterface **deviceInterface; \ 17 | IOHIDDeviceRef device; \ 18 | IOHIDValueRef value; \ 19 | IOHIDElementStruct *elementStructPtr; \ 20 | uint32_t index; \ 21 | CFDataRef data; \ 22 | CFMutableArrayRef attachedElements; \ 23 | CFArrayRef childElements; \ 24 | IOHIDElementRef parentElement; \ 25 | IOHIDElementRef originalElement; \ 26 | IOHIDCalibrationInfo *calibrationPtr; \ 27 | CFMutableDictionaryRef properties; \ 28 | CFStringRef rootKey; \ 29 | Boolean isDirty; 30 | 31 | typedef struct { 32 | HIDElementIvar 33 | } HIDElementStruct; 34 | 35 | #endif /* HIDElementIvar_h */ 36 | -------------------------------------------------------------------------------- /ioserviceauthorized/open.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | int _Open( io_service_t service, int oflag, uint64_t authorizationID ); 27 | -------------------------------------------------------------------------------- /iokitsimd.subproj/iokitsimd.defs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #define IOKIT 1 25 | #define IOKITSIMD 1 26 | #define __LP64__ 1 27 | 28 | #include 29 | -------------------------------------------------------------------------------- /iokitmig.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #if __LP64__ 24 | # define mig_external __private_extern__ 25 | # include "iokitmig64.c" 26 | #else 27 | # include "iokitmig32.c" 28 | #endif 29 | -------------------------------------------------------------------------------- /iokitmig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #include 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /hid.subproj/HIDEventIvar.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDEventIvar.h 3 | // IOKitUser 4 | // 5 | // Created by dekom on 9/11/18. 6 | // 7 | 8 | #ifndef HIDEventIvar_h 9 | #define HIDEventIvar_h 10 | 11 | #import 12 | #import 13 | #import // for objc_object 14 | 15 | /* 16 | * This is where we define the ivars that will be used by both the CF 17 | * IOHIDEventRef, and the objc HIDEvent. The variables must be the same between 18 | * the two objects to ensure proper bridging. 19 | */ 20 | 21 | #define HIDEventIvar \ 22 | uint64_t timeStamp; /* Clock ticks from mach_absolute_time */ \ 23 | uint64_t senderID; \ 24 | uint64_t typeMask; \ 25 | uint32_t options; \ 26 | uint8_t *attributeData; \ 27 | void *context; \ 28 | CFMutableDictionaryRef attachments; \ 29 | CFTypeRef sender; \ 30 | CFMutableArrayRef children; \ 31 | IOHIDEventRef parent; \ 32 | CFIndex attributeDataLength; \ 33 | IOHIDEventData *eventData; 34 | 35 | typedef struct { 36 | HIDEventIvar 37 | } HIDEventStruct; 38 | 39 | #endif /* HIDEventIvar_h */ 40 | -------------------------------------------------------------------------------- /ioserviceauthorized/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.apple.iokit.${PRODUCT_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | XPC! 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | NSHumanReadableCopyright 24 | Copyright © 2014 Apple Inc. All rights reserved. 25 | XPCService 26 | 27 | _AllowedClients 28 | 29 | entitlement [ "com.apple.vm.device-access" ] 30 | 31 | ServiceType 32 | System 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.apple.iokit.${PRODUCT_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | XPC! 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | NSHumanReadableCopyright 24 | Copyright © 2014 Apple Inc. All rights reserved. 25 | XPCService 26 | 27 | _AllowedClients 28 | 29 | entitlement [ "com.apple.vm.device-access" ] 30 | 31 | ServiceType 32 | User 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/authorize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | IOReturn _Authorize( io_service_t service, uint64_t options, pid_t processID, uint64_t authorizationID, const audit_token_t *auditToken ); 27 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventPrivateKeys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #ifndef IOHIDEventPrivateKeys_h 25 | #define IOHIDEventPrivateKeys_h 26 | 27 | 28 | extern const CFStringRef kIOHIDEventAttachmentSender; 29 | 30 | #endif /* IOHIDEventPrivateKeys_h */ 31 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/application.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | CFBundleRef _ApplicationCopyBundle( pid_t processID ); 27 | 28 | CFStringRef _ApplicationCopyIdentifier( pid_t processID, const audit_token_t *auditToken ); 29 | -------------------------------------------------------------------------------- /IOKitUser.xcconfig: -------------------------------------------------------------------------------- 1 | // @APPLE_LICENSE_HEADER_START@ 2 | // 3 | // Copyright (c) 2017 Apple Computer, Inc. All Rights Reserved. 4 | // 5 | // This file contains Original Code and/or Modifications of Original Code 6 | // as defined in and that are subject to the Apple Public Source License 7 | // Version 2.0 (the 'License'). You may not use this file except in 8 | // compliance with the License. Please obtain a copy of the License at 9 | // http://www.opensource.apple.com/apsl/ and read it before using this 10 | // file. 11 | // 12 | // The Original Code and all software distributed under the License are 13 | // distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 | // EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 | // INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 17 | // Please see the License for the specific language governing rights and 18 | // limitations under the License. 19 | // 20 | // @APPLE_LICENSE_HEADER_END@ 21 | 22 | GCC_PREPROCESSOR_DEFINITIONS = DISPATCH_MACH_SPI=1 OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE=1 23 | CLANG_WARN_UNGUARDED_AVAILABILITY = NO 24 | SYSTEM_HEADER_SEARCH_PATHS = $(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders 25 | -------------------------------------------------------------------------------- /IOKitInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #ifndef __IOKIT_IOKITINTERNAL_H 24 | #define __IOKIT_IOKITINTERNAL_H 25 | 26 | #include 27 | 28 | #define thread_errno() errno 29 | 30 | #define CFMaxPathSize ((CFIndex)1026) 31 | #define CFMaxPathLength ((CFIndex)1024) 32 | 33 | #endif /* __IOKIT_IOKITINTERNAL_H */ 34 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/preferences.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | void _PreferencesAppendArrayValue( CFStringRef key, CFPropertyListRef value ); 27 | 28 | CFPropertyListRef _PreferencesCopyValue( CFStringRef key ); 29 | 30 | void _PreferencesSetValue( CFStringRef key, CFPropertyListRef value ); 31 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/device.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | CFDictionaryRef _DeviceCopyIdentifier( io_service_t service ); 27 | 28 | CFStringRef _DeviceCopyName( CFDictionaryRef identifier ); 29 | 30 | Boolean _DeviceIsEqual( CFDictionaryRef identifier1, CFDictionaryRef identifier2 ); 31 | 32 | Boolean _DeviceIsValid( io_service_t service ); 33 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/storage/storage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | CFDictionaryRef _IOMediaCopyIdentifier( io_service_t service ); 27 | 28 | CFStringRef _IOMediaCopyName( CFDictionaryRef identifier ); 29 | 30 | Boolean _IOMediaIsEqual( CFDictionaryRef identifier1, CFDictionaryRef identifier2 ); 31 | 32 | Boolean _IOMediaIsValid( io_service_t service ); 33 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/usb/usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | CFDictionaryRef _IOUSBDeviceCopyIdentifier( io_service_t service ); 27 | 28 | CFStringRef _IOUSBDeviceCopyName( CFDictionaryRef identifier ); 29 | 30 | Boolean _IOUSBDeviceIsEqual( CFDictionaryRef identifier1, CFDictionaryRef identifier2 ); 31 | 32 | Boolean _IOUSBDeviceIsValid( io_service_t service ); 33 | -------------------------------------------------------------------------------- /IOTrap.s: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include 25 | 26 | #if defined(__i386__) 27 | 28 | #undef kernel_trap 29 | #define kernel_trap(trap_name,trap_number,number_args) \ 30 | LEAF(_##trap_name,0) ;\ 31 | movl $##trap_number,%eax ;\ 32 | int $(MACH_INT) ;\ 33 | END(_##trap_name) 34 | 35 | #endif /* defined(__i386__) */ 36 | 37 | kernel_trap(iokit_user_client_trap, -100, 8) 38 | -------------------------------------------------------------------------------- /hid.subproj/HIDSessionIvar.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDSessionIvar.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 9/13/18. 6 | // 7 | 8 | #ifndef HIDSessionIvar_h 9 | #define HIDSessionIvar_h 10 | 11 | #import 12 | #import 13 | #import // for objc_object 14 | 15 | #define HIDSessionIvar \ 16 | IOHIDEventSystemRef client; \ 17 | IOHIDEventCallback callback; \ 18 | void *refCon; \ 19 | __IOHIDSessionQueueContext *queueContext; \ 20 | pthread_cond_t stateCondition; \ 21 | boolean_t state; \ 22 | boolean_t stateBusy; \ 23 | dispatch_queue_t eventDispatchQueueSession; \ 24 | dispatch_source_t eventDispatchSource; \ 25 | CFMutableArrayRef eventDipsatchPending; \ 26 | CFMutableDictionaryRef properties; \ 27 | uint32_t logLevel; \ 28 | CFMutableSetRef serviceSet; \ 29 | CFMutableArrayRef simpleSessionFilters; \ 30 | CFMutableArrayRef sessionFilters; \ 31 | CFMutableArrayRef pendingSessionFilters; \ 32 | uint64_t activityLastTimestamp; \ 33 | struct timeval activityLastTime; \ 34 | CFMutableSetRef activityNotificationSet; 35 | 36 | typedef struct { 37 | HIDSessionIvar 38 | } HIDSessionStruct; 39 | 40 | #endif /* HIDSessionIvar_h */ 41 | -------------------------------------------------------------------------------- /tests/Resources/kexts/DoNothing-10undef/DoNothing_10undef.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DoNothing-10undef.kext 3 | * A bare do nothing kext. It should have undefined symbols. 4 | */ 5 | 6 | #include 7 | 8 | #define UNUSED __attribute__((unused)) 9 | 10 | // These will turn into undefined symbols in the kext. The count 11 | // as well as the names themselves are checked in OSKext-tests.c 12 | 13 | extern void do_nothing_1(void); 14 | extern void do_nothing_2(void); 15 | extern void do_nothing_3(void); 16 | extern void do_nothing_4(void); 17 | extern void do_nothing_5(void); 18 | extern void do_nothing_6(void); 19 | extern void do_nothing_7(void); 20 | extern void do_nothing_8(void); 21 | extern void do_nothing_9(void); 22 | extern void do_nothing_10(void); 23 | 24 | kern_return_t DoNothing_10undef_start(kmod_info_t * ki, void *d); 25 | kern_return_t DoNothing_10undef_stop(kmod_info_t *ki, void *d); 26 | 27 | kern_return_t DoNothing_10undef_start(UNUSED kmod_info_t * ki, UNUSED void *d) 28 | { 29 | // reference functions to keep symbols from getting stripped. 30 | do_nothing_1(); 31 | do_nothing_2(); 32 | do_nothing_3(); 33 | do_nothing_4(); 34 | do_nothing_5(); 35 | do_nothing_6(); 36 | do_nothing_7(); 37 | do_nothing_8(); 38 | do_nothing_9(); 39 | do_nothing_10(); 40 | 41 | return KERN_SUCCESS; 42 | } 43 | 44 | kern_return_t DoNothing_10undef_stop(UNUSED kmod_info_t *ki, UNUSED void *d) 45 | { 46 | return KERN_SUCCESS; 47 | } 48 | -------------------------------------------------------------------------------- /IOBundle.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #include 24 | 25 | CF_DEFINECONSTANTSTRING(kIOBundleInfoDictionaryVersionKey, "CFBundleInfoDictionaryVersion"); 26 | CF_DEFINECONSTANTSTRING(kIOBundleExecutableKey, "CFBundleExecutable"); 27 | CF_DEFINECONSTANTSTRING(kIOBundleIdentifierKey, "CFBundleIdentifier"); 28 | CF_DEFINECONSTANTSTRING(kIOBundleVersionKey, "CFBundleVersion"); 29 | CF_DEFINECONSTANTSTRING(kIOBundleDevelopmentRegionKey, "CFBundleDevelopmentRegion"); 30 | CF_DEFINECONSTANTSTRING(kIOBundleNameKey, "CFBundleName"); 31 | -------------------------------------------------------------------------------- /hid.subproj/HIDServiceClientIvar.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDServiceClientIvar.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/5/18. 6 | // 7 | 8 | #ifndef HIDServiceClientIvar_h 9 | #define HIDServiceClientIvar_h 10 | 11 | #import 12 | #import 13 | #import // for objc_object 14 | #include 15 | 16 | #define HIDServiceClientIvar \ 17 | IOHIDEventSystemClientRef system; \ 18 | CFTypeRef serviceID; \ 19 | os_unfair_recursive_lock callbackLock; \ 20 | struct { \ 21 | IOHIDServiceClientCallback callback; \ 22 | IOHIDServiceClientBlock block; \ 23 | void *target; \ 24 | void *refcon; \ 25 | } removal; \ 26 | struct { \ 27 | IOHIDVirtualServiceClientCallbacksV2 *callbacks; \ 28 | void *target; \ 29 | void *refcon; \ 30 | } virtualService; \ 31 | os_unfair_recursive_lock serviceLock; \ 32 | CFMutableDictionaryRef cachedProperties; \ 33 | IOHIDServiceFastPathInterface **fastPathInterface; \ 34 | IOCFPlugInInterface **plugInInterface; \ 35 | void *removalHandler; \ 36 | uint32_t primaryUsagePage; \ 37 | uint32_t primaryUsage; \ 38 | IOHIDServiceClientUsagePair *usagePairs; \ 39 | uint32_t usagePairsCount; 40 | 41 | typedef struct { 42 | HIDServiceClientIvar 43 | } HIDServiceClientStruct; 44 | 45 | #endif /* HIDServiceClientIvar_h */ 46 | -------------------------------------------------------------------------------- /IOCFBundle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #ifndef __IOKIT_IOCFBUNDLE_H 24 | #define __IOKIT_IOCFBUNDLE_H 25 | 26 | #include 27 | 28 | #define kIOBundleInfoDictionaryVersionKey CFSTR("CFBundleInfoDictionaryVersion") 29 | #define kIOBundleExecutableKey CFSTR("CFBundleExecutable") 30 | #define kIOBundleIdentifierKey CFSTR("CFBundleIdentifier") 31 | #define kIOBundleVersionKey CFSTR("CFBundleVersion") 32 | #define kIOBundleDevelopmentRegionKey CFSTR("CFBundleDevelopmentRegion") 33 | #define kIOBundleNameKey CFSTR("CFBundleName") 34 | 35 | #endif /* __IOKIT_IOCFBUNDLE_H */ 36 | -------------------------------------------------------------------------------- /UnifdefHeaders.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2021 Apple Inc. All rights reserved. 4 | # 5 | # @APPLE_LICENSE_HEADER_START@ 6 | # 7 | # This file contains Original Code and/or Modifications of Original Code 8 | # as defined in and that are subject to the Apple Public Source License 9 | # Version 2.0 (the 'License'). You may not use this file except in 10 | # compliance with the License. Please obtain a copy of the License at 11 | # http://www.opensource.apple.com/apsl/ and read it before using this 12 | # file. 13 | # 14 | # The Original Code and all software distributed under the License are 15 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 16 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 17 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 19 | # Please see the License for the specific language governing rights and 20 | # limitations under the License. 21 | # 22 | # @APPLE_LICENSE_HEADER_END@ 23 | 24 | fileNumber=0 25 | while [ $fileNumber -lt $SCRIPT_OUTPUT_FILE_COUNT ] 26 | do 27 | eval xcrun --sdk \$SDK_NAME unifdef \$COPY_HEADERS_UNIFDEF_FLAGS -o \"\$SCRIPT_OUTPUT_FILE_$fileNumber\" \"\$SCRIPT_INPUT_FILE_$fileNumber\" 28 | 29 | # unifdef returns 0 and 1 when successful (0 if the output file is the 30 | # same as the input file, 1 if they're different). 31 | returnValue=$? 32 | if [ \( $returnValue -ne 0 \) -a \( $returnValue -ne 1 \) ] 33 | then 34 | exit $returnValue 35 | fi 36 | 37 | fileNumber=$((fileNumber+1)) 38 | done 39 | -------------------------------------------------------------------------------- /kext.subproj/Architectures.hpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * Copyright (c) 2005-2011 Apple Inc. All rights reserved. 4 | * 5 | * @APPLE_LICENSE_HEADER_START@ 6 | * 7 | * This file contains Original Code and/or Modifications of Original Code 8 | * as defined in and that are subject to the Apple Public Source License 9 | * Version 2.0 (the 'License'). You may not use this file except in 10 | * compliance with the License. Please obtain a copy of the License at 11 | * http://www.opensource.apple.com/apsl/ and read it before using this 12 | * file. 13 | * 14 | * The Original Code and all software distributed under the License are 15 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 19 | * Please see the License for the specific language governing rights and 20 | * limitations under the License. 21 | * 22 | * @APPLE_LICENSE_HEADER_END@ 23 | */ 24 | #ifndef __ARCHITECTURES__ 25 | #define __ARCHITECTURES__ 26 | 27 | #include "FileAbstraction.hpp" 28 | 29 | // 30 | // Architectures 31 | // 32 | struct x86 33 | { 34 | typedef Pointer32 P; 35 | 36 | }; 37 | 38 | struct x86_64 39 | { 40 | typedef Pointer64 P; 41 | }; 42 | 43 | struct arm 44 | { 45 | typedef Pointer32 P; 46 | 47 | }; 48 | 49 | struct arm64 50 | { 51 | typedef Pointer64 P; 52 | 53 | }; 54 | 55 | #endif // __ARCHITECTURES__ 56 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2008 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #ifndef _IOKIT_HID_IOHIDLIB_H_ 25 | #define _IOKIT_HID_IOHIDLIB_H_ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #endif /* _IOKIT_HID_IOHIDLIB_H_ */ -------------------------------------------------------------------------------- /IOCFSerialize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | * HISTORY 25 | * 26 | */ 27 | 28 | /* IOCFSerialize serializes CFObjects to a format suitable for passing 29 | * to the kernel. */ 30 | 31 | #ifndef __IOKIT_IOCFSERIALIZE_H 32 | #define __IOKIT_IOCFSERIALIZE_H 33 | 34 | #include 35 | #include 36 | 37 | #if defined(__cplusplus) 38 | extern "C" { 39 | #endif 40 | 41 | enum { 42 | kIOCFSerializeToBinary = 0x00000001 43 | }; 44 | 45 | CF_RETURNS_RETAINED 46 | CFDataRef 47 | IOCFSerialize( CFTypeRef object, CFOptionFlags options ); 48 | 49 | #if defined(__cplusplus) 50 | } 51 | #endif 52 | 53 | #endif /* __IOKIT_IOCFSERIALIZE_H */ 54 | -------------------------------------------------------------------------------- /usb.subproj/IOUSBLib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 25 | * 26 | * HISTORY 27 | * 28 | */ 29 | 30 | //#define CFRUNLOOP_NEW_API 1 31 | 32 | //#include 33 | //#include 34 | //#include 35 | //#include 36 | 37 | //#include 38 | //#include 39 | //#include "IOUSBLib.h" 40 | //#include 41 | //#include 42 | 43 | //#include 44 | 45 | __private_extern__ 46 | const char _IOKIT_USB_IOUSBLIB_C_subproj_workaround[] = "_IOKIT_USB_IOUSBLIB_C_"; 47 | -------------------------------------------------------------------------------- /kext.subproj/cross_link.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | #ifndef __CROSS_LINK_H__ 29 | #define __CROSS_LINK_H__ 30 | 31 | 32 | #include 33 | 34 | boolean_t isCrossLinking(void); 35 | boolean_t setCrossLinkPageSize(vm_size_t crossLinkPageSize); 36 | vm_size_t getEffectivePageSize(void); 37 | vm_offset_t roundPageCrossSafe(vm_offset_t offset); 38 | mach_vm_offset_t roundPageCrossSafeFixedWidth(mach_vm_offset_t); 39 | 40 | #endif /* __CROSS_LINK_H__ */ 41 | -------------------------------------------------------------------------------- /IOCircularDataQueue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | // XXX gvdl: Need to conditionalise this for LP64 40 | #define mig_external __private_extern__ 41 | #include "iokitmig64.h" 42 | #undef mig_external 43 | 44 | #include 45 | -------------------------------------------------------------------------------- /kext.subproj/kernelmanagement_shims.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2008, 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | 29 | #ifndef _KERNELMANAGEMENT_SHIMS_H_ 30 | #define _KERNELMANAGEMENT_SHIMS_H_ 31 | 32 | bool shimmingEnabled(); 33 | CFStringRef kernelmanagement_path_for_bundle_id(CFStringRef); 34 | OSReturn kernelmanagement_load_kext_url(CFURLRef, CFArrayRef); 35 | OSReturn kernelmanagement_load_kext_identifier(CFStringRef, CFArrayRef); 36 | OSReturn kernelmanagement_unload_kext_identifier(CFStringRef); 37 | 38 | #endif /* _KERNELMANAGEMENT_SHIMS_H_ */ 39 | -------------------------------------------------------------------------------- /termclass.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | cc -o termclass termclass.c -framework IOKit -Wall 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | int main(int argc, char **argv) 33 | { 34 | mach_port_t masterPort; 35 | kern_return_t status; 36 | int arg; 37 | 38 | // Parse args 39 | 40 | if( argc < 2 ) { 41 | printf("%s ClassName...\n", argv[0]); 42 | exit(0); 43 | } 44 | 45 | // Obtain the I/O Kit communication handle. 46 | 47 | status = IOMasterPort(bootstrap_port, &masterPort); 48 | assert(status == KERN_SUCCESS); 49 | 50 | for( arg = 1; arg < argc; arg++ ) { 51 | printf("terminate %s...", argv[arg]); 52 | status = IOCatalogueTerminate( masterPort, 0, argv[arg] ); 53 | printf("(%08x)\n", status); 54 | } 55 | 56 | exit(0); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /hidsystem.subproj/IOHIDLibSPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 25 | * 26 | * HISTORY 27 | * 28 | */ 29 | 30 | #ifndef _IOKIT_IOHIDLIB_SPI_H 31 | #define _IOKIT_IOHIDLIB_SPI_H 32 | 33 | #include 34 | #include 35 | 36 | __BEGIN_DECLS 37 | 38 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 39 | 40 | // Used by Window Server only 41 | extern kern_return_t 42 | IOHIDRegisterVirtualDisplay( io_connect_t handle, UInt32 *display_token ); 43 | 44 | extern kern_return_t 45 | IOHIDUnregisterVirtualDisplay( io_connect_t handle, UInt32 display_token ); 46 | 47 | extern kern_return_t 48 | IOHIDSetVirtualDisplayBounds( io_connect_t handle, UInt32 display_token, const IOGBounds * bounds ); 49 | 50 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 51 | 52 | __END_DECLS 53 | 54 | #endif /* ! _IOKIT_IOHIDLIB_SPI_H */ 55 | 56 | -------------------------------------------------------------------------------- /kext.subproj/printPList_new.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | #ifndef __PRINTPLIST_NEW_H__ 29 | #define __PRINTPLIST_NEW_H__ 30 | 31 | #include 32 | #include 33 | 34 | __BEGIN_DECLS 35 | 36 | typedef UInt32 PListStyle; 37 | #define kPListStyleClassic (1) 38 | #define kPListStyleDiagnostics (2) 39 | 40 | void printPList_new(FILE * stream, CFPropertyListRef plist, PListStyle style); 41 | void showPList_new(CFPropertyListRef plist, PListStyle style); 42 | CFMutableStringRef createCFStringForPlist_new(CFTypeRef plist, PListStyle style); 43 | 44 | __END_DECLS 45 | 46 | #endif /* __PRINTPLIST_NEW_H__ */ 47 | -------------------------------------------------------------------------------- /kext.subproj/kextmanager_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | * FILE: kextmanager_types.h 25 | * AUTH: I/O Kit Team (Copyright Apple Computer, 2002, 2006-7) 26 | * DATE: June 2002, September 2006, August 2007 27 | * DESC: typedefs for the kextmanager_mig.defs's MiG-generated code 28 | * 29 | */ 30 | 31 | #ifndef __KEXT_TYPES_H__ 32 | #define __KEXT_TYPES_H__ 33 | 34 | #include // allows to compile standalone 35 | #include 36 | #include 37 | #include 38 | #include // uuid_t 39 | 40 | #define KEXTD_SERVER_NAME "com.apple.KernelExtensionServer" 41 | #define PROPERTYKEY_LEN 128 42 | 43 | typedef int kext_result_t; 44 | typedef char mountpoint_t[MNAMELEN]; 45 | typedef char property_key_t[PROPERTYKEY_LEN]; 46 | typedef char kext_bundle_id_t[KMOD_MAX_NAME]; 47 | typedef char posix_path_t[MAXPATHLEN]; 48 | 49 | // nowadays this is binary plist data but we keep the name for now 50 | typedef char * xmlDataOut_t; 51 | typedef char * xmlDataIn_t; 52 | 53 | #endif /* __KEXT_TYPES_H__ */ 54 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.apple.OSSystemResources 7 | CFBundleName 8 | System Resource Extension 9 | CFBundleGetInfoString 10 | System Resource Extension, Apple Computer Inc, 1.0.0b1 11 | CFBundleVersion 12 | 1.0.0b1 13 | CFBundlePackageType 14 | KEXT 15 | CFBundleSignature 16 | ???? 17 | Modules 18 | 19 | 20 | Kernel Resource 21 | 22 | Name 23 | com.apple.family.IOPCIBus 24 | 25 | 26 | Kernel Resource 27 | 28 | Name 29 | com.apple.family.IOSCSIParallel 30 | 31 | 32 | Kernel Resource 33 | 34 | Name 35 | com.apple.family.IOGraphics 36 | 37 | 38 | Kernel Resource 39 | 40 | Name 41 | com.apple.family.IOUSBBus 42 | 43 | 44 | Kernel Resource 45 | 46 | Name 47 | com.apple.family.IOADBBus 48 | 49 | 50 | Kernel Resource 51 | 52 | Name 53 | com.apple.family.IOATABus 54 | 55 | 56 | Kernel Resource 57 | 58 | Name 59 | com.apple.family.IOStorage 60 | 61 | 62 | Kernel Resource 63 | 64 | Name 65 | com.apple.family.IONetworking 66 | 67 | 68 | Kernel Resource 69 | 70 | Name 71 | com.apple.family.IOHIDSystem 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /graphics.subproj/IOGraphicsLibPrivate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #ifndef _IOKIT_IOGRAPHICSLIBPRIVATE_H 25 | #define _IOKIT_IOGRAPHICSLIBPRIVATE_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #include 32 | #include 33 | 34 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 35 | 36 | #define kIOFBModeResolutionNameKey "name" 37 | #define kIOFBModeRefreshNameKey "refresh" 38 | 39 | extern CFDictionaryRef 40 | IOFBCreateModeInfoDictionary( 41 | io_service_t framebuffer, 42 | IOOptionBits options, 43 | IODisplayModeID displayMode, 44 | IODisplayModeInformation * info); 45 | 46 | kern_return_t 47 | IOFBGetDisplayModeTimingInformation( io_connect_t connect, 48 | IODisplayModeID displayMode, 49 | IODetailedTimingInformation * out ); 50 | 51 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* ! _IOKIT_IOGRAPHICSLIBPRIVATE_H */ 58 | -------------------------------------------------------------------------------- /tests/IOKitLib-tests.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | T_DECL(IOMasterPort, 7 | "check if one can retrieve mach port for communicating with IOKit", 8 | T_META_NAMESPACE("IOKitUser.IOKitLib") 9 | ) 10 | { 11 | mach_port_t masterPort = MACH_PORT_NULL; 12 | 13 | T_EXPECT_MACH_SUCCESS(IOMasterPort(MACH_PORT_NULL, &masterPort), NULL); 14 | T_EXPECT_NE(MACH_PORT_NULL, masterPort, NULL); 15 | } 16 | 17 | T_DECL(OSNumberFloats, 18 | "check roundtrip serialization of float/double CFNumber serialization", 19 | T_META_NAMESPACE("IOKitUser.IOKitLib") 20 | ) 21 | { 22 | CFMutableDictionaryRef dict, props; 23 | CFNumberRef num; 24 | 25 | dict = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, 26 | &kCFTypeDictionaryKeyCallBacks, 27 | &kCFTypeDictionaryValueCallBacks); 28 | props = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, 29 | &kCFTypeDictionaryKeyCallBacks, 30 | &kCFTypeDictionaryValueCallBacks); 31 | CFDictionarySetValue(props, CFSTR("OSNumberFloatTest"), dict); 32 | 33 | float floatValue = 1234.5678; 34 | num = CFNumberCreate( kCFAllocatorDefault, kCFNumberFloatType, &floatValue ); 35 | CFDictionarySetValue(dict, CFSTR("floatValue"), num); 36 | CFRelease(num); 37 | 38 | double doubleValue = 5678.1234; 39 | num = CFNumberCreate( kCFAllocatorDefault, kCFNumberDoubleType, &doubleValue ); 40 | CFDictionarySetValue(dict, CFSTR("doubleValue"), num); 41 | CFRelease(num); 42 | 43 | SInt64 intValue = 12345678; 44 | num = CFNumberCreate( kCFAllocatorDefault, kCFNumberSInt64Type, &intValue ); 45 | CFDictionarySetValue(dict, CFSTR("intValue"), num); 46 | CFRelease(num); 47 | 48 | kern_return_t kr; 49 | io_service_t 50 | service = IORegistryEntryFromPath(kIOMasterPortDefault, kIOServicePlane ":/IOResources"); 51 | T_EXPECT_NE(MACH_PORT_NULL, service, NULL); 52 | 53 | kr = IORegistryEntrySetCFProperties(service, props); 54 | T_EXPECT_MACH_SUCCESS(kr, NULL); 55 | 56 | CFTypeRef obj = IORegistryEntryCreateCFProperty(service, CFSTR("OSNumberFloatTest"), kCFAllocatorDefault, 0); 57 | T_EXPECT_NE(NULL, obj, NULL); 58 | T_EXPECT_TRUE(CFEqual(obj, dict), NULL); 59 | 60 | CFRelease(obj); 61 | CFRelease(dict); 62 | CFRelease(props); 63 | } 64 | -------------------------------------------------------------------------------- /kext.subproj/misc_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | #ifndef __MISC_UTIL_H__ 29 | #define __MISC_UTIL_H__ 30 | 31 | 32 | #include 33 | 34 | #define SAFE_FREE(ptr) do { \ 35 | if (ptr) free(ptr); \ 36 | } while (0) 37 | #define SAFE_FREE_NULL(ptr) do { \ 38 | if (ptr) free(ptr); \ 39 | (ptr) = NULL; \ 40 | } while (0) 41 | #define SAFE_RELEASE(ptr) do { \ 42 | if (ptr) CFRelease(ptr); \ 43 | } while (0) 44 | #define SAFE_RELEASE_NULL(ptr) do { \ 45 | if (ptr) CFRelease(ptr); \ 46 | (ptr) = NULL; \ 47 | } while (0) 48 | 49 | #define RANGE_ALL(a) CFRangeMake(0, CFArrayGetCount(a)) 50 | 51 | 52 | char * createUTF8CStringForCFString(CFStringRef aString); 53 | CFStringRef createCFStringForData(CFDataRef aData, CFIndex maxBytes); 54 | 55 | #endif /* __MISC_UTIL_H__ */ 56 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _OPEN_SOURCE_ 2 | 3 | /* 4 | * Copyright (c) 1999-2008 Apple Computer, Inc. All Rights Reserved. 5 | * 6 | * @APPLE_LICENSE_HEADER_START@ 7 | * 8 | * This file contains Original Code and/or Modifications of Original Code 9 | * as defined in and that are subject to the Apple Public Source License 10 | * Version 2.0 (the 'License'). You may not use this file except in 11 | * compliance with the License. Please obtain a copy of the License at 12 | * http://www.opensource.apple.com/apsl/ and read it before using this 13 | * file. 14 | * 15 | * The Original Code and all software distributed under the License are 16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 20 | * Please see the License for the specific language governing rights and 21 | * limitations under the License. 22 | * 23 | * @APPLE_LICENSE_HEADER_END@ 24 | */ 25 | 26 | #ifndef _IOKIT_HID_HIDTYPES_H 27 | #define _IOKIT_HID_HIDTYPES_H 28 | 29 | #include 30 | 31 | __BEGIN_DECLS 32 | 33 | CF_ASSUME_NONNULL_BEGIN 34 | CF_IMPLICIT_BRIDGING_ENABLED 35 | 36 | /*! 37 | @typedef IOHIDSessionRef 38 | This is the type of a reference to a IOHIDSession. IOHIDSession is mutable by defualt. 39 | */ 40 | typedef struct CF_BRIDGED_TYPE(id) __IOHIDSession * IOHIDSessionRef; 41 | 42 | /*! 43 | @typedef IOHIDServiceRef 44 | This is the type of a reference to a IOHIDService. IOHIDService is mutable by defualt. 45 | */ 46 | typedef struct CF_BRIDGED_TYPE(id) __IOHIDService * IOHIDServiceRef; 47 | 48 | /*! 49 | @typedef IOHIDNotificationRef 50 | This is the type of a reference to a IOHIDNotification. IOHIDNotification is immutable by defualt. 51 | */ 52 | typedef const struct CF_BRIDGED_TYPE(id) __IOHIDNotification * IOHIDNotificationRef; 53 | 54 | typedef void (*IOHIDMatchingServicesCallback)(void * _Nullable target, void * _Nullable refcon, void * _Nullable sender, CFArrayRef services); 55 | 56 | typedef void (*IOHIDServiceCallback)(void * _Nullable target, void * _Nullable refcon, IOHIDServiceRef service); 57 | 58 | CF_IMPLICIT_BRIDGING_DISABLED 59 | CF_ASSUME_NONNULL_END 60 | 61 | __END_DECLS 62 | 63 | #endif /* _IOKIT_HID_HIDTYPES_H */ 64 | 65 | #endif /* _OPEN_SOURCE_ */ -------------------------------------------------------------------------------- /hid.subproj/HIDEventBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // HIDEventBase.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 9/11/18. 6 | // 7 | 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import "HIDEventBasePrivate.h" 13 | 14 | @implementation HIDEvent 15 | 16 | - (CFTypeID)_cfTypeID { 17 | return IOHIDEventGetTypeID(); 18 | } 19 | 20 | - (instancetype)initWithSize:(NSUInteger)size 21 | type:(IOHIDEventType)type 22 | timestamp:(uint64_t)timestamp 23 | options:(uint32_t)options 24 | { 25 | self = [super init]; 26 | 27 | if (!self || size < sizeof(IOHIDEventData)) { 28 | return nil; 29 | } 30 | 31 | _event.eventData = (IOHIDEventData *)malloc(size); 32 | if (_event.eventData == NULL) { 33 | return nil; 34 | } 35 | 36 | bzero(_event.eventData, size); 37 | 38 | _event.timeStamp = timestamp; 39 | _event.options = options; 40 | _event.typeMask = IOHIDEventTypeMask(type); 41 | _event.eventData->type = type; 42 | _event.eventData->size = (uint32_t)size; 43 | _event.eventData->options = options; 44 | 45 | return self; 46 | } 47 | 48 | - (void)dealloc 49 | { 50 | if (_event.eventData) { 51 | free(_event.eventData); 52 | } 53 | 54 | if (_event.children) { 55 | CFIndex count = CFArrayGetCount(_event.children); 56 | 57 | for (CFIndex i = 0; i < count; i++) { 58 | HIDEvent *event; 59 | 60 | event = (__bridge HIDEvent *)CFArrayGetValueAtIndex(_event.children, i); 61 | if (event) { 62 | event->_event.parent = NULL; 63 | } 64 | } 65 | CFRelease(_event.children); 66 | } 67 | 68 | if (_event.attributeData) { 69 | free(_event.attributeData); 70 | } 71 | 72 | if (_event.sender) { 73 | CFRelease(_event.sender); 74 | } 75 | 76 | if (_event.attachments) { 77 | CFRelease(_event.attachments); 78 | } 79 | 80 | [super dealloc]; 81 | } 82 | 83 | - (NSString *)description 84 | { 85 | NSString *desc = (__bridge NSString *)IOHIDEventCopyDescription( 86 | (__bridge IOHIDEventRef)self); 87 | return [desc autorelease]; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /IOCFUnserialize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* IOUnserialize.h created by rsulack on Mon 23-Nov-1998 */ 24 | /* IOCFUnserialize.h creates CF collections Mon 30-Aug-1999 */ 25 | 26 | #ifndef __IOKIT_IOCFUNSERIALIZE_H 27 | #define __IOKIT_IOCFUNSERIALIZE_H 28 | 29 | #include 30 | #include 31 | 32 | #if defined(__cplusplus) 33 | extern "C" { 34 | #endif 35 | 36 | // on success IOCFUnserialize sets errorString to 0 and returns 37 | // the unserialized object. 38 | 39 | // on failure IOCFUnserialize sets errorString to a CFString object 40 | // containing a error message suitable for logging and returns 0 41 | 42 | CF_RETURNS_RETAINED 43 | CFTypeRef 44 | IOCFUnserialize(const char *buffer, 45 | CFAllocatorRef allocator, 46 | CFOptionFlags options, 47 | CFStringRef *errorString); 48 | 49 | CF_RETURNS_RETAINED 50 | CFTypeRef 51 | IOCFUnserializeBinary(const char * buffer, 52 | size_t bufferSize, 53 | CFAllocatorRef allocator, 54 | CFOptionFlags options, 55 | CFStringRef * errorString); 56 | 57 | CF_RETURNS_RETAINED 58 | CFTypeRef 59 | IOCFUnserializeWithSize(const char * buffer, 60 | size_t bufferSize, 61 | CFAllocatorRef allocator, 62 | CFOptionFlags options, 63 | CFStringRef * errorString); 64 | 65 | #if defined(__cplusplus) 66 | } 67 | #endif 68 | 69 | #endif /* __IOKIT_IOCFUNSERIALIZE_H */ 70 | -------------------------------------------------------------------------------- /audio.subproj/IOAudioLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. 25 | */ 26 | 27 | /*! 28 | * @header IOAudioLib 29 | * C interface to IOAudio functions 30 | */ 31 | 32 | #ifndef _IOAUDIOLIB_H 33 | #define _IOAUDIOLIB_H 34 | 35 | #if TARGET_OS_OSX 36 | #include 37 | #endif 38 | 39 | #if 0 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /*! 46 | * @function IOAudioIsOutput 47 | * @abstract Determines if the audio stream is an output stream 48 | * @param service 49 | * @param out 50 | * @result kern_return_t 51 | */ 52 | kern_return_t IOAudioIsOutput(io_service_t service, int *out); 53 | 54 | /*! 55 | * @function IOAudioFlush 56 | * @abstract Indicate the position at which the audio stream can be stopped. 57 | * @param connect the audio stream 58 | * @param end the position 59 | * @result kern_return_t 60 | */ 61 | kern_return_t IOAudioFlush(io_connect_t connect, IOAudioStreamPosition *end); 62 | 63 | /*! 64 | * @function IOAudioSetErase 65 | * @abstract Set autoerase flag, returns old value 66 | * @param connect the audio stream 67 | * @param erase true to turn off, false otherwise 68 | * @param oldVal previous value 69 | * @result kern_return_t 70 | */ 71 | kern_return_t IOAudioSetErase(io_connect_t connect, int erase, int *oldVal); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* 0 */ 78 | 79 | #endif /* ! _IOAUDIOLIB_H */ 80 | -------------------------------------------------------------------------------- /IOCFPlugIn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #ifndef _IOKIT_IOCFPLUGIN_H_ 24 | #define _IOKIT_IOCFPLUGIN_H_ 25 | 26 | /* IOCFPlugIn.h 27 | */ 28 | #include 29 | 30 | __BEGIN_DECLS 31 | 32 | #include 33 | #if COREFOUNDATION_CFPLUGINCOM_SEPARATE 34 | #include 35 | #endif 36 | 37 | #include 38 | 39 | /* C244E858-109C-11D4-91D4-0050E4C6426F */ 40 | #define kIOCFPlugInInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 41 | 0xC2, 0x44, 0xE8, 0x58, 0x10, 0x9C, 0x11, 0xD4, \ 42 | 0x91, 0xD4, 0x00, 0x50, 0xE4, 0xC6, 0x42, 0x6F) 43 | 44 | 45 | #define IOCFPLUGINBASE \ 46 | UInt16 version; \ 47 | UInt16 revision; \ 48 | IOReturn (*Probe)(void *thisPointer, CFDictionaryRef propertyTable, \ 49 | io_service_t service, SInt32 * order); \ 50 | IOReturn (*Start)(void *thisPointer, CFDictionaryRef propertyTable, \ 51 | io_service_t service); \ 52 | IOReturn (*Stop)(void *thisPointer) 53 | 54 | typedef struct IOCFPlugInInterfaceStruct { 55 | IUNKNOWN_C_GUTS; 56 | IOCFPLUGINBASE; 57 | } IOCFPlugInInterface; 58 | 59 | 60 | kern_return_t 61 | IOCreatePlugInInterfaceForService(io_service_t service, 62 | CFUUIDRef pluginType, CFUUIDRef interfaceType, 63 | IOCFPlugInInterface *** theInterface, SInt32 * theScore); 64 | 65 | kern_return_t 66 | IODestroyPlugInInterface(IOCFPlugInInterface ** interface); 67 | 68 | __END_DECLS 69 | 70 | #endif /* !_IOKIT_IOCFPLUGIN_H_ */ 71 | -------------------------------------------------------------------------------- /IOKitPMUnitTests/Stubs/IOKitPMStubs.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOKitPMStubs.h 3 | // IOKitUser 4 | // 5 | // Created by Faramola Isiaka on 7/15/21. 6 | // 7 | 8 | #ifndef IOKitPMStubs_h 9 | #define IOKitPMStubs_h 10 | 11 | #include 12 | #include "EnergyTraceStubs.h" 13 | #include "DispatchStubs.h" 14 | #include "NotifyStubs.h" 15 | #include "XPCStubs.h" 16 | 17 | // privateLib 18 | dispatch_queue_t getPMQueue(void); 19 | io_registry_entry_t getPMRootDomainRef(void); 20 | IOReturn _pm_connect(mach_port_t *newConnection); 21 | IOReturn _pm_disconnect(mach_port_t connection); 22 | 23 | // all from powermanagement.h 24 | kern_return_t io_pm_assertion_activity_aggregate(mach_port_t server, vm_offset_t *statsData, mach_msg_type_number_t *statsDataCnt, int *return_code); 25 | kern_return_t io_pm_assertion_activity_log(mach_port_t server, vm_offset_t *log, mach_msg_type_number_t *logCnt, uint32_t *entryCnt, uint32_t *overflow, int *return_code); 26 | kern_return_t io_pm_assertion_copy_details(mach_port_t server, int assertion_id, int whichData, vm_offset_t props, mach_msg_type_number_t propsCnt, vm_offset_t *assertions, mach_msg_type_number_t *assertionsCnt, int *return_val); 27 | kern_return_t io_pm_assertion_create(mach_port_t server, vm_offset_t props, mach_msg_type_number_t propsCnt, int *assertion_id, int *disableAppSleep, int *enTrIntensity, int *return_code); 28 | kern_return_t io_pm_assertion_retain_release(mach_port_t server, int assertion_id, int action, int *retainCnt, int *disableAppSleep, int *enableAppSleep, int *return_code); 29 | kern_return_t io_pm_assertion_set_properties(mach_port_t server, int assertion_id, vm_offset_t props, mach_msg_type_number_t propsCnt, int *disableAppSleep, int *enableAppSleep, int *enTrIntensity, int *return_code); 30 | kern_return_t io_pm_declare_network_client_active(mach_port_t server, vm_offset_t props, mach_msg_type_number_t propsCnt, int *assertion_id, int *disableAppSleep, int *return_code); 31 | kern_return_t io_pm_declare_system_active(mach_port_t server, int *state, vm_offset_t props, mach_msg_type_number_t propsCnt, int *assertion_id, int *return_code); 32 | kern_return_t io_pm_declare_user_active(mach_port_t server, int user_type, vm_offset_t props, mach_msg_type_number_t propsCnt, int *assertion_id, int *disableAppSleep, int *return_code); 33 | kern_return_t io_pm_set_exception_limits(mach_port_t server, vm_offset_t props, mach_msg_type_number_t propsCnt, int *return_code); 34 | kern_return_t io_pm_set_value_int(mach_port_t server, int selector, int value, int *return_val); 35 | 36 | void IOKitPMStubsTeardown(void); 37 | #endif /* IOKitPMStubs_h */ 38 | -------------------------------------------------------------------------------- /hid.subproj/HIDDeviceIvar.h: -------------------------------------------------------------------------------- 1 | // 2 | // HIDDeviceIvar.h 3 | // iohidobjc 4 | // 5 | // Created by dekom on 10/17/18. 6 | // 7 | 8 | #ifndef HIDDeviceIvar_h 9 | #define HIDDeviceIvar_h 10 | 11 | #import 12 | #import 13 | #import // for objc_object 14 | #include 15 | 16 | #define HIDDeviceIvar \ 17 | io_service_t service; \ 18 | uint64_t regID; \ 19 | IOHIDDeviceDeviceInterface **deviceInterface; \ 20 | IOHIDDeviceTimeStampedDeviceInterface **deviceTimeStampedInterface; \ 21 | IOCFPlugInInterface **plugInInterface; \ 22 | os_unfair_recursive_lock deviceLock; \ 23 | CFMutableDictionaryRef properties; \ 24 | CFMutableSetRef elements; \ 25 | CFStringRef rootKey; \ 26 | CFStringRef UUIDKey; \ 27 | IONotificationPortRef notificationPort; \ 28 | io_object_t notification; \ 29 | CFRunLoopSourceRef asyncEventSource; \ 30 | CFRunLoopSourceContext1 sourceContext; \ 31 | CFMachPortRef queuePort; \ 32 | CFRunLoopRef runLoop; \ 33 | CFStringRef runLoopMode; \ 34 | dispatch_queue_t dispatchQueue; \ 35 | dispatch_mach_t dispatchMach; \ 36 | _Atomic uint32_t dispatchStateMask; \ 37 | dispatch_block_t cancelHandler; \ 38 | IOHIDQueueRef queue; \ 39 | CFArrayRef inputMatchingMultiple; \ 40 | Boolean loadProperties; \ 41 | Boolean isDirty; \ 42 | void *transaction; \ 43 | os_unfair_recursive_lock callbackLock; \ 44 | CFMutableDataRef reportBuffer; \ 45 | CFMutableArrayRef batchElements; \ 46 | CFMutableSetRef removalCallbackSet; \ 47 | CFMutableSetRef inputReportCallbackSet; \ 48 | CFMutableSetRef inputValueCallbackSet; \ 49 | void * _Atomic elementHandler; \ 50 | void * _Atomic removalHandler; \ 51 | void * _Atomic inputReportHandler; 52 | 53 | typedef struct { 54 | HIDDeviceIvar 55 | } HIDDeviceStruct; 56 | 57 | #endif /* HIDDeviceIvar_h */ 58 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventObjc.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDEventObjc.m 3 | // iohidobjc 4 | // 5 | // Created by dekom on 7/30/18. 6 | // 7 | 8 | #import 9 | #include 10 | #import 11 | #import "HIDEventBasePrivate.h" 12 | #include 13 | 14 | static CFTypeID __kIOHIDEventTypeID = _kCFRuntimeNotATypeID; 15 | static pthread_once_t __eventTypeInit = PTHREAD_ONCE_INIT; 16 | 17 | static const CFRuntimeClass __IOHIDEventClass = { 18 | 0, // version 19 | "IOHIDEvent", // className 20 | NULL, // init 21 | NULL, // copy 22 | NULL, // finalize 23 | NULL, // equal 24 | NULL, // hash 25 | NULL, // copyFormattingDesc 26 | NULL, //copyDebugDesc 27 | NULL, // reclaim 28 | NULL // refcount 29 | }; 30 | 31 | // __IOHIDEventRegister 32 | //------------------------------------------------------------------------------ 33 | void __IOHIDEventRegister(void) 34 | { 35 | __kIOHIDEventTypeID = _CFRuntimeRegisterClass(&__IOHIDEventClass); 36 | } 37 | 38 | //------------------------------------------------------------------------------ 39 | // IOHIDEventGetTypeID 40 | //------------------------------------------------------------------------------ 41 | CFTypeID IOHIDEventGetTypeID(void) 42 | { 43 | if (__kIOHIDEventTypeID == _kCFRuntimeNotATypeID) { 44 | pthread_once(&__eventTypeInit, __IOHIDEventRegister); 45 | } 46 | 47 | return __kIOHIDEventTypeID; 48 | } 49 | 50 | IOHIDEventRef _IOHIDEventCreate(CFAllocatorRef allocator, 51 | CFIndex dataSize, 52 | IOHIDEventType type, 53 | uint64_t timeStamp, 54 | IOOptionBits options) 55 | { 56 | return (__bridge IOHIDEventRef)[[HIDEvent allocWithZone:(struct _NSZone *)allocator] initWithSize:dataSize 57 | type:type 58 | timestamp:timeStamp 59 | options:options]; 60 | } 61 | -------------------------------------------------------------------------------- /hidsystem.subproj/setaccl.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | cc -o /tmp/setaccl setaccl.c -Wall -framework IOKit 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | int 35 | main(int argc, char **argv) 36 | { 37 | NXEventHandle hdl; 38 | double dbl1; 39 | CFStringRef key; 40 | 41 | hdl = NXOpenEventStatus(); 42 | assert( hdl ); 43 | 44 | if( argc > 2) { 45 | 46 | if( 't' == argv[2][0]) 47 | key = CFSTR(kIOHIDTrackpadAccelerationType); 48 | else 49 | key = CFSTR(kIOHIDMouseAccelerationType); 50 | 51 | assert( KERN_SUCCESS == IOHIDGetAccelerationWithKey(hdl, key, &dbl1)); 52 | printf("IOHIDGetAccelerationWithKey = %f\n", dbl1); 53 | sscanf( argv[1], "%lf", &dbl1 ); 54 | assert( KERN_SUCCESS == IOHIDSetAccelerationWithKey(hdl, key, dbl1)); 55 | assert( KERN_SUCCESS == IOHIDGetAccelerationWithKey(hdl, key, &dbl1)); 56 | printf("now IOHIDGetAccelerationWithKey = %f\n", dbl1); 57 | } else { 58 | assert( KERN_SUCCESS == IOHIDGetMouseAcceleration(hdl, &dbl1)); 59 | printf("IOHIDGetMouseAcceleration = %f\n", dbl1); 60 | sscanf( argv[1], "%lf", &dbl1 ); 61 | assert( KERN_SUCCESS == IOHIDSetMouseAcceleration(hdl, dbl1)); 62 | assert( KERN_SUCCESS == IOHIDGetMouseAcceleration(hdl, &dbl1)); 63 | printf("now IOHIDGetMouseAcceleration = %f\n", dbl1); 64 | } 65 | 66 | return( 0 ); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /kext.subproj/KextManagerPriv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2012 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #ifndef __KEXTMANAGERPRIV_H__ 25 | #define __KEXTMANAGERPRIV_H__ 26 | 27 | #include 28 | #include 29 | #if !TARGET_OS_IPHONE 30 | #include 31 | #endif /* !TARGET_OS_IPHONE */ 32 | 33 | #include 34 | 35 | __BEGIN_DECLS 36 | 37 | #define kKextLoadIdentifierKey CFSTR("KextLoadIdentifier") 38 | #define kKextLoadPathKey CFSTR("KextLoadPath") 39 | #define kKextLoadDependenciesKey CFSTR("KextLoadDependencyPaths") 40 | 41 | #define kExtPathKey CFSTR("ExtPath") 42 | #define kExtEnabledKey CFSTR("ExtEnabled") 43 | 44 | CFArrayRef _KextManagerCreatePropertyValueArray( 45 | CFAllocatorRef allocator, 46 | CFStringRef propertyKey); 47 | 48 | /* 49 | * This is part of a private, entitled interface between kextd, which manages 50 | * the lifecycle of kernel and userspace driver extensions, and sysextd, 51 | * which manages the installation of third-party system extensions. 52 | * If you are not sysextd or kextd, you should not use these functions. 53 | * They are liable to change at any time. 54 | */ 55 | 56 | /* Validate an extension in-place on the filesystem. */ 57 | OSReturn _KextManagerValidateExtension(CFStringRef extPath); 58 | /* Update an extension's enablement state. */ 59 | OSReturn _KextManagerUpdateExtension(CFStringRef extPath, bool extIsEnabled); 60 | /* Ask kextd to stop an extension - it can say no if it is unable. */ 61 | OSReturn _KextManagerStopExtension(CFStringRef extPath); 62 | 63 | __END_DECLS 64 | 65 | #endif /* __KEXTMANAGERPRIV_H__ */ 66 | -------------------------------------------------------------------------------- /IODataQueueClientPrivate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #ifndef _IOKITUSER_IODATAQUEUE_PRIVATE_H 25 | #define _IOKITUSER_IODATAQUEUE_PRIVATE_H 26 | 27 | #include 28 | 29 | __BEGIN_DECLS 30 | 31 | #include 32 | 33 | enum { 34 | kIODataQueueDeliveryNotificationForce = (1<<0), 35 | kIODataQueueDeliveryNotificationSuppress = (1<<1) 36 | }; 37 | 38 | typedef uint32_t (*IODataQueueClientEnqueueReadBytesCallback)(void * refcon, void *data, uint32_t dataSize); 39 | 40 | IOReturn 41 | _IODataQueueEnqueueWithReadCallback(IODataQueueMemory *dataQueue, uint64_t queueSize, mach_msg_header_t *msgh, uint32_t dataSize, IODataQueueClientEnqueueReadBytesCallback callback, void * refcon); 42 | 43 | IOReturn 44 | _IODataQueueEnqueueWithReadCallbackOptions(IODataQueueMemory *dataQueue, uint64_t queueSize, mach_msg_header_t *msgh, uint32_t dataSize, IODataQueueClientEnqueueReadBytesCallback callback, void * refcon, uint32_t options); 45 | 46 | /* 47 | * Internal Peek and Dequeue functions. These functions allow us to pass in the 48 | * queue size, since queue size is part of shared memory and may be modified by 49 | * a bad client. See rdar://42664354&42630424&42679853 50 | */ 51 | IODataQueueEntry *_IODataQueuePeek(IODataQueueMemory *dataQueue, uint64_t queueSize, size_t *entrySize); 52 | 53 | IOReturn _IODataQueueDequeue(IODataQueueMemory *dataQueue, uint64_t queueSize, void *data, uint32_t *dataSize); 54 | 55 | IOReturn _IODataQueueSendDataAvailableNotification(IODataQueueMemory *dataQueue, mach_msg_header_t *msgh); 56 | 57 | 58 | __END_DECLS 59 | 60 | #endif /* _IOKITUSER_IODATAQUEUE_PRIVATE_H */ 61 | -------------------------------------------------------------------------------- /IOServiceAuthorizeAgent/preferences.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #include "preferences.h" 25 | 26 | dispatch_queue_t __PreferencesGetQueue( void ) 27 | { 28 | static dispatch_once_t once; 29 | static dispatch_queue_t queue; 30 | 31 | dispatch_once( &once, ^ 32 | { 33 | queue = dispatch_queue_create( 0, 0 ); 34 | } ); 35 | 36 | return queue; 37 | } 38 | 39 | void _PreferencesAppendArrayValue( CFStringRef key, CFPropertyListRef value ) 40 | { 41 | dispatch_sync( __PreferencesGetQueue( ), ^ 42 | { 43 | CFArrayRef array; 44 | CFMutableArrayRef mutableArray; 45 | 46 | array = _PreferencesCopyValue( key ); 47 | 48 | if ( array ) 49 | { 50 | mutableArray = CFArrayCreateMutableCopy( kCFAllocatorDefault, 0, array ); 51 | 52 | CFRelease( array ); 53 | } 54 | else 55 | { 56 | mutableArray = CFArrayCreateMutable( kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks ); 57 | } 58 | 59 | if ( mutableArray ) 60 | { 61 | CFArrayAppendValue( mutableArray, value ); 62 | 63 | _PreferencesSetValue( key, mutableArray ); 64 | 65 | CFRelease( mutableArray ); 66 | } 67 | } ); 68 | } 69 | 70 | CFPropertyListRef _PreferencesCopyValue( CFStringRef key ) 71 | { 72 | return CFPreferencesCopyAppValue( key, kCFPreferencesCurrentApplication ); 73 | } 74 | 75 | void _PreferencesSetValue( CFStringRef key, CFPropertyListRef value ) 76 | { 77 | CFPreferencesSetAppValue( key, value, kCFPreferencesCurrentApplication ); 78 | 79 | CFPreferencesAppSynchronize( kCFPreferencesCurrentApplication ); 80 | } 81 | 82 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDEventLegacySupport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Apple Computer, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #ifndef _IOKIT_HID_IOHIDEVENTLEGACYSUPPORT_H 25 | #define _IOKIT_HID_IOHIDEVENTLEGACYSUPPORT_H 26 | 27 | #include 28 | #include 29 | 30 | /* NOTE: The following methods are applicable only on VisionOS; on all other platforms they behave as no-ops*/ 31 | 32 | /*! 33 | @function IOHIDEventHasLegacyEventData 34 | @discussion Check if an event has associated legacy data to be used during serialization 35 | @param type The type of the HID event. 36 | @result True if the event has legacy data, false if not. 37 | */ 38 | bool __IOHIDEventHasLegacyEventData(IOHIDEventType type); 39 | 40 | /*! 41 | @function IOHIDEventDataAppendFromLegacyEvent 42 | @discussion Called if an event has associated legacy data (and legacy is enabled); uses legacy data representation to translate from non-legacy data and store event data in the buffer 43 | @param eventData Non-legacy event data to be translated 44 | @param buffer Data buffer to be populated with legacy data 45 | @result Size of the data appended to the buffer. 46 | */ 47 | CFIndex __IOHIDEventDataAppendFromLegacyEvent(IOHIDEventData * eventData, UInt8* buffer); 48 | 49 | /*! 50 | @function IOHIDEventPopulateCurrentEventData 51 | @discussion Called if an event has associated legacy data (and legacy is enabled); uses non-legacy data representation to translate from legacy data and store event data in the buffer 52 | @param eventData Legacy event data to be translated 53 | @param buffer Data buffer to be populated with non-legacy data 54 | */ 55 | void __IOHIDEventPopulateCurrentEventData(IOHIDEventData * eventData, IOHIDEventData * newEventData); 56 | 57 | 58 | #endif /* _IOKIT_HID_IOHIDEVENTLEGACYSUPPORT_H */ 59 | -------------------------------------------------------------------------------- /alloccount.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | cc alloccount.c -o alloccount -Wall -framework IOKit 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | static void printNumber( CFDictionaryRef dict, CFStringRef name ) 33 | { 34 | CFNumberRef num; 35 | SInt32 num32; 36 | 37 | num = (CFNumberRef) CFDictionaryGetValue(dict, name); 38 | if( num) { 39 | assert( CFNumberGetTypeID() == CFGetTypeID(num) ); 40 | CFNumberGetValue(num, kCFNumberSInt32Type, &num32); 41 | printf("%22s = %08lx = %ld K\n", 42 | CFStringGetCStringPtr(name, CFStringGetSystemEncoding()), 43 | num32, num32 / 1024); 44 | } 45 | } 46 | 47 | int main(int argc, char **argv) 48 | { 49 | mach_port_t masterPort; 50 | io_registry_entry_t root; 51 | CFDictionaryRef props; 52 | kern_return_t status; 53 | 54 | // Obtain the I/O Kit communication handle. 55 | 56 | status = IOMasterPort(bootstrap_port, &masterPort); 57 | assert(status == KERN_SUCCESS); 58 | 59 | // Obtain the registry root entry. 60 | 61 | root = IORegistryGetRootEntry(masterPort); 62 | assert(root); 63 | 64 | status = IORegistryEntryCreateCFProperties(root, 65 | (CFTypeRef *) &props, 66 | kCFAllocatorDefault, kNilOptions ); 67 | assert( KERN_SUCCESS == status ); 68 | assert( CFDictionaryGetTypeID() == CFGetTypeID(props)); 69 | 70 | props = (CFDictionaryRef) 71 | CFDictionaryGetValue( props, CFSTR(kIOKitDiagnosticsKey)); 72 | assert( props ); 73 | assert( CFDictionaryGetTypeID() == CFGetTypeID(props)); 74 | 75 | printNumber(props, CFSTR("Instance allocation")); 76 | printNumber(props, CFSTR("Container allocation")); 77 | printNumber(props, CFSTR("IOMalloc allocation")); 78 | 79 | CFRelease(props); 80 | IOObjectRelease(root); 81 | 82 | exit(0); 83 | } 84 | 85 | -------------------------------------------------------------------------------- /IOMIGMachPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Apple, Inc. All Rights Reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* 25 | * IOMIGMachPort.h 26 | * 27 | * Created by Roberto Yepez on 1/29/09. 28 | * Copyright 2009 Apple, Inc. All rights reserved. 29 | * 30 | */ 31 | 32 | #ifndef _IO_MIG_MACH_PORT_H_ 33 | #define _IO_MIG_MACH_PORT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | __BEGIN_DECLS 40 | 41 | typedef struct __IOMIGMachPort * IOMIGMachPortRef; 42 | 43 | typedef void (*IOMIGMachPortTerminationCallback)(IOMIGMachPortRef client, void * refcon); 44 | typedef Boolean (*IOMIGMachPortDemuxCallback)(IOMIGMachPortRef client, mach_msg_header_t * request, mach_msg_header_t * reply, void *refcon); 45 | 46 | 47 | CF_EXPORT 48 | CFTypeID IOMIGMachPortGetTypeID(void); 49 | 50 | CF_EXPORT 51 | IOMIGMachPortRef IOMIGMachPortCreate(CFAllocatorRef allocator, CFIndex maxMessageSize, mach_port_t port); 52 | 53 | CF_EXPORT 54 | mach_port_t IOMIGMachPortGetPort(IOMIGMachPortRef migPort); 55 | 56 | CF_EXPORT 57 | void IOMIGMachPortRegisterTerminationCallback(IOMIGMachPortRef client, IOMIGMachPortTerminationCallback callback, void *refcon); 58 | 59 | CF_EXPORT 60 | void IOMIGMachPortRegisterDemuxCallback(IOMIGMachPortRef client, IOMIGMachPortDemuxCallback callback, void *refcon); 61 | 62 | CF_EXPORT 63 | void IOMIGMachPortScheduleWithRunLoop(IOMIGMachPortRef server, CFRunLoopRef runLoop, CFStringRef runLoopMode); 64 | 65 | CF_EXPORT 66 | void IOMIGMachPortUnscheduleFromRunLoop(IOMIGMachPortRef server, CFRunLoopRef runLoop, CFStringRef runLoopMode); 67 | 68 | CF_EXPORT 69 | void IOMIGMachPortScheduleWithDispatchQueue(IOMIGMachPortRef server, dispatch_queue_t queue); 70 | 71 | CF_EXPORT 72 | void IOMIGMachPortUnscheduleFromDispatchQueue(IOMIGMachPortRef server, dispatch_queue_t queue); 73 | 74 | // PORT CACHE SUPPORT 75 | CF_EXPORT 76 | void IOMIGMachPortCacheAdd(mach_port_t port, CFTypeRef server); 77 | 78 | CF_EXPORT 79 | void IOMIGMachPortCacheRemove(mach_port_t port); 80 | 81 | CF_EXPORT 82 | CFTypeRef IOMIGMachPortCacheCopy(mach_port_t port); 83 | 84 | __END_DECLS 85 | 86 | 87 | #endif /* _IO_MIG_MACH_PORT_H_ */ 88 | -------------------------------------------------------------------------------- /hid.subproj/IOHIDPreferences.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOHIDPreferences.h 3 | // IOKitUser 4 | // 5 | // Created by AB on 10/25/19. 6 | // 7 | 8 | #ifndef IOHIDPreferences_h 9 | #define IOHIDPreferences_h 10 | 11 | #include 12 | 13 | __BEGIN_DECLS 14 | 15 | CF_ASSUME_NONNULL_BEGIN 16 | CF_IMPLICIT_BRIDGING_ENABLED 17 | 18 | typedef enum { 19 | IOHIDPreferencesOptionNone, 20 | IOHIDPreferencesOptionSingletonConnection 21 | } IOHIDPreferencesOption; 22 | 23 | /*! These APIs are XPC wrapper around corresponding CFPreferences API. https://developer.apple.com/documentation/corefoundation/preferences_utilities 24 | * XPC HID Preferences APIs are currently available for macOS only . 25 | */ 26 | CF_EXPORT 27 | void IOHIDPreferencesSet(CFStringRef key, CFTypeRef __nullable value, CFStringRef user, CFStringRef host, CFStringRef domain); 28 | 29 | CF_EXPORT 30 | void IOHIDPreferencesSetMultiple(CFDictionaryRef __nullable keysToSet , CFArrayRef __nullable keysToRemove, CFStringRef user, CFStringRef host, CFStringRef domain); 31 | 32 | CF_EXPORT 33 | CFTypeRef __nullable IOHIDPreferencesCopy(CFStringRef key, CFStringRef user, CFStringRef host, CFStringRef domain); 34 | 35 | CF_EXPORT 36 | CFDictionaryRef __nullable IOHIDPreferencesCopyMultiple(CFArrayRef __nullable keys, CFStringRef user, CFStringRef host, CFStringRef domain); 37 | 38 | CF_EXPORT 39 | void IOHIDPreferencesSynchronize(CFStringRef user, CFStringRef host, CFStringRef domain); 40 | 41 | CF_EXPORT 42 | CFTypeRef __nullable IOHIDPreferencesCopyDomain(CFStringRef key, CFStringRef domain); 43 | 44 | CF_EXPORT 45 | void IOHIDPreferencesSetDomain(CFStringRef key, CFTypeRef __nullable value, CFStringRef domain); 46 | 47 | #pragma mark - 48 | #pragma mark - 49 | 50 | CF_EXPORT 51 | CFTypeRef __nullable IOHIDPreferencesCreateInstance(IOHIDPreferencesOption option); 52 | 53 | CF_EXPORT 54 | void IOHIDPreferencesSetForInstance(CFTypeRef hidPreference, CFStringRef key, CFTypeRef __nullable value, CFStringRef user, CFStringRef host, CFStringRef domain); 55 | 56 | CF_EXPORT 57 | void IOHIDPreferencesSetMultipleForInstance(CFTypeRef hidPreference, CFDictionaryRef __nullable keysToSet , CFArrayRef __nullable keysToRemove, CFStringRef user, CFStringRef host, CFStringRef domain); 58 | 59 | CF_EXPORT 60 | CFTypeRef __nullable IOHIDPreferencesCopyForInstance(CFTypeRef hidPreference, CFStringRef key, CFStringRef user, CFStringRef host, CFStringRef domain); 61 | 62 | CF_EXPORT 63 | CFDictionaryRef __nullable IOHIDPreferencesCopyMultipleForInstance(CFTypeRef hidPreference, CFArrayRef __nullable keys, CFStringRef user, CFStringRef host, CFStringRef domain); 64 | 65 | CF_EXPORT 66 | void IOHIDPreferencesSynchronizeForInstance(CFTypeRef hidPreference, CFStringRef user, CFStringRef host, CFStringRef domain); 67 | 68 | CF_EXPORT 69 | CFTypeRef __nullable IOHIDPreferencesCopyDomainForInstance(CFTypeRef hidPreference, CFStringRef key, CFStringRef domain); 70 | 71 | CF_EXPORT 72 | void IOHIDPreferencesSetDomainForInstance(CFTypeRef hidPreference, CFStringRef key, CFTypeRef __nullable value, CFStringRef domain); 73 | 74 | CF_IMPLICIT_BRIDGING_DISABLED 75 | CF_ASSUME_NONNULL_END 76 | 77 | __END_DECLS 78 | 79 | #endif /* IOHIDPreferences_h */ 80 | -------------------------------------------------------------------------------- /kext.subproj/misc_util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #include "misc_util.h" 24 | 25 | /********************************************************************* 26 | *********************************************************************/ 27 | char * createUTF8CStringForCFString(CFStringRef aString) 28 | { 29 | char * result = NULL; 30 | CFIndex bufferLength = 0; 31 | 32 | if (!aString) { 33 | goto finish; 34 | } 35 | 36 | bufferLength = sizeof('\0') + 37 | CFStringGetMaximumSizeForEncoding(CFStringGetLength(aString), 38 | kCFStringEncodingUTF8); 39 | 40 | result = (char *)malloc(bufferLength * sizeof(char)); 41 | if (!result) { 42 | goto finish; 43 | } 44 | if (!CFStringGetCString(aString, result, bufferLength, 45 | kCFStringEncodingUTF8)) { 46 | 47 | SAFE_FREE_NULL(result); 48 | goto finish; 49 | } 50 | 51 | finish: 52 | return result; 53 | } 54 | 55 | /********************************************************************* 56 | *********************************************************************/ 57 | CFStringRef createCFStringForData(CFDataRef aData, CFIndex maxBytes) 58 | { 59 | CFMutableStringRef result = NULL; 60 | const uint8_t * bytes = NULL; // do not free 61 | CFIndex count, i; 62 | 63 | result = CFStringCreateMutable(kCFAllocatorDefault, /* maxLength */ 0); 64 | if (!result) { 65 | goto finish; 66 | } 67 | 68 | count = CFDataGetLength(aData); 69 | 70 | CFStringAppend(result, CFSTR("<")); 71 | 72 | if (count) { 73 | bytes = CFDataGetBytePtr(aData);; 74 | for (i = 0; i < count && i < maxBytes; i++) { 75 | CFStringAppendFormat(result, /* options */ NULL, CFSTR("%02x%s"), 76 | (unsigned)(bytes[i]), 77 | (i > 0 && !((i + 1) % 4) && (i + 1 < count)) ? " " : ""); 78 | } 79 | if (maxBytes < count) { 80 | CFStringAppendFormat(result, /* options */ NULL, 81 | CFSTR("...(%u bytes total)"), (unsigned)count); 82 | } 83 | } 84 | CFStringAppend(result, CFSTR(">")); 85 | 86 | finish: 87 | return result; 88 | } 89 | -------------------------------------------------------------------------------- /hidsystem.subproj/HIDParamTest.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | cc -o test HIDParamTest.c -lIOKit 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | mach_port_t masterPort; 32 | 33 | io_connect_t OpenEventDriver( void ) 34 | { 35 | register kern_return_t kr; 36 | mach_port_t ev, service, iter; 37 | 38 | assert( KERN_SUCCESS == ( 39 | kr = IOServiceGetMatchingServices( masterPort, 40 | IOServiceMatching( kIOHIDSystemClass ), &iter) 41 | )); 42 | 43 | assert( 44 | service = IOIteratorNext( iter ) 45 | ); 46 | 47 | assert( KERN_SUCCESS == ( 48 | kr = IOServiceOpen( service, 49 | mach_task_self(), 50 | kIOHIDParamConnectType, 51 | &ev) 52 | )); 53 | 54 | IOObjectRelease( service ); 55 | IOObjectRelease( iter ); 56 | 57 | return( ev ); 58 | } 59 | 60 | 61 | void TestParams( io_connect_t ev ) 62 | { 63 | kern_return_t kr; 64 | NXEventData event; 65 | IOGPoint loc; 66 | char * s = "hello "; 67 | char c; 68 | 69 | loc.x = 200; 70 | loc.y = 200; 71 | 72 | assert( KERN_SUCCESS == ( 73 | kr = IOHIDSetMouseLocation( ev, 200, 200 ) 74 | )); 75 | 76 | while( (c = *(s++))) { 77 | event.key.repeat = FALSE; 78 | event.key.keyCode = 0; 79 | event.key.charSet = NX_ASCIISET; 80 | event.key.charCode = c; 81 | event.key.origCharSet = event.key.charSet; 82 | event.key.origCharCode = event.key.charCode; 83 | 84 | assert( KERN_SUCCESS == ( 85 | kr = IOHIDPostEvent ( ev, NX_KEYDOWN, loc, &event, 86 | FALSE, 0, FALSE ) 87 | )); 88 | assert( KERN_SUCCESS == ( 89 | kr = IOHIDPostEvent ( ev, NX_KEYUP, loc, &event, 90 | FALSE, 0, FALSE ) 91 | )); 92 | } 93 | } 94 | 95 | int 96 | main(int argc, char **argv) 97 | { 98 | kern_return_t kr; 99 | 100 | assert( KERN_SUCCESS == ( 101 | kr = IOMasterPort( bootstrap_port, 102 | &masterPort) 103 | )); 104 | TestParams( OpenEventDriver()); 105 | 106 | return( 0 ); 107 | } 108 | -------------------------------------------------------------------------------- /audio.subproj/IOAudioLib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 25 | * 26 | * HISTORY 27 | * 28 | */ 29 | 30 | #if 0 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | /* --------------------------------------------------------- */ 37 | 38 | kern_return_t 39 | IOAudioIsOutput( io_service_t service, int *out) 40 | { 41 | kern_return_t kr; 42 | CFDictionaryRef properties; 43 | CFNumberRef number; 44 | 45 | *out = false; 46 | kr = IORegistryEntryCreateCFProperties(service, (CFTypeRef *) &properties, 47 | kCFAllocatorDefault, kNilOptions); 48 | if(kr || !properties) 49 | return kr; 50 | 51 | number = (CFNumberRef) 52 | CFDictionaryGetValue(properties, CFSTR("Out")); 53 | 54 | if( CFNumberGetTypeID() == CFGetTypeID(number)) 55 | CFNumberGetValue(number, kCFNumberIntType, out); 56 | else 57 | kr = kIOReturnInternalError; 58 | 59 | CFRelease(properties); 60 | 61 | return kr; 62 | } 63 | 64 | // Tell driver when last sample will have been played, so sound hardware 65 | // can be stopped. 66 | kern_return_t IOAudioFlush(io_connect_t connect, IOAudioStreamPosition *end) 67 | { 68 | mach_msg_type_number_t len = 0; 69 | return io_connect_method_structureI_structureO(connect, 70 | kCallFlush, 71 | (char *)end, 72 | sizeof(IOAudioStreamPosition), 73 | NULL, 74 | &len); 75 | 76 | } 77 | 78 | // Set autoerase flag, returns old value 79 | kern_return_t IOAudioSetErase(io_connect_t connect, int erase, int *oldVal) 80 | { 81 | kern_return_t kr; 82 | mach_msg_type_number_t len = 1; 83 | int old; 84 | 85 | kr = io_connect_method_scalarI_scalarO(connect, kCallSetErase, 86 | &erase, 1, &old, &len); 87 | if(kr == kIOReturnSuccess) 88 | *oldVal = !old; 89 | return kr; 90 | } 91 | 92 | #endif /* 0 */ 93 | 94 | -------------------------------------------------------------------------------- /classcount.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | /* 24 | cc classcount.c -o classcount -Wall -framework IOKit 25 | */ 26 | 27 | #include 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | int main(int argc, char **argv) 35 | { 36 | kern_return_t status; 37 | mach_port_t masterPort; 38 | io_registry_entry_t root; 39 | CFDictionaryRef dictionary; 40 | CFDictionaryRef props; 41 | CFStringRef key; 42 | CFNumberRef num; 43 | int arg; 44 | 45 | // Parse args 46 | 47 | if( argc < 2 ) { 48 | printf("%s ClassName...\n", argv[0]); 49 | exit(0); 50 | } 51 | 52 | // Obtain the I/O Kit communication handle. 53 | 54 | status = IOMasterPort(bootstrap_port, &masterPort); 55 | assert(status == KERN_SUCCESS); 56 | 57 | // Obtain the registry root entry. 58 | 59 | root = IORegistryGetRootEntry(masterPort); 60 | assert(root); 61 | 62 | status = IORegistryEntryCreateCFProperties(root, 63 | (CFTypeRef *)&props, 64 | kCFAllocatorDefault, kNilOptions ); 65 | assert( KERN_SUCCESS == status ); 66 | assert( CFDictionaryGetTypeID() == CFGetTypeID(props)); 67 | 68 | dictionary = (CFDictionaryRef) 69 | CFDictionaryGetValue( props, CFSTR(kIOKitDiagnosticsKey)); 70 | assert( dictionary ); 71 | assert( CFDictionaryGetTypeID() == CFGetTypeID(dictionary)); 72 | 73 | dictionary = (CFDictionaryRef) 74 | CFDictionaryGetValue( dictionary, CFSTR("Classes")); 75 | assert( dictionary ); 76 | assert( CFDictionaryGetTypeID() == CFGetTypeID(dictionary)); 77 | 78 | for( arg = 1; arg < argc; arg++ ) { 79 | key = CFStringCreateWithCString(kCFAllocatorDefault, 80 | argv[arg], CFStringGetSystemEncoding()); 81 | assert(key); 82 | num = (CFNumberRef) CFDictionaryGetValue(dictionary, key); 83 | CFRelease(key); 84 | if( num) { 85 | SInt32 num32; 86 | assert( CFNumberGetTypeID() == CFGetTypeID(num) ); 87 | CFNumberGetValue(num, kCFNumberSInt32Type, &num32); 88 | printf("%s = %d, ", argv[arg], (int)num32); 89 | } 90 | } 91 | if( num) 92 | printf("\n"); 93 | 94 | CFRelease(props); 95 | IOObjectRelease(root); 96 | 97 | exit(0); 98 | } 99 | 100 | -------------------------------------------------------------------------------- /DeviceMIG.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006, 2009 Apple Inc. All rights reserved. 2 | # 3 | # @APPLE_LICENSE_HEADER_START@ 4 | # 5 | # This file contains Original Code and/or Modifications of Original Code 6 | # as defined in and that are subject to the Apple Public Source License 7 | # Version 2.0 (the 'License'). You may not use this file except in 8 | # compliance with the License. Please obtain a copy of the License at 9 | # http://www.opensource.apple.com/apsl/ and read it before using this 10 | # file. 11 | # 12 | # The Original Code and all software distributed under the License are 13 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 17 | # Please see the License for the specific language governing rights and 18 | # limitations under the License. 19 | # 20 | # @APPLE_LICENSE_HEADER_END@ 21 | 22 | # This script is run from the shell script build phases in the DeviceMIG target 23 | 24 | MIGCC=`xcodebuild -sdk "${SDKROOT}" -find cc` 25 | MIG=`xcodebuild -sdk "${SDKROOT}" -find mig` 26 | 27 | if [ install = "$1" ] 28 | then 29 | if [ $SCRIPT_INPUT_FILE_0 -nt $SCRIPT_OUTPUT_FILE_0 ] 30 | then 31 | echo Creating 32 bit Mig header for backward compatibility 32 | cat > $SCRIPT_OUTPUT_FILE_0 <<- EOI_iokitmig 33 | #if !defined(__LP64__) 34 | 35 | `cat $SCRIPT_INPUT_FILE_0` 36 | 37 | #endif /* !__LP64__ */ 38 | EOI_iokitmig 39 | elif [ \( ! -f $SCRIPT_INPUT_FILE_0 \) -a \( installhdrs != "$ACTION" \) ] 40 | then 41 | echo "/* Deprecated, kept (for now) for compatibility */" > $SCRIPT_OUTPUT_FILE_0 42 | fi 43 | exit 44 | fi 45 | 46 | # This script generates the device.defs mig interface for the IOKit.framework to the kernel 47 | runMig() 48 | { 49 | local input=$1 head=$2 user=$3; shift 3 50 | migargs=$@ 51 | set -- $ARCHS 52 | MIGARCH=$1; shift 53 | cmd="$MIG -cc $MIGCC -arch $MIGARCH ${migargs} -novouchers -DKOBJECT_SERVER -server /dev/null -header $head -user $user $input"; 54 | echo $cmd 55 | eval $cmd 56 | } 57 | 58 | # which input files is newest. 59 | if [ $SCRIPT_INPUT_FILE_0 -nt $SCRIPT_INPUT_FILE_1 ] 60 | then 61 | testFile=$SCRIPT_INPUT_FILE_0 62 | else 63 | testFile=$SCRIPT_INPUT_FILE_1 64 | fi 65 | 66 | ARCHS32="" 67 | ARCHS64="" 68 | for a in $ARCHS; do 69 | case $a in 70 | *64) 71 | ARCHS64="$ARCHS64 $a" 72 | ;; 73 | *64?) 74 | ARCHS64="$ARCHS64 $a" 75 | ;; 76 | *) 77 | ARCHS32="$ARCHS32 $a" 78 | ;; 79 | esac 80 | done 81 | 82 | echo "Inferred 32-bit architectures: $ARCHS32" 83 | echo "Inferred 64-bit architectures: $ARCHS64" 84 | 85 | if [ $testFile -nt $SCRIPT_OUTPUT_FILE_0 -o $testFile -nt $SCRIPT_OUTPUT_FILE_1 \ 86 | -o $testFile -nt $SCRIPT_OUTPUT_FILE_2 -o $testFile -nt $SCRIPT_OUTPUT_FILE_3 ] 87 | then 88 | if [ -n "${ARCHS32}" ] 89 | then 90 | ARCHS=${ARCHS32} 91 | runMig $SCRIPT_INPUT_FILE_0 $SCRIPT_OUTPUT_FILE_0 $SCRIPT_OUTPUT_FILE_1 $OTHER_CFLAGS 92 | fi 93 | 94 | if [ -n "${ARCHS64}" ] 95 | then 96 | ARCHS=${ARCHS64} 97 | OTHER_CFLAGS="$OTHER_CFLAGS -D__LP64__" 98 | runMig $SCRIPT_INPUT_FILE_0 $SCRIPT_OUTPUT_FILE_2 $SCRIPT_OUTPUT_FILE_3 $OTHER_CFLAGS 99 | fi 100 | fi 101 | -------------------------------------------------------------------------------- /kext.subproj/cross_link.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #include "cross_link.h" 24 | 25 | 26 | /********************************************************************* 27 | * Module Internal Variables 28 | *********************************************************************/ 29 | 30 | static boolean_t __sCrossLinkEnabled = FALSE; 31 | static vm_size_t __sCrossLinkPageSize = 0; 32 | 33 | 34 | /********************************************************************* 35 | *********************************************************************/ 36 | boolean_t isCrossLinking(void) 37 | { 38 | return __sCrossLinkEnabled; 39 | } 40 | 41 | /********************************************************************* 42 | *********************************************************************/ 43 | boolean_t setCrossLinkPageSize(vm_size_t crossLinkPageSize) 44 | { 45 | // verify radix 2 46 | if ((crossLinkPageSize != 0) && 47 | ((crossLinkPageSize & (crossLinkPageSize - 1)) == 0)) { 48 | 49 | __sCrossLinkPageSize = crossLinkPageSize; 50 | __sCrossLinkEnabled = TRUE; 51 | 52 | return TRUE; 53 | } else { 54 | return FALSE; 55 | } 56 | } 57 | 58 | /********************************************************************* 59 | *********************************************************************/ 60 | vm_size_t getEffectivePageSize(void) 61 | { 62 | if (__sCrossLinkEnabled) { 63 | return __sCrossLinkPageSize; 64 | } else { 65 | return PAGE_SIZE; 66 | } 67 | } 68 | 69 | /********************************************************************* 70 | *********************************************************************/ 71 | vm_offset_t roundPageCrossSafe(vm_offset_t offset) 72 | { 73 | // __sCrossLinkPageSize is checked for power of 2 above 74 | if (__sCrossLinkEnabled) { 75 | return (offset + (__sCrossLinkPageSize - 1)) & 76 | (~(__sCrossLinkPageSize - 1)); 77 | } else { 78 | return round_page(offset); 79 | } 80 | } 81 | 82 | /********************************************************************* 83 | *********************************************************************/ 84 | mach_vm_offset_t roundPageCrossSafeFixedWidth(mach_vm_offset_t offset) 85 | { 86 | // __sCrossLinkPageSize is checked for power of 2 above 87 | if (__sCrossLinkEnabled) { 88 | return (offset + (__sCrossLinkPageSize - 1)) & 89 | (~(__sCrossLinkPageSize - 1)); 90 | } else { 91 | return mach_vm_round_page(offset); 92 | } 93 | } 94 | 95 | -------------------------------------------------------------------------------- /Modules/IOKit.private.modulemap: -------------------------------------------------------------------------------- 1 | framework module IOKit_Private [extern_c] [system] { 2 | header "IOReportTypes.h" 3 | export * 4 | 5 | explicit module graphics { 6 | header "graphics/AppleGraphicsDeviceControlUserCommand.h" 7 | header "graphics/IOAccel2DContextConnect.h" 8 | header "graphics/IOAccelBufferHeader.h" 9 | header "graphics/IOAccelCLContextConnect.h" 10 | header "graphics/IOAccelCommandQueueConnect.h" 11 | header "graphics/IOAccelContextConnect.h" 12 | header "graphics/IOAccelDeviceConnect.h" 13 | header "graphics/IOAccelDisplayPipeConnect.h" 14 | header "graphics/IOAccelEventCommon.h" 15 | header "graphics/IOAccelEventConfig.h" 16 | header "graphics/IOAccelEventFast.h" 17 | header "graphics/IOAccelGLContextConnect.h" 18 | header "graphics/IOAccelGLDrawableConnect.h" 19 | header "graphics/IOAccelPrivateConnect.h" 20 | header "graphics/IOAccelSharedConnect.h" 21 | header "graphics/IOAccelStats.h" 22 | header "graphics/IOAccelSurfaceConnectPrivate.h" 23 | header "graphics/IOAccelSurfaceControl.h" 24 | header "graphics/IOAccelTrace.h" 25 | header "graphics/IOAccelVideoContextConnect.h" 26 | header "graphics/IOBacklightPrivate.h" 27 | header "graphics/IODisplayProductIDs.h" 28 | header "graphics/IOGTrace.h" 29 | header "graphics/IOGraphicsLibPrivate.h" 30 | header "graphics/IOGraphicsTypes.h" 31 | header "graphics/IOGraphicsTypesPrivate.h" 32 | header "graphics/IOMobileFramebufferTypes.h" 33 | header "graphics/IOSurfacePrivate.h" 34 | 35 | // Use the GPUWrangler.framework headers 36 | // rdar://83756106 (AppleGPUWranglerUserCommand.h is installed in both GPUWrangler.framework and IOKit.framework) 37 | exclude header "graphics/AppleGPUWranglerUserCommand.h" 38 | 39 | export * 40 | 41 | module GTraceTypes { 42 | requires cplusplus 43 | header "graphics/GTraceTypes.hpp" 44 | export * 45 | } 46 | } 47 | explicit module hid { 48 | header "hid/IOHIDEvent.h" 49 | header "hid/IOHIDServiceClient.h" 50 | header "hid/IOHIDEventData.h" 51 | header "hid/IOHIDEventTypes.h" 52 | header "hid/IOHIDService.h" 53 | header "hid/IOHIDEventSystem.h" 54 | header "hid/IOHIDEventSystemClient.h" 55 | header "hid/IOHIDEventSystemKeys.h" 56 | header "hid/IOHIDServicePlugIn.h" 57 | header "hid/IOHIDTypes.h" 58 | header "hid/IOHIDEventSystemConnection.h" 59 | header "hid/IOHIDEventPrivateKeys.h" 60 | header "hid/IOHIDServiceKeys.h" 61 | header "hid/AppleHIDUsageTables.h" 62 | header "hid/AppleHIDMultitouchKeys.h" 63 | header "hid/IOHIDPrivateKeys.h" 64 | header "hid/IOHIDTimeSyncKeys.h" 65 | header "hid/IOHIDEventQueue.h" 66 | header "hid/IOHIDEventMacroDefs.h" 67 | header "hid/IOHIDEventStructDefs.h" 68 | header "hid/IOHIDEventFieldDefs.h" 69 | header "hid/IOHIDEventServiceKeys_Private.h" 70 | header "hid/IOHIDUserDevice.h" 71 | export * 72 | } 73 | explicit module hidobjc { 74 | header "hidobjc/hidobjcbase.h" 75 | header "hidobjc/HIDDeviceBase.h" 76 | header "hidobjc/HIDDeviceIvar.h" 77 | header "hidobjc/HIDElementBase.h" 78 | header "hidobjc/HIDElementIvar.h" 79 | header "hidobjc/HIDEventBase.h" 80 | header "hidobjc/HIDEventIvar.h" 81 | header "hidobjc/HIDServiceClientBase.h" 82 | header "hidobjc/HIDServiceClientIvar.h" 83 | header "hidobjc/HIDServiceBase.h" 84 | header "hidobjc/HIDServiceIvar.h" 85 | header "hidobjc/HIDConnectionBase.h" 86 | header "hidobjc/HIDConnectionIvar.h" 87 | header "hidobjc/HIDSessionBase.h" 88 | header "hidobjc/HIDSessionIvar.h" 89 | export * 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /IOCFURLAccess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | #ifndef __IOKIT_IOCFURLACCESS_H 24 | #define __IOKIT_IOCFURLACCESS_H 25 | 26 | #include 27 | 28 | CFTypeRef IOURLCreatePropertyFromResource(CFAllocatorRef alloc, CFURLRef url, CFStringRef property, SInt32 *errorCode); 29 | 30 | Boolean IOURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, CFURLRef url, CFDataRef *resourceData, CFDictionaryRef *properties, CFArrayRef desiredProperties, SInt32 *errorCode); 31 | 32 | Boolean IOURLWriteDataAndPropertiesToResource(CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, int32_t *errorCode); 33 | 34 | #ifdef HAVE_CFURLACCESS 35 | 36 | #define kIOURLFileExists kCFURLFileExists 37 | #define kIOURLFileDirectoryContents kCFURLFileDirectoryContents 38 | #define kIOURLFileLength kCFURLFileLength 39 | #define kIOURLFileLastModificationTime kCFURLFileLastModificationTime 40 | #define kIOURLFilePOSIXMode kCFURLFilePOSIXMode 41 | #define kIOURLFileOwnerID kCFURLFileOwnerID 42 | 43 | /* Common error codes; this list is expected to grow */ 44 | 45 | typedef CFURLError IOURLError; 46 | 47 | enum { 48 | kIOURLUnknownError = kCFURLUnknownError, 49 | kIOURLUnknownSchemeError = kCFURLUnknownSchemeError, 50 | kIOURLResourceNotFoundError = kCFURLResourceNotFoundError, 51 | kIOURLResourceAccessViolationError = kCFURLResourceAccessViolationError, 52 | kIOURLRemoteHostUnavailableError = kCFURLRemoteHostUnavailableError, 53 | kIOURLImproperArgumentsError = kCFURLImproperArgumentsError, 54 | kIOURLUnknownPropertyKeyError = kCFURLUnknownPropertyKeyError, 55 | kIOURLPropertyKeyUnavailableError = kCFURLPropertyKeyUnavailableError, 56 | kIOURLTimeoutError = kCFURLTimeoutError 57 | }; 58 | 59 | #else /* !HAVE_CFURLACCESS */ 60 | 61 | #define kIOURLFileExists CFSTR("kIOURLFileExists") 62 | #define kIOURLFileDirectoryContents CFSTR("kIOURLFileDirectoryContents") 63 | #define kIOURLFileLength CFSTR("kIOURLFileLength") 64 | #define kIOURLFileLastModificationTime CFSTR("kIOURLFileLastModificationTime") 65 | #define kIOURLFilePOSIXMode CFSTR("kIOURLFilePOSIXMode") 66 | #define kIOURLFileOwnerID CFSTR("kIOURLFileOwnerID") 67 | 68 | /* Common error codes; this list is expected to grow */ 69 | 70 | typedef enum { 71 | kIOURLUnknownError = -10, 72 | kIOURLUnknownSchemeError = -11, 73 | kIOURLResourceNotFoundError = -12, 74 | kIOURLResourceAccessViolationError = -13, 75 | kIOURLRemoteHostUnavailableError = -14, 76 | kIOURLImproperArgumentsError = -15, 77 | kIOURLUnknownPropertyKeyError = -16, 78 | kIOURLPropertyKeyUnavailableError = -17, 79 | kIOURLTimeoutError = -18 80 | } IOURLError; 81 | 82 | #endif /* !HAVE_CFURLACCESS */ 83 | 84 | #endif /* __IOKIT_IOCFURLACCESS_H */ 85 | --------------------------------------------------------------------------------