Click or drag to resize
Xcalibur Systems LLC Logo

TerminalServicesHelperWTSEnumerateSessionsEx Method

Retrieves a list of sessions on a specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server.

WTSEnumerateSessionsEx function


Namespace: Xcalibur.NativeMethods.V2.TerminalServices
Assembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax
[DllImportAttribute("wtsapi32.dll", SetLastError = true)]
public static int WTSEnumerateSessionsEx(
	IntPtr serverHandle,
	ref uint level,
	uint filter,
	out IntPtr sessionInfo,
	out uint count
)

Parameters

serverHandle  IntPtr
A handle to an RD Session Host server opened by a call to the or WTSOpenServerEx function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the RD Session Host server on which your application is running.
level  UInt32
This parameter is reserved. Always set this parameter to one. On output, WTSEnumerateSessionsEx does not change the value of this parameter.
filter  UInt32
This parameter is reserved. Always set this parameter to zero.
sessionInfo  IntPtr
A pointer to a PWTS_SESSION_INFO_1 variable that receives a pointer to an array of structures. Each structure in the array contains information about a session on the specified RD Session Host server. If you obtained a handle to an RD Virtualization Host server by calling the function, the array contains information about sessions on virtual machines on the server. When you have finished using the array, free it by calling the WTSFreeMemoryEx function. You should also set the pointer to NULL.
count  UInt32
A pointer to a DWORD variable that receives the number of structures returned in the sessionInfo buffer.

Return Value

Int32
If the function succeeds, the return value is nonzero. To determine whether the function adjusted all of the specified privileges, call .
See Also