pub fn get_process_handle(process: TaskLabel) -> StatusExpand description
Get global identifier for a given process label
§Usage
This syscall set the task handle that matches the given label in the SVC_EXCHANGE area if the label is matched and is in the same domain as the current task in the kernel task vector.
If no handle is found, the resulting status is Status::Invalid. If the requested application is not in the same domain as the current one, Status::Denied is returned. The SVC_EXCHANGE area is not set.
NOTE: except without good reasons, do not use this syscall directly
§Example
ⓘ
match sentry_uapi::syscall::get_process_handle(tasklabel) {
Status::Ok => (),
any_err => return (any_err),
}
let exch_area = unsafe { &mut SVC_EXCHANGE_AREA[..4] };
let handle = u32::from_ne_bytes(exch_area.try_into().map_err(|_| Status::Invalid)?);