Compartir a través de


WlanQueryInterface (Compact 2013)

3/26/2014

This function queries various parameters of a specified interface.

Syntax

DWORD WINAPI WlanQueryInterface(
  __in        HANDLE hClientHandle,
  __in        const GUID* pInterfaceGuid,
  __in        WLAN_INTF_OPCODE OpCode,
  __reserved  PVOID pReserved,
  __out       PDWORD pdwDataSize,
  __out       PVOID* ppData,
  __out_opt   PWLAN_OPCODE_VALUE_TYPE pWlanOpcodeValueType
);

Parameters

  • hClientHandle
    Client session handle, obtained by a previous call to the WlanOpenHandle function.
  • pInterfaceGuid
    GUID of the interface to be queried.
  • OpCode
    A WLAN_INTF_OPCODE value that specifies the parameter to be queried. The following table lists the valid constants alongside the data type of the parameter in ppData:

    WLAN_INTF_OPCODE Value

    ppData Data Type

    wlan_intf_opcode_autoconf_enabled

    BOOL

    wlan_intf_opcode_background_scan_enabled

    BOOL

    wlan_intf_opcode_radio_state

    WLAN_RADIO_STATE

    wlan_intf_opcode_bss_type

    DOT11_BSS_TYPE

    wlan_intf_opcode_interface_state

    WLAN_INTERFACE_STATE

    wlan_intf_opcode_current_connection

    WLAN_CONNECTION_ATTRIBUTES

    wlan_intf_opcode_channel_number

    ULONG

    wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs

    WLAN_AUTH_CIPHER_PAIR_LIST

    wlan_intf_opcode_supported_adhoc_auth_cipher_pairs

    WLAN_AUTH_CIPHER_PAIR_LIST

    wlan_intf_opcode_supported_country_or_region_string_list

    WLAN_COUNTRY_OR_REGION_STRING_LIST

    wlan_intf_opcode_media_streaming_mode

    BOOL

    wlan_intf_opcode_statistics

    WLAN_STATISTICS

    wlan_intf_opcode_rssi

    LONG

    wlan_intf_opcode_current_operation_mode

    ULONG

    wlan_intf_opcode_supported_safe_mode

    BOOL

    wlan_intf_opcode_certified_safe_mode

    BOOL

  • pReserved
    Reserved; set to NULL.
  • pdwDataSize
    Size of the ppData parameter, in bytes.
  • ppData
    Pointer to the memory location that contains the queried value of the parameter specified by the OpCode parameter.

    Note   If OpCode is set to wlan_intf_opcode_autoconf_enabled, wlan_intf_opcode_background_scan_enabled, or wlan_intf_opcode_media_streaming_mode, the pointer referenced by ppData can point to an integer value. If the pointer referenced by ppData points to 0, the integer value should be converted to the Boolean value FALSE. If the pointer referenced by ppData points to a nonzero integer, the integer value should be converted to the Boolean value TRUE.

  • pWlanOpcodeValueType
    If passed a non-NULL value, this parameter points to a WLAN_OPCODE_VALUE_TYPE value that specifies the type of OpCode returned. This parameter can be 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_INVALID_PARAMETER

hClientHandle is NULL or invalid, pInterfaceGuid is NULL, pReserved is not NULL, ppData is NULL, or pdwDataSize is NULL.

ERROR_INVALID_HANDLE

The handle hClientHandle was not found in the handle table.

ERROR_INVALID_STATE

OpCode is set to wlan_intf_opcode_current_connection and the client is currently not connected to a network.

ERROR_NOT_ENOUGH_MEMORY

Could not allocate memory for the query results.

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

The caller is responsible for using WlanFreeMemory to free the memory allocated for ppData.

When OpCode is set to wlan_intf_opcode_current_operation_mode, WlanQueryInterface queries 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. ppData will point to one of these two values.

See Also

Reference

Native Wi-Fi Functions
WlanOpenHandle
WLAN_INTF_OPCODE
WLAN_RADIO_STATE
DOT11_BSS_TYPE
WLAN_INTERFACE_STATE
WLAN_CONNECTION_ATTRIBUTES
WLAN_AUTH_CIPHER_PAIR_LIST
WLAN_COUNTRY_OR_REGION_STRING_LIST
WLAN_STATISTICS
WLAN_OPCODE_VALUE_TYPE
WlanFreeMemory
WlanQueryInterface
Native Wi-Fi Reference