Copies the mode object IDs into the user provided buffer. For safety, checkout the [`copy_field`] function.
(
obj: &Mutex<Vec<Arc<T>>>,
buffer: *mut u32,
buffer_size: &mut u32,
)