I have been able to do it as long I converted the pointer to a handle first, and then back to a pointer when I need it. I think it is ptr_for_handle