The WlanSetFilterList function sets the permit/deny list.
DWORD WlanSetFilterList( HANDLE hClientHandle, WLAN_FILTER_LIST_TYPE wlanFilterListType, const PDOT11_NETWORK_LIST pNetworkList, PVOID pReserved );
The client's session handle, obtained by a previous call to the WlanOpenHandle function.
A WLAN_FILTER_LIST_TYPE value that specifies the type of filter list. The value must be either wlan_filter_list_type_user_permit or wlan_filter_list_type_user_deny. Group policy-defined lists cannot be set using this function.
Pointer to a DOT11_NETWORK_LIST structure that contains the list of networks to permit or deny. The dwIndex member of the structure must have a value less than the value of the dwNumberOfItems member of the structure; otherwise, an access violation may occur.
Reserved for future use. Must be set to NULL.
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.
The caller does not have sufficient permissions to set the filter list.
When called with wlanFilterListType set to wlan_filter_list_type_user_permit, WlanSetFilterList retrieves the discretionary access control list (DACL) stored with the wlan_secure_permit_list object. When called with wlanFilterListType set to wlan_filter_list_type_user_deny, WlanSetFilterList retrieves the DACL stored with the wlan_secure_deny_list object. In either of these cases, if the DACL does not contain an access control entry (ACE) that grants WLAN_WRITE_ACCESS permission to the access token of the calling thread, then WlanSetFilterList returns ERROR_ACCESS_DENIED.
||hClientHandle is NULL or invalid or pReserved is not NULL.|
||The handle hClientHandle was not found in the handle table.|
||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.|
||Various error codes.|
The group policy permit and deny lists take precedence over the user's permit and deny lists. That means access to a network on the user's permit list will be denied if the network appears on the group policy deny list. Similarly, access to a network on the user's deny list will be permitted if the network appears on the group policy permit list. Networks that are not on a user list or a group policy list will be permitted.
Denied networks cannot be connected by means of auto config and will not be included on the visible networks list. New user permit and deny lists overwrite previous versions of the user lists.
To clear a filter list, set the pNetworkList parameter to NULL, or pass a pointer to a DOT11_NETWORK_LIST structure that has the dwNumberOfItems member set to 0.
The netsh wlan add filter and netsh wlan delete filter commands provide similar functionality at the command line. For more information, see Netsh Commands for Wireless Local Area Network (wlan).
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|
|Header||wlanapi.h (include Wlanapi.h)|