WTSGetListenerSecurity function
Retrieves the security descriptor of a Remote Desktop Services listener.
Syntax
BOOL WINAPI WTSGetListenerSecurity( _In_ HANDLE hServer, _In_ PVOID pReserved, _In_ DWORD Reserved, _In_ LPTSTR pListenerName, _In_ SECURITY_INFORMATION SecurityInformation, _Out_opt_ PSECURITY_DESCRIPTOR pSecurityDescriptor, _In_ DWORD nLength, _Out_ LPDWORD lpnLengthNeeded );
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.
- SecurityInformation [in]
-
A SECURITY_INFORMATION value that specifies the security information to retrieve. Always enable the DACL_SECURITY_INFORMATION and SACL_SECURITY_INFORMATION flags.
For more information about possible values, see SECURITY_INFORMATION.
- pSecurityDescriptor [out, optional]
-
A pointer to a SECURITY_DESCRIPTOR structure that receives the security information associated with the listener referenced by the pListenerName parameter. The SECURITY_DESCRIPTOR structure is returned in self-relative format. For more information about possible values, see SECURITY_DESCRIPTOR.
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.
- nLength [in]
-
The size, in bytes, of the SECURITY_DESCRIPTOR structure referenced by the pSecurityDescriptor parameter.
- lpnLengthNeeded [out]
-
A pointer to a variable that receives the number of bytes required to store the complete security descriptor. If this number is less than or equal to the value of the nLength parameter, the security descriptor is copied to the SECURITY_DESCRIPTOR structure referenced by the pSecurityDescriptor parameter; otherwise, no action is taken.
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
If the number of bytes needed for the buffer that receives the SECURITY_DESCRIPTOR structure is unknown, you can call this method with nLength set to zero. The method will then return, in the lpnLengthNeeded parameter, the number of bytes required for the buffer. Allocate the buffer based on this number, and then call the method again, setting pSecurityDescriptor to the newly allocated buffer and nLength to the number returned by the first call.
Requirements
|
Minimum supported client |
Windows 7 |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
WTSGetListenerSecurityW (Unicode) and WTSGetListenerSecurityA (ANSI) |
See also