![Xcalibur Systems LLC Logo](../icons/logo.png) |
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.TerminalServicesAssembly: 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
)
<DllImportAttribute("wtsapi32.dll", SetLastError := true>]
Public Shared Function WTSEnumerateSessionsEx (
serverHandle As IntPtr,
ByRef level As UInteger,
filter As UInteger,
<OutAttribute> ByRef sessionInfo As IntPtr,
<OutAttribute> ByRef count As UInteger
) As Integer
public:
[DllImportAttribute(L"wtsapi32.dll", SetLastError = true)]
static int WTSEnumerateSessionsEx(
IntPtr serverHandle,
unsigned int% level,
unsigned int filter,
[OutAttribute] IntPtr% sessionInfo,
[OutAttribute] unsigned int% count
)
[<DllImportAttribute("wtsapi32.dll", SetLastError = true)>]
static member WTSEnumerateSessionsEx :
serverHandle : IntPtr *
level : uint32 byref *
filter : uint32 *
sessionInfo : IntPtr byref *
count : uint32 byref -> int
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
Int32If the function succeeds, the return value is nonzero. To determine whether the
function adjusted all of the specified privileges, call
.
See Also