I am trying to use the function WTSQuerySessionInformation in a Visual C# project, including the following lines in the class definition:
[DllImport("Wtsapi32.dll")]
static extern bool WTSQuerySessionInformation(
System.IntPtr hServer, int sessionId, WTS_INFO_CLASS wtsInfoClass, out System.IntPtr ppBuffer, out uint pBytesReturned); private Boolean remote_connected = false;
I get an error saying:
Error: he type or namespace name 'WTS_INFO_CLASS' could not be found (are you missing a using directive or an assembly reference?)
Can anyone please let me know what needs to be done in the project to fix this error?
You are nearly there:
Note that
sessionIdis aDWORDwhich is an untyped 32 bit integer.