WlanSetInterface (Compact 7)
3/12/2014
This function sets user-configurable parameters for a specified interface.
Syntax
DWORD WINAPI WlanSetInterface(
__in HANDLE hClientHandle,
__in const GUID* pInterfaceGuid,
__in WLAN_INTF_OPCODE OpCode,
__in DWORD dwDataSize,
__in const PVOID pData,
__reserved PVOID pReserved
);
Parameters
- hClientHandle
Client session handle, obtained by a previous call to the WlanOpenHandle function.
- pInterfaceGuid
The GUID of the interface to be configured.
OpCode
A WLAN_INTF_OPCODE value that specifies the parameter to be set. The following table lists the valid constants alongside the data type of the parameter in pData:WLAN_INTF_OPCODE Value pDatadata type Description wlan_intf_opcode_autoconf_enabled
BOOL
Enables or disables automatic configuration for the indicated interface.
wlan_intf_opcode_background_scan_enabled
BOOL
Enables or disables background scan for the indicated interface.
wlan_intf_opcode_radio_state
Sets the radio state.
wlan_intf_opcode_bss_type
Sets the BSS type.
wlan_intf_opcode_media_streaming_mode
BOOL
Sets media streaming mode for the driver.
wlan_intf_opcode_current_operation_mode
ULONG
Sets the current operation mode for the interface.
- dwDataSize
The size of the pData parameter, in bytes. If dwDataSize is larger than the actual amount of memory allocated to pData, an access violation will occur in the calling program.
pData
The value to be set as specified by the OpCode parameter. The type of data pointed to by pData must be appropriate for the specified OpCode. Use the previous table to determine the type of data to use.Note
If OpCode is set to wlan_intf_opcode_autoconf_enabled, wlan_intf_opcode_background_scan_enabled, or wlan_intf_opcode_media_streaming_mode, pData can point to an integer value. If pData points to 0, the value is converted to FALSE. If pData points to a nonzero integer, the value is converted to TRUE.
- pReserved
Reserved; set to NULL.
Return Values
Value | Description |
---|---|
ERROR_SUCCESS |
The function succeeds. |
ERROR_ACCESS_DENIED |
The caller does not have sufficient permissions to perform the requested operation. |
ERROR_GEN_FAILURE |
The parameter specified by OpCode is not supported by the driver or network adapter. |
ERROR_INVALID_HANDLE |
The handle hClientHandle was not found in the handle table. |
ERROR_INVALID_PARAMETER |
One of the following conditions occurred:
|
RPC_STATUS |
Can be any remote procedure call (RPC) error code. The RPC call may be unsuccessful due to Wlan RPC server issues, such as when the RPC server is not started. Refer to RPC for more information. |
Remarks
When OpCode is set to wlan_intf_opcode_current_operation_mode, WlanSetInterface sets the current operation mode of the wireless interface. Two operation modes are supported: DOT11_OPERATION_MODE_EXTENSIBLE_STATION and DOT11_OPERATION_MODE_NETWORK_MONITOR. The operation mode constants are defined in the header file Windot11.h. If pData does not point to one of these values when OpCode is set to wlan_intf_opcode_current_operation_mode, WlanSetInterface will fail with an error.
See Also
Reference
Native Wi-Fi Functions
WlanOpenHandle
WLAN_INTF_OPCODE
WLAN_PHY_RADIO_STATE
DOT11_BSS_TYPE
WlanQueryInterface
Native Wi-Fi Reference