WTSCloseServer function (wtsapi32.h)

Closes an open handle to a Remote Desktop Session Host (RD Session Host) server.

Syntax

void WTSCloseServer(
  [in] HANDLE hServer
);

Parameters

[in] hServer

A handle to an RD Session Host server opened by a call to the WTSOpenServer or WTSOpenServerEx function.

Do not pass WTS_CURRENT_SERVER_HANDLE for this parameter.

Return value

None

Remarks

Call the WTSCloseServer function as part of your program's clean-up routine to close all the server handles opened by calls to the WTSOpenServer or WTSOpenServerEx function.

After the handle has been closed, it cannot be used with any other WTS APIs.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wtsapi32.h
Library Wtsapi32.lib
DLL Wtsapi32.dll

See also

WTSOpenServer