WlanSetSecuritySettings function (wlanapi.h)
The WlanGetProfileList function sets the security settings for a configurable object.
Syntax
DWORD WlanSetSecuritySettings(
[in] HANDLE hClientHandle,
[in] WLAN_SECURABLE_OBJECT SecurableObject,
[in] LPCWSTR strModifiedSDDL
);
Parameters
[in] hClientHandle
The client's session handle, obtained by a previous call to the WlanOpenHandle function.
[in] SecurableObject
A WLAN_SECURABLE_OBJECT value that specifies the object to which the security settings will be applied.
[in] strModifiedSDDL
A security descriptor string that specifies the new security settings for the object. This string must be NULL-terminated. For more information, see the Remarks section.
Return value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value may be one of the following return codes.
Return code | Description |
---|---|
|
A parameter is incorrect. This error is returned if any of the following conditions occur:
|
|
A handle is invalid. This error is returned if the handle specified in the hClientHandle parameter was not found in the handle table. |
|
The caller does not have sufficient permissions. |
|
This function was called from an unsupported platform. This value will be returned if this function was called from a Windows XP with SP3 or Wireless LAN API for Windows XP with SP2 client. |
Remarks
A successful call to the WlanSetSecuritySettings function overrides the default permissions associated with an object. For more information about default permissions, see Native Wifi API Permissions.
The following describes the procedure for creating a security descriptor object and parsing it as a string.
- Call InitializeSecurityDescriptor to create a security descriptor in memory.
- Call SetSecurityDescriptorOwner to set the owner information for the security descriptor.
- Call InitializeAcl to create a discretionary access control list (DACL) in memory.
- Call AddAccessAllowedAce or AddAccessDeniedAce to add access control entries (ACEs) to the DACL. Set the AccessMask parameter to one of the following bitwise OR combinations as appropriate:
- WLAN_READ_ACCESS
- WLAN_READ_ACCESS | WLAN_EXECUTE_ACCESS
- WLAN_READ_ACCESS | WLAN_EXECUTE_ACCESS | WLAN_WRITE_ACCESS
- Call SetSecurityDescriptorDacl to add the DACL to the security descriptor.
- Call ConvertSecurityDescriptorToStringSecurityDescriptor to convert the descriptor to string.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | wlanapi.h (include Wlanapi.h) |
Library | Wlanapi.lib |
DLL | Wlanapi.dll |