Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content

WlanSetFilterList function

The WlanSetFilterList function sets the permit/deny list.


DWORD WINAPI WlanSetFilterList(
  _In_             HANDLE                hClientHandle,
  _In_             WLAN_FILTER_LIST_TYPE wlanFilterListType,
  _In_opt_   const PDOT11_NETWORK_LIST   pNetworkList,
  _Reserved_       PVOID                 pReserved


hClientHandle [in]

The client's session handle, obtained by a previous call to the WlanOpenHandle function.

wlanFilterListType [in]

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.

pNetworkList [in, optional]

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.

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 codeDescription

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.

To add all SSIDs to a filter list, pass a pointer to a DOT11_NETWORK_LIST structure with an associated DOT11_NETWORK structure that has the uSSIDLength member of its DOT11_SSID structure set to 0.

To add all BSS types to a filter list, pass a pointer to a DOT11_NETWORK_LIST with an associated DOT11_NETWORK structure that has its dot11BssType member set to dot11_BSS_type_any.

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]


Wlanapi.h (include Wlanapi.h)





See also




Community Additions

© 2015 Microsoft