I have a C# WPF application that can run under 2 modes. The first is over Citrix, and the next is installed and running straight locally.
This app is old, and we were using a call to the windows remote desktop API, WTSQuerySessionInformation to work out whether we were running over Citrix or not.
https://msdn.microsoft.com/en-us/library/aa383838(v=vs.85).aspx
The call was basically this,
hRet = WTSQuerySessionInformation(WF_CURRENT_SERVER_HANDLE, WF_CURRENT_SESSION,
WTS_INFO_CLASS.WTSApplicationName, ref ppBuffer, ref iBytesReturned);
So it was returning the application name on the current remote desktop session, and the assumption was that if there was no application name then it wasn't running under Citrix.
This is no longer working since we upgrade the version of Citrix we are using. The call above returns an empty string.
The questions are,
- Why is this call not working
- Is there a better way to work out whether a C# app is running over Citrix or not?