Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
WTSOpenServerEx

WTSOpenServerEx function

Opens a handle to the specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server.

Syntax


HANDLE WINAPI WTSOpenServerEx(
  _In_ LPTSTR pServerName
);

Parameters

pServerName [in]

A pointer to a null-terminated string that contains the NetBIOS name of the server.

Return value

If the function succeeds, the return value is a handle to the specified server.

If the function fails, it returns an invalid handle. You can test the validity of the handle by using it in another function call.

Remarks

If the server specified by the pServerName parameter is an RD Session Host server, the behavior of this function is identical to that of the WTSOpenServer function.

To work with sessions running on virtual machines on the RD Virtualization Host server on which the calling application is running, specify WTS_CURRENT_SERVER_NAME for the pServerName parameter.

When you have finished using the handle returned by this function, release it by calling the WTSCloseServer function.

Requirements

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Header

Wtsapi32.h

Library

Wtsapi32.lib

DLL

Wtsapi32.dll

Unicode and ANSI names

WTSOpenServerExW (Unicode) and WTSOpenServerExA (ANSI)

See also

WTSCloseServer
WTSOpenServer

 

 

Show:
© 2015 Microsoft