https://support.microsoft.com/en-us/help/118626/how-to-determine-whether-a-thread-is-running-in-user-context-of-local