Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

WTSCreateListener function

Creates a new Remote Desktop Services listener or configures an existing listener.

Syntax


BOOL WINAPI WTSCreateListener(
  _In_  HANDLE  hServer,
  _In_  PVOID  pReserved,
  _In_  DWORD  Reserved,
  _In_  LPTSTR  pListenerName,
  _In_  PWTSLISTENERCONFIG pBuffer,
  _In_  DWORD  flag
);

Parameters

hServer [in]

A handle to an RD Session Host server. Always set this parameter to WTS_CURRENT_SERVER_HANDLE.

pReserved [in]

This parameter is reserved. Always set this parameter to NULL.

Reserved [in]

This parameter is reserved. Always set this parameter to zero.

pListenerName [in]

A pointer to a null-terminated string that contains the name of the listener to create or configure.

pBuffer [in]

A pointer to a WTSLISTENERCONFIG structure that contains configuration information for the listener.

flag [in]

The purpose of the call. This parameter can be one of the following values.

ValueMeaning
WTS_LISTENER_CREATE
1 (0x1)

Create a new listener.

WTS_LISTENER_UPDATE
16 (0x10)

Update the settings of an existing listener.

 

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call the GetLastError function.

Remarks

This function creates or configures a listener that uses Remote Desktop Protocol (RDP). Always set the version member of the WTSLISTENERCONFIG structure that is pointed to by the pBuffer parameter to one.

This function does not create or configure the security descriptor of the listener. When you call this function to create a new listener, the function assigns the default security descriptor to the new listener. To modify the security descriptor, call the WTSSetListenerSecurity function. For more information about security descriptors, see SECURITY_DESCRIPTOR.

This function does not validate the settings for the new listener. Be sure that the settings are valid before calling this 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

WTSCreateListenerW (Unicode) and WTSCreateListenerA (ANSI)

See also

SECURITY_DESCRIPTOR
SECURITY_INFORMATION
WTSLISTENERCONFIG
WTSSetListenerSecurity

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.