WlanSetSecuritySettings function
Applies to: desktop apps only
The WlanGetProfileList function sets the security settings for a configurable object.
Syntax
DWORD WINAPI WlanSetSecuritySettings( __in HANDLE hClientHandle, __in WLAN_SECURABLE_OBJECT SecurableObject, __in LPCWSTR strModifiedSDDL );
Parameters
- hClientHandle [in]
-
The client's session handle, obtained by a previous call to the WlanOpenHandle function.
- SecurableObject [in]
-
A WLAN_SECURABLE_OBJECT value that specifies the object to which the security settings will be applied.
- strModifiedSDDL [in]
-
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.
The string returned by ConvertSecurityDescriptorToStringSecurityDescriptor can then be used as the strModifiedSDDL parameter value when calling WlanSetSecuritySettings.
Requirements
|
Minimum supported client | Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 2/3/2012