Only way I have come up with is to try to do a lock, if it succeeds, ReturnCode = 0, then the object is not locked. If ReturnCode <> 0, the object is locked.
If you have made a lock during this examination, you should release the lock immediately.
Fim W.