WTSSetListenerSecurityW function (wtsapi32.h)
Configures the security descriptor of a Remote Desktop Services listener.
BOOL WTSSetListenerSecurityW(
[in] HANDLE hServer,
[in] PVOID pReserved,
[in] DWORD Reserved,
[in] LPWSTR pListenerName,
[in] SECURITY_INFORMATION SecurityInformation,
[in] PSECURITY_DESCRIPTOR pSecurityDescriptor
);
[in] hServer
A handle to an RD Session Host server. Always set this parameter to WTS_CURRENT_SERVER_HANDLE.
[in] pReserved
This parameter is reserved. Always set this parameter to NULL.
[in] Reserved
This parameter is reserved. Always set this parameter to zero.
[in] pListenerName
A pointer to a null-terminated string that contains the name of the listener.
[in] SecurityInformation
A SECURITY_INFORMATION value that specifies the security information to set. Always enable the DACL_SECURITY_INFORMATION and SACL_SECURITY_INFORMATION flags.
For more information about possible values, see SECURITY_INFORMATION.
[in] pSecurityDescriptor
A pointer to a SECURITY_DESCRIPTOR structure that contains the security information associated with the listener. For more information about possible values, see SECURITY_DESCRIPTOR. For information about STANDARD_RIGHTS_REQUIRED, see Standard Access Rights.
The discretionary access control list (DACL) of the security descriptor can contain one or more of the following values.
Combines these values:
- STANDARD_RIGHTS_REQUIRED
- WTS_SECURITY_CONNECT
- WTS_SECURITY_DISCONNECT
- WTS_SECURITY_LOGON
- WTS_SECURITY_MESSAGE
- WTS_SECURITY_QUERY_INFORMATION
- WTS_SECURITY_REMOTE_CONTROL
- WTS_SECURITY_RESET
- WTS_SECURITY_SET_INFORMATION
- WTS_SECURITY_VIRTUAL_CHANNELS
The right to connect.
Combines these values:
- WTS_SECURITY_LOGOFF
- WTS_SECURITY_VIRTUAL_CHANNELS
Combines these values:
- WTS_SECURITY_DISCONNECT
- WTS_SECURITY_LOGOFF
- WTS_SECURITY_RESET
- WTS_SECURITY_SET_INFORMATION
- WTS_SECURITY_VIRTUAL_CHANNELS
The right to disconnect.
Defined as WTS_SECURITY_LOGON.
The right to log off.
The right to log on.
The right to send a message to the user.
The right to query for information.
The right to use remote control.
The right to reset information.
The right to set information.
Combines these values:
- WTS_SECURITY_CONNECT
- WTS_SECURITY_CURRENT_GUEST_ACCESS
- WTS_SECURITY_QUERY_INFORMATION
The right to use virtual channels.
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.
Note
The wtsapi32.h header defines WTSSetListenerSecurity as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows 7 |
Minimum supported server | Windows Server 2008 R2 |
Target Platform | Windows |
Header | wtsapi32.h |
Library | Wtsapi32.lib |
DLL | Wtsapi32.dll |