This function is used by the server setting the active handle when entering the execution thread. The handle should not be changed by applications.