Hi, I got the sample working fine under a service, but not when running as a normal app. So I understand there's a few more tokens as described here
https://devblogs.microsoft.com/oldnewthing/20190531-00/?p=102532
https://stackoverflow.com/questions/42717691/wtsqueryusertoken-returning-false
I'm just curious, why not set put this code in when WTSQueryUserToken fails?