macOS: location of IOKit.framework #119

Closed
opened 2019-11-17 10:54:23 -06:00 by 0xDP · 1 comment
0xDP commented 2019-11-17 10:54:23 -06:00 (Migrated from github.com)

Hi there,

according to

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html

IOKit.framework is located at "/System/Library/Frameworks/", but mac/hid.c:hidapi_IOHIDDeviceGetService() tries to find it at "/System/Library/".

--- a/hidapi/mac/hid.c
+++ b/hidapi/mac/hid.c
@@ -305,7 +305,7 @@ static io_service_t hidapi_IOHIDDeviceGe
 	 * and the fallback method will be used.
 	 */
 	if (iokit_framework == NULL) {
-		iokit_framework = dlopen("/System/Library/IOKit.framework/IOKit", RTLD_LAZY);
+		iokit_framework = dlopen("/System/Library/Frameworks/IOKit.framework/IOKit", RTLD_LAZY);
 
 		if (iokit_framework != NULL)
 			dynamic_IOHIDDeviceGetService = (dynamic_IOHIDDeviceGetService_t) dlsym(iokit_framework, "IOHIDDeviceGetService");

Regards,
Dennis

Hi there, according to https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html IOKit.framework is located at "/System/Library/Frameworks/", but mac/hid.c:hidapi_IOHIDDeviceGetService() tries to find it at "/System/Library/". ``` --- a/hidapi/mac/hid.c +++ b/hidapi/mac/hid.c @@ -305,7 +305,7 @@ static io_service_t hidapi_IOHIDDeviceGe * and the fallback method will be used. */ if (iokit_framework == NULL) { - iokit_framework = dlopen("/System/Library/IOKit.framework/IOKit", RTLD_LAZY); + iokit_framework = dlopen("/System/Library/Frameworks/IOKit.framework/IOKit", RTLD_LAZY); if (iokit_framework != NULL) dynamic_IOHIDDeviceGetService = (dynamic_IOHIDDeviceGetService_t) dlsym(iokit_framework, "IOHIDDeviceGetService"); ``` Regards, Dennis
z3ntu commented 2019-11-17 11:43:16 -06:00 (Migrated from github.com)
Please copy https://github.com/signal11/hidapi/pull/426 to this repo.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#119
No description provided.