From e6c95639091678bbd38cce26ec1333bc8da25cf0 Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Thu, 3 Jul 2025 09:45:47 -0600 Subject: [PATCH] Update FFI bindings for get_all domain lookup --- ffi/src/lockdown.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ffi/src/lockdown.rs b/ffi/src/lockdown.rs index baaf9ab..02c2cd1 100644 --- a/ffi/src/lockdown.rs +++ b/ffi/src/lockdown.rs @@ -227,15 +227,26 @@ pub unsafe extern "C" fn lockdownd_get_value( #[unsafe(no_mangle)] pub unsafe extern "C" fn lockdownd_get_all_values( client: *mut LockdowndClientHandle, + domain: *const libc::c_char, out_plist: *mut *mut c_void, ) -> *mut IdeviceFfiError { if out_plist.is_null() { return ffi_err!(IdeviceError::FfiInvalidArg); } + let domain = if domain.is_null() { + None + } else { + Some( + unsafe { std::ffi::CStr::from_ptr(domain) } + .to_string_lossy() + .into_owned(), + ) + }; + let res: Result = RUNTIME.block_on(async move { let client_ref = unsafe { &mut (*client).0 }; - client_ref.get_all_values().await + client_ref.get_all_values(domain).await }); match res {