What we probably can do is to operate on the internal DSO* which has the necessary thread ref counting information and also knows how to obtain the handle.