' ########################################################################################
' Microsoft Windows
' File: wlanapi.inc
' Contents: Definitions and data strcutures for wlan auto config client side API.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_wlanapi_PBI)
#DEFINE PBX_wlanapi_PBI
%EQUATE `WLANAPI_INC = 1
#INCLUDE ONCE "Legacy/System/l2cmn.inc"
#INCLUDE ONCE "Legacy/Platform/windot11.inc"
#INCLUDE ONCE "Legacy/System/eaptypes.inc"
'// major version is in low-order WORD,
'// minor version is in high-order WORD
%EQUATE `WLAN_API_VERSION_1_0 = &H00000001
%EQUATE `WLAN_API_VERSION_2_0 = &H00000002
'#define WLAN_API_VERSION_MAJOR(_v) ((_v) & 0xffff)
MACRO WLAN_API_VERSION_MAJOR(v_) = LO(WORD, v_)
'#define WLAN_API_VERSION_MINOR(_v) (((DWORD)(_v)) >> 16)
MACRO WLAN_API_VERSION_MINOR(v_) = HI(WORD, v_)
'#define WLAN_API_MAKE_VERSION(_major, _minor) (((DWORD)(_minor)) << 16 | (_major))
MACRO WLAN_API_MAKE_VERSION(vmajor_, vminor_) = MAK(DWORD, vminor_ , vmajor_)
'// WLAN API is version 1 in all WinXP
'// and version 2 in Longhorn Vista
'#if (_WIN32_WINNT >= 0x0600)
'#define WLAN_API_VERSION WLAN_API_VERSION_2_0
'#else
'#define WLAN_API_VERSION WLAN_API_VERSION_1_0
'#endif // (_WIN32_WINNT <= 0x0600)
'// maximum length of name, in characters
%EQUATE `WLAN_MAX_NAME_LENGTH = %L2_PROFILE_MAX_NAME_LENGTH
'// profile flags
%EQUATE `WLAN_PROFILE_GROUP_POLICY = &H00000001
%EQUATE `WLAN_PROFILE_USER = &H00000002
%EQUATE `WLAN_PROFILE_GET_PLAINTEXT_KEY = &H00000004
'// the following flags are only used for WlanSaveTemporaryProfile API
%EQUATE `WLAN_PROFILE_CONNECTION_MODE_SET_BY_CLIENT = &H00010000
%EQUATE `WLAN_PROFILE_CONNECTION_MODE_AUTO = &H00020000
'// EAPHost data storage flags
%EQUATE `WLAN_SET_EAPHOST_DATA_ALL_USERS = &H00000001
'// struct WLAN_PROFILE_INFO defines the basic information of an 802.11 network profile
' // Size = 516 bytes
TYPE WLAN_PROFILE_INFO DWORD
 strProfileName AS WSTRINGZ * %WLAN_MAX_NAME_LENGTH ' WCHAR
 dwFlags AS DWORD
END TYPE
' // Size = 40 bytes
TYPE DOT11_NETWORK DWORD
 dot11Ssid AS DOT11_SSID
 dot11BssType AS LONG ' DOT11_BSS_TYPE
END TYPE
'// proximity service discovery IE specific definitions
'// the maximum data size in one PSD IE data entry (payload), in bytes
%EQUATE `DOT11_PSD_IE_MAX_DATA_SIZE = 240
'// the maximum number of PSD IE data entries
%EQUATE `DOT11_PSD_IE_MAX_ENTRY_NUMBER = 5
' // Size = 8 bytes
TYPE WLAN_RAW_DATA DWORD
 ' // size of the data blob
 dwDataSize AS DWORD
 DataBlob(0) AS BYTE ' BYTE
END TYPE
' // Size = 8 bytes
TYPE WLAN_RAW_DATA_LIST_DataList DWORD
 ' // the beginning of the data blob
 ' // the offset is w.r.t. the beginning of the entry
 dwDataOffset AS DWORD
 ' // size of the data blob
 dwDataSize AS DWORD
END TYPE
' // Size = 16 bytes
TYPE WLAN_RAW_DATA_LIST DWORD
 dwTotalSize AS DWORD
 dwNumberOfItems AS DWORD
 DataList(0) AS WLAN_RAW_DATA_LIST_DataList
END TYPE
' enum WLAN_CONNECTION_MODE {
%EQUATE `wlan_connection_mode_profile = 0
%EQUATE `wlan_connection_mode_temporary_profile = 1
%EQUATE `wlan_connection_mode_discovery_secure = 2
%EQUATE `wlan_connection_mode_discovery_unsecure = 3
%EQUATE `wlan_connection_mode_auto = 4
%EQUATE `wlan_connection_mode_invalid = 5
'// Wlan reason code
'//
'// They are put in the following range:
'// each component got 0x1000 numbers, within which:
'// the first half is for capability mismatch reason,
'// the second half for connect/security error reason.
'//
'// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'// IMPORTANT: If you add/remove a reason code, please
'// modify the corresponding entry in wlanres.h and wlanres.rc
'// and the corresponding mapping in wlanapi.c
'typedef DWORD WLAN_REASON_CODE, *PWLAN_REASON_CODE;
%EQUATE `WLAN_REASON_CODE_SUCCESS = %L2_REASON_CODE_SUCCESS
'// general codes
%EQUATE `WLAN_REASON_CODE_UNKNOWN = %L2_REASON_CODE_UNKNOWN
%EQUATE `WLAN_REASON_CODE_RANGE_SIZE = %L2_REASON_CODE_GROUP_SIZE
%EQUATE `WLAN_REASON_CODE_BASE = %L2_REASON_CODE_DOT11_AC_BASE
'// range for Auto Config
'//
%EQUATE `WLAN_REASON_CODE_AC_BASE = %L2_REASON_CODE_DOT11_AC_BASE
%EQUATE `WLAN_REASON_CODE_AC_CONNECT_BASE = (%WLAN_REASON_CODE_AC_BASE + %WLAN_REASON_CODE_RANGE_SIZE \ 2)
%EQUATE `WLAN_REASON_CODE_AC_END = (%WLAN_REASON_CODE_AC_BASE + %WLAN_REASON_CODE_RANGE_SIZE - 1)
'// range for profile manager
'// it has profile adding failure reason codes, but may not have
'// connection reason codes
'//
%EQUATE `WLAN_REASON_CODE_PROFILE_BASE = %L2_REASON_CODE_PROFILE_BASE
%EQUATE `WLAN_REASON_CODE_PROFILE_CONNECT_BASE = (%WLAN_REASON_CODE_PROFILE_BASE + %WLAN_REASON_CODE_RANGE_SIZE \ 2)
%EQUATE `WLAN_REASON_CODE_PROFILE_END = (%WLAN_REASON_CODE_PROFILE_BASE + %WLAN_REASON_CODE_RANGE_SIZE - 1)
'// range for MSM
'//
%EQUATE `WLAN_REASON_CODE_MSM_BASE = %L2_REASON_CODE_DOT11_MSM_BASE
%EQUATE `WLAN_REASON_CODE_MSM_CONNECT_BASE = (%WLAN_REASON_CODE_MSM_BASE + %WLAN_REASON_CODE_RANGE_SIZE \ 2)
%EQUATE `WLAN_REASON_CODE_MSM_END = (%WLAN_REASON_CODE_MSM_BASE + %WLAN_REASON_CODE_RANGE_SIZE - 1)
'// range for MSMSEC
'//
%EQUATE `WLAN_REASON_CODE_MSMSEC_BASE = %L2_REASON_CODE_DOT11_SECURITY_BASE
%EQUATE `WLAN_REASON_CODE_MSMSEC_CONNECT_BASE = (%WLAN_REASON_CODE_MSMSEC_BASE + %WLAN_REASON_CODE_RANGE_SIZE \ 2)
%EQUATE `WLAN_REASON_CODE_MSMSEC_END = (%WLAN_REASON_CODE_MSMSEC_BASE + %WLAN_REASON_CODE_RANGE_SIZE - 1)
'// AC network incompatible reason codes
'//
%EQUATE `WLAN_REASON_CODE_NETWORK_NOT_COMPATIBLE = (%WLAN_REASON_CODE_AC_BASE +1)
%EQUATE `WLAN_REASON_CODE_PROFILE_NOT_COMPATIBLE = (%WLAN_REASON_CODE_AC_BASE +2)
'// AC connect reason code
'//
%EQUATE `WLAN_REASON_CODE_NO_AUTO_CONNECTION = (%WLAN_REASON_CODE_AC_CONNECT_BASE +1)
%EQUATE `WLAN_REASON_CODE_NOT_VISIBLE = (%WLAN_REASON_CODE_AC_CONNECT_BASE +2)
%EQUATE `WLAN_REASON_CODE_GP_DENIED = (%WLAN_REASON_CODE_AC_CONNECT_BASE +3)
%EQUATE `WLAN_REASON_CODE_USER_DENIED = (%WLAN_REASON_CODE_AC_CONNECT_BASE +4)
%EQUATE `WLAN_REASON_CODE_BSS_TYPE_NOT_ALLOWED = (%WLAN_REASON_CODE_AC_CONNECT_BASE +5)
%EQUATE `WLAN_REASON_CODE_IN_FAILED_LIST = (%WLAN_REASON_CODE_AC_CONNECT_BASE +6)
%EQUATE `WLAN_REASON_CODE_IN_BLOCKED_LIST = (%WLAN_REASON_CODE_AC_CONNECT_BASE +7)
%EQUATE `WLAN_REASON_CODE_SSID_LIST_TOO_LONG = (%WLAN_REASON_CODE_AC_CONNECT_BASE +8)
%EQUATE `WLAN_REASON_CODE_CONNECT_CALL_FAIL = (%WLAN_REASON_CODE_AC_CONNECT_BASE +9)
%EQUATE `WLAN_REASON_CODE_SCAN_CALL_FAIL = (%WLAN_REASON_CODE_AC_CONNECT_BASE +10)
%EQUATE `WLAN_REASON_CODE_NETWORK_NOT_AVAILABLE = (%WLAN_REASON_CODE_AC_CONNECT_BASE +11)
%EQUATE `WLAN_REASON_CODE_PROFILE_CHANGED_OR_DELETED = (%WLAN_REASON_CODE_AC_CONNECT_BASE +12)
%EQUATE `WLAN_REASON_CODE_KEY_MISMATCH = (%WLAN_REASON_CODE_AC_CONNECT_BASE + 13)
%EQUATE `WLAN_REASON_CODE_USER_NOT_RESPOND = (%WLAN_REASON_CODE_AC_CONNECT_BASE + 14)
%EQUATE `WLAN_REASON_CODE_AP_PROFILE_NOT_ALLOWED_FOR_CLIENT = (%WLAN_REASON_CODE_AC_CONNECT_BASE + 15)
%EQUATE `WLAN_REASON_CODE_AP_PROFILE_NOT_ALLOWED = (%WLAN_REASON_CODE_AC_CONNECT_BASE + 16)
'// Profile validation errors
'//
%EQUATE `WLAN_REASON_CODE_INVALID_PROFILE_SCHEMA = (%WLAN_REASON_CODE_PROFILE_BASE +1)
%EQUATE `WLAN_REASON_CODE_PROFILE_MISSING = (%WLAN_REASON_CODE_PROFILE_BASE +2)
%EQUATE `WLAN_REASON_CODE_INVALID_PROFILE_NAME = (%WLAN_REASON_CODE_PROFILE_BASE +3)
%EQUATE `WLAN_REASON_CODE_INVALID_PROFILE_TYPE = (%WLAN_REASON_CODE_PROFILE_BASE +4)
%EQUATE `WLAN_REASON_CODE_INVALID_PHY_TYPE = (%WLAN_REASON_CODE_PROFILE_BASE +5)
%EQUATE `WLAN_REASON_CODE_MSM_SECURITY_MISSING = (%WLAN_REASON_CODE_PROFILE_BASE +6)
%EQUATE `WLAN_REASON_CODE_IHV_SECURITY_NOT_SUPPORTED = (%WLAN_REASON_CODE_PROFILE_BASE +7)
%EQUATE `WLAN_REASON_CODE_IHV_OUI_MISMATCH = (%WLAN_REASON_CODE_PROFILE_BASE +8)
' // IHV OUI not present but there is IHV settings in profile
%EQUATE `WLAN_REASON_CODE_IHV_OUI_MISSING = (%WLAN_REASON_CODE_PROFILE_BASE +9)
' // IHV OUI is present but there is no IHV settings in profile
%EQUATE `WLAN_REASON_CODE_IHV_SETTINGS_MISSING = (%WLAN_REASON_CODE_PROFILE_BASE +10)
' // both/conflict MSMSec and IHV security settings exist in profile
%EQUATE `WLAN_REASON_CODE_CONFLICT_SECURITY = (%WLAN_REASON_CODE_PROFILE_BASE +11)
' // no IHV or MSMSec security settings in profile
%EQUATE `WLAN_REASON_CODE_SECURITY_MISSING = (%WLAN_REASON_CODE_PROFILE_BASE +12)
%EQUATE `WLAN_REASON_CODE_INVALID_BSS_TYPE = (%WLAN_REASON_CODE_PROFILE_BASE +13)
%EQUATE `WLAN_REASON_CODE_INVALID_ADHOC_CONNECTION_MODE = (%WLAN_REASON_CODE_PROFILE_BASE +14)
%EQUATE `WLAN_REASON_CODE_NON_BROADCAST_SET_FOR_ADHOC = (%WLAN_REASON_CODE_PROFILE_BASE +15)
%EQUATE `WLAN_REASON_CODE_AUTO_SWITCH_SET_FOR_ADHOC = (%WLAN_REASON_CODE_PROFILE_BASE +16)
%EQUATE `WLAN_REASON_CODE_AUTO_SWITCH_SET_FOR_MANUAL_CONNECTION = (%WLAN_REASON_CODE_PROFILE_BASE +17)
%EQUATE `WLAN_REASON_CODE_IHV_SECURITY_ONEX_MISSING = (%WLAN_REASON_CODE_PROFILE_BASE +18)
%EQUATE `WLAN_REASON_CODE_PROFILE_SSID_INVALID = (%WLAN_REASON_CODE_PROFILE_BASE +19)
%EQUATE `WLAN_REASON_CODE_TOO_MANY_SSID = (%WLAN_REASON_CODE_PROFILE_BASE +20)
%EQUATE `WLAN_REASON_CODE_IHV_CONNECTIVITY_NOT_SUPPORTED = (%WLAN_REASON_CODE_PROFILE_BASE +21)
%EQUATE `WLAN_REASON_CODE_BAD_MAX_NUMBER_OF_CLIENTS_FOR_AP = (%WLAN_REASON_CODE_PROFILE_BASE +22)
%EQUATE `WLAN_REASON_CODE_INVALID_CHANNEL = (%WLAN_REASON_CODE_PROFILE_BASE +23)
%EQUATE `WLAN_REASON_CODE_OPERATION_MODE_NOT_SUPPORTED = (%WLAN_REASON_CODE_PROFILE_BASE +24)
%EQUATE `WLAN_REASON_CODE_AUTO_AP_PROFILE_NOT_ALLOWED = (%WLAN_REASON_CODE_PROFILE_BASE +25)
%EQUATE `WLAN_REASON_CODE_AUTO_CONNECTION_NOT_ALLOWED = (%WLAN_REASON_CODE_PROFILE_BASE +26)
'// MSM network incompatible reasons
'//
%EQUATE `WLAN_REASON_CODE_UNSUPPORTED_SECURITY_SET_BY_OS = (%WLAN_REASON_CODE_MSM_BASE +1)
%EQUATE `WLAN_REASON_CODE_UNSUPPORTED_SECURITY_SET = (%WLAN_REASON_CODE_MSM_BASE +2)
%EQUATE `WLAN_REASON_CODE_BSS_TYPE_UNMATCH = (%WLAN_REASON_CODE_MSM_BASE +3)
%EQUATE `WLAN_REASON_CODE_PHY_TYPE_UNMATCH = (%WLAN_REASON_CODE_MSM_BASE +4)
%EQUATE `WLAN_REASON_CODE_DATARATE_UNMATCH = (%WLAN_REASON_CODE_MSM_BASE +5)
'// MSM connection failure reasons, to be defined
'// failure reason codes
'//
' // user called to disconnect
%EQUATE `WLAN_REASON_CODE_USER_CANCELLED = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+1)
' // got disconnect while associating
%EQUATE `WLAN_REASON_CODE_ASSOCIATION_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+2)
' // timeout for association
%EQUATE `WLAN_REASON_CODE_ASSOCIATION_TIMEOUT = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+3)
' // pre-association security completed with failure
%EQUATE `WLAN_REASON_CODE_PRE_SECURITY_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+4)
' // fail to start post-association security
%EQUATE `WLAN_REASON_CODE_START_SECURITY_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+5)
' // post-association security completed with failure
%EQUATE `WLAN_REASON_CODE_SECURITY_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+6)
' // security watchdog timeout
%EQUATE `WLAN_REASON_CODE_SECURITY_TIMEOUT = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+7)
' // got disconnect from driver when roaming
%EQUATE `WLAN_REASON_CODE_ROAMING_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+8)
' // failed to start security for roaming
%EQUATE `WLAN_REASON_CODE_ROAMING_SECURITY_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+9)
' // failed to start security for adhoc-join
%EQUATE `WLAN_REASON_CODE_ADHOC_SECURITY_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+10)
' // got disconnection from driver
%EQUATE `WLAN_REASON_CODE_DRIVER_DISCONNECTED = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+11)
' // driver operation failed
%EQUATE `WLAN_REASON_CODE_DRIVER_OPERATION_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+12)
' // Ihv service is not available
%EQUATE `WLAN_REASON_CODE_IHV_NOT_AVAILABLE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+13)
' // Response from ihv timed out
%EQUATE `WLAN_REASON_CODE_IHV_NOT_RESPONDING = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+14)
' // Timed out waiting for driver to disconnect
%EQUATE `WLAN_REASON_CODE_DISCONNECT_TIMEOUT = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+15)
' // An internal error prevented the operation from being completed.
%EQUATE `WLAN_REASON_CODE_INTERNAL_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+16)
' // UI Request timed out.
%EQUATE `WLAN_REASON_CODE_UI_REQUEST_TIMEOUT = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+17)
' // Roaming too often, post security is not completed after 5 times.
%EQUATE `WLAN_REASON_CODE_TOO_MANY_SECURITY_ATTEMPTS = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+18)
' // Failed to start AP
%EQUATE `WLAN_REASON_CODE_AP_STARTING_FAILURE = (%WLAN_REASON_CODE_MSM_CONNECT_BASE+19)
'// MSMSEC reason codes
'//
%EQUATE `WLAN_REASON_CODE_MSMSEC_MIN = %WLAN_REASON_CODE_MSMSEC_BASE
'// Key index specified is not valid
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_KEY_INDEX = (%WLAN_REASON_CODE_MSMSEC_BASE+1)
'// Key required, PSK present
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_PSK_PRESENT = (%WLAN_REASON_CODE_MSMSEC_BASE+2)
'// Invalid key length
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_KEY_LENGTH = (%WLAN_REASON_CODE_MSMSEC_BASE+3)
'// Invalid PSK length
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_PSK_LENGTH = (%WLAN_REASON_CODE_MSMSEC_BASE+4)
'// No auth/cipher specified
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_NO_AUTH_CIPHER_SPECIFIED = (%WLAN_REASON_CODE_MSMSEC_BASE+5)
'// Too many auth/cipher specified
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_TOO_MANY_AUTH_CIPHER_SPECIFIED = (%WLAN_REASON_CODE_MSMSEC_BASE+6)
'// Profile contains duplicate auth/cipher
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_DUPLICATE_AUTH_CIPHER = (%WLAN_REASON_CODE_MSMSEC_BASE+7)
'// Profile raw data is invalid (1x or key data)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_RAWDATA_INVALID = (%WLAN_REASON_CODE_MSMSEC_BASE+8)
'// Invalid auth/cipher combination
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_AUTH_CIPHER = (%WLAN_REASON_CODE_MSMSEC_BASE+9)
'// 802.1x disabled when it's required to be enabled
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_ONEX_DISABLED = (%WLAN_REASON_CODE_MSMSEC_BASE+10)
'// 802.1x enabled when it's required to be disabled
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_ONEX_ENABLED = (%WLAN_REASON_CODE_MSMSEC_BASE+11)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PMKCACHE_MODE = (%WLAN_REASON_CODE_MSMSEC_BASE+12)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PMKCACHE_SIZE = (%WLAN_REASON_CODE_MSMSEC_BASE+13)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PMKCACHE_TTL = (%WLAN_REASON_CODE_MSMSEC_BASE+14)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PREAUTH_MODE = (%WLAN_REASON_CODE_MSMSEC_BASE+15)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PREAUTH_THROTTLE = (%WLAN_REASON_CODE_MSMSEC_BASE+16)
'// PreAuth enabled when PMK cache is disabled
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_PREAUTH_ONLY_ENABLED = (%WLAN_REASON_CODE_MSMSEC_BASE+17)
'// Capability matching failed at network
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_NETWORK = (%WLAN_REASON_CODE_MSMSEC_BASE+18)
'// Capability matching failed at NIC
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_NIC = (%WLAN_REASON_CODE_MSMSEC_BASE+19)
'// Capability matching failed at profile
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE = (%WLAN_REASON_CODE_MSMSEC_BASE+20)
'// Network does not support specified discovery type
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_DISCOVERY = (%WLAN_REASON_CODE_MSMSEC_BASE+21)
'// Passphrase contains invalid character
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_PASSPHRASE_CHAR = (%WLAN_REASON_CODE_MSMSEC_BASE+22)
'// Key material contains invalid character
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_KEYMATERIAL_CHAR = (%WLAN_REASON_CODE_MSMSEC_BASE+23)
'// Wrong key type specified for the auth/cipher pair
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_WRONG_KEYTYPE = (%WLAN_REASON_CODE_MSMSEC_BASE+24)
'// "Mixed cell" suspected (AP not beaconing privacy, we have privacy enabled profile)
%EQUATE `WLAN_REASON_CODE_MSMSEC_MIXED_CELL = (%WLAN_REASON_CODE_MSMSEC_BASE+25)
'// Auth timers or number of timeouts in profile is incorrect
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_AUTH_TIMERS_INVALID = (%WLAN_REASON_CODE_MSMSEC_BASE+26)
'// Group key update interval in profile is incorrect
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_GKEY_INTV = (%WLAN_REASON_CODE_MSMSEC_BASE+27)
'// "Transition network" suspected, trying legacy 802.11 security
%EQUATE `WLAN_REASON_CODE_MSMSEC_TRANSITION_NETWORK = (%WLAN_REASON_CODE_MSMSEC_BASE+28)
'// Key contains characters which do not map to ASCII
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_KEY_UNMAPPED_CHAR = (%WLAN_REASON_CODE_MSMSEC_BASE+29)
'// Capability matching failed at profile (auth not found)
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_AUTH = (%WLAN_REASON_CODE_MSMSEC_BASE+30)
'// Capability matching failed at profile (cipher not found)
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_CIPHER = (%WLAN_REASON_CODE_MSMSEC_BASE+31)
'// Safe mode value is invalid
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_SAFE_MODE = (%WLAN_REASON_CODE_MSMSEC_BASE+32)
'// Profile requires safe mode, not supported by NIC
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_SAFE_MODE_NIC = (%WLAN_REASON_CODE_MSMSEC_BASE+33)
'// Profile requires safe mode, not supported by network
%EQUATE `WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_SAFE_MODE_NW = (%WLAN_REASON_CODE_MSMSEC_BASE+34)
'// Profile has unsupported auth
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_UNSUPPORTED_AUTH = (%WLAN_REASON_CODE_MSMSEC_BASE+35)
'// Profile has unsupported cipher
%EQUATE `WLAN_REASON_CODE_MSMSEC_PROFILE_UNSUPPORTED_CIPHER = (%WLAN_REASON_CODE_MSMSEC_BASE+36)
'// Failed to queue UI request
%EQUATE `WLAN_REASON_CODE_MSMSEC_UI_REQUEST_FAILURE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+1)
'// 802.1x authentication did not start within configured time
%EQUATE `WLAN_REASON_CODE_MSMSEC_AUTH_START_TIMEOUT = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+2)
'// 802.1x authentication did not complete within configured time
%EQUATE `WLAN_REASON_CODE_MSMSEC_AUTH_SUCCESS_TIMEOUT = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+3)
'// Dynamic key exchange did not start within configured time
%EQUATE `WLAN_REASON_CODE_MSMSEC_KEY_START_TIMEOUT = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+4)
'// Dynamic key exchange did not succeed within configured time
%EQUATE `WLAN_REASON_CODE_MSMSEC_KEY_SUCCESS_TIMEOUT = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+5)
'// Message 3 of 4 way handshake has no key data (RSN/WPA)
%EQUATE `WLAN_REASON_CODE_MSMSEC_M3_MISSING_KEY_DATA = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+6)
'// Message 3 of 4 way handshake has no IE (RSN/WPA)
%EQUATE `WLAN_REASON_CODE_MSMSEC_M3_MISSING_IE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+7)
'// Message 3 of 4 way handshake has no Group Key (RSN)
%EQUATE `WLAN_REASON_CODE_MSMSEC_M3_MISSING_GRP_KEY = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+8)
'// Matching security capabilities of IE in M3 failed (RSN/WPA)
%EQUATE `WLAN_REASON_CODE_MSMSEC_PR_IE_MATCHING = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+9)
'// Matching security capabilities of Secondary IE in M3 failed (RSN)
%EQUATE `WLAN_REASON_CODE_MSMSEC_SEC_IE_MATCHING = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+10)
'// Required a pairwise key but AP configured only group keys
%EQUATE `WLAN_REASON_CODE_MSMSEC_NO_PAIRWISE_KEY = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+11)
'// Message 1 of group key handshake has no key data (RSN/WPA)
%EQUATE `WLAN_REASON_CODE_MSMSEC_G1_MISSING_KEY_DATA = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+12)
'// Message 1 of group key handshake has no group key
%EQUATE `WLAN_REASON_CODE_MSMSEC_G1_MISSING_GRP_KEY = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+13)
'// AP reset secure bit after connection was secured
%EQUATE `WLAN_REASON_CODE_MSMSEC_PEER_INDICATED_INSECURE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+14)
'// 802.1x indicated there is no authenticator but profile requires 802.1x
%EQUATE `WLAN_REASON_CODE_MSMSEC_NO_AUTHENTICATOR = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+15)
'// Plumbing settings to NIC failed
%EQUATE `WLAN_REASON_CODE_MSMSEC_NIC_FAILURE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+16)
'// Operation was cancelled by caller
%EQUATE `WLAN_REASON_CODE_MSMSEC_CANCELLED = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+17)
'// Key was in incorrect format
%EQUATE `WLAN_REASON_CODE_MSMSEC_KEY_FORMAT = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+18)
'// Security downgrade detected
%EQUATE `WLAN_REASON_CODE_MSMSEC_DOWNGRADE_DETECTED = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+19)
'// PSK mismatch suspected
%EQUATE `WLAN_REASON_CODE_MSMSEC_PSK_MISMATCH_SUSPECTED = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+20)
'// Forced failure because connection method was not secure
%EQUATE `WLAN_REASON_CODE_MSMSEC_FORCED_FAILURE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+21)
'// Message 3 of 4 way handshake contains too many RSN IE (RSN)
%EQUATE `WLAN_REASON_CODE_MSMSEC_M3_TOO_MANY_RSNIE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+22)
'// Message 2 of 4 way handshake has no key data (RSN Adhoc)
%EQUATE `WLAN_REASON_CODE_MSMSEC_M2_MISSING_KEY_DATA = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+23)
'// Message 2 of 4 way handshake has no IE (RSN Adhoc)
%EQUATE `WLAN_REASON_CODE_MSMSEC_M2_MISSING_IE = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+24)
%EQUATE `WLAN_REASON_CODE_MSMSEC_AUTH_WCN_COMPLETED = (%WLAN_REASON_CODE_MSMSEC_CONNECT_BASE+25)
%EQUATE `WLAN_REASON_CODE_MSMSEC_MAX = %WLAN_REASON_CODE_MSMSEC_END
'typedef ULONG WLAN_SIGNAL_QUALITY, *PWLAN_SIGNAL_QUALITY;
'// available network flags
%EQUATE `WLAN_AVAILABLE_NETWORK_CONNECTED = &H00000001 ' // This network is currently connected
%EQUATE `WLAN_AVAILABLE_NETWORK_HAS_PROFILE = &H00000002 ' // There is a profile for this network
%EQUATE `WLAN_AVAILABLE_NETWORK_CONSOLE_USER_PROFILE = &H00000004 ' // The profile is the active console user's per user profile
'// flags that control the list returned by WlanGetAvailableNetworkList
'// include all ad hoc network profiles in the available network list, regardless they are visible or not
%EQUATE `WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES = &H00000001
'// include all hidden network profiles in the available network list, regardless they are visible or not
%EQUATE `WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES = &H00000002
' // Size = 256 bytes
TYPE WLAN_RATE_SET DWORD
 uRateSetLength AS DWORD ' ULONG
 usRateSet(%DOT11_RATE_SET_MAX_LENGTH - 1) AS WORD ' USHORT
END TYPE
%EQUATE `WLAN_MAX_PHY_TYPE_NUMBER = 8
'//
'// struct WLAN_AVAILABLE_NETWORK defines information needed for an available network
' // Size = 628 bytes
TYPE WLAN_AVAILABLE_NETWORK DWORD
 strProfileName AS WSTRINGZ * %WLAN_MAX_NAME_LENGTH ' WCHAR
 dot11Ssid AS DOT11_SSID
 dot11BssType AS LONG ' DOT11_BSS_TYPE
 uNumberOfBssids AS DWORD ' ULONG
 bNetworkConnectable AS LONG
 wlanNotConnectableReason AS DWORD ' WLAN_REASON_CODE
 uNumberOfPhyTypes AS DWORD ' ULONG
 dot11PhyTypes(%WLAN_MAX_PHY_TYPE_NUMBER - 1) AS DWORD ' DOT11_PHY_TYPE
 ' // bMorePhyTypes is set to TRUE if the PHY types for the network
 ' // exceeds WLAN_MAX_PHY_TYPE_NUMBER.
 ' // In this case, uNumerOfPhyTypes is WLAN_MAX_PHY_TYPE_NUMBER and the
 ' // first WLAN_MAX_PHY_TYPE_NUMBER PHY types are returned.
 bMorePhyTypes AS LONG
 wlanSignalQuality AS DWORD ' WLAN_SIGNAL_QUALITY
 bSecurityEnabled AS LONG
 dot11DefaultAuthAlgorithm AS LONG ' DOT11_AUTH_ALGORITHM
 dot11DefaultCipherAlgorithm AS LONG ' DOT11_CIPHER_ALGORITHM
 dwFlags AS DWORD
 dwReserved AS DWORD
END TYPE
' // Size = 360 bytes
TYPE WLAN_BSS_ENTRY DWORD
 dot11Ssid AS DOT11_SSID
 uPhyId AS DWORD ' ULONG
 dot11Bssid AS DOT11_MAC_ADDRESS
 dot11BssType AS LONG ' DOT11_BSS_TYPE
 dot11BssPhyType AS DWORD ' DOT11_PHY_TYPE
 lRssi AS LONG
 uLinkQuality AS DWORD ' ULONG
 bInRegDomain AS BYTE ' BOOLEAN
 usBeaconPeriod AS WORD ' USHORT
 ullTimestamp AS QUAD ' ULONGLONG
 ullHostTimestamp AS QUAD ' ULONGLONG
 usCapabilityInformation AS WORD ' ULONG
 ulChCenterFrequency AS DWORD ' ULONG
 wlanRateSet AS WLAN_RATE_SET
 ' // the beginning of the IE blob
 ' // the offset is w.r.t. the beginning of the entry
 ulIeOffset AS DWORD ' ULONG
 ' // size of the IE blob
 ulIeSize AS DWORD ' ULONG
END TYPE
'// struct WLAN_VARIABLE_SIZE_ARRAY defines a list of entries,
'// each of which may have different size
' // Size = 368 bytes
TYPE WLAN_BSS_LIST DWORD
 ' // The total size of the data in BYTE
 dwTotalSize AS DWORD
 dwNumberOfItems AS DWORD
 wlanBssEntries(0) AS WLAN_BSS_ENTRY
END TYPE
' // the states of the network (interface)
' enum WLAN_INTERFACE_STATE
%EQUATE `wlan_interface_state_not_ready = 0
%EQUATE `wlan_interface_state_connected = 1
%EQUATE `wlan_interface_state_ad_hoc_network_formed = 2
%EQUATE `wlan_interface_state_disconnecting = 3
%EQUATE `wlan_interface_state_disconnected = 4
%EQUATE `wlan_interface_state_associating = 5
%EQUATE `wlan_interface_state_discovering = 6
%EQUATE `wlan_interface_state_authenticating = 7
'// Adhoc network states
' enum WLAN_ADHOC_NETWORK_STATE {
%EQUATE `wlan_adhoc_network_state_formed = 0
%EQUATE `wlan_adhoc_network_state_connected = 1
'// struct WLAN_INTERFACE_INFO defines the basic information for an interface
' // Size = 532 bytes
TYPE WLAN_INTERFACE_INFO DWORD
 InterfaceGuid AS GUID ' GUID
 strInterfaceDescription AS WSTRINGZ * %WLAN_MAX_NAME_LENGTH ' WCHAR
 isState AS LONG ' WLAN_INTERFACE_STATE
END TYPE
'// structure WLAN_ASSOCIATION_ATTRIBUTES defines attributes of a wireless
'// association. The unit for Rx/Tx rate is Kbits/second.
' // Size = 68 bytes
TYPE WLAN_ASSOCIATION_ATTRIBUTES DWORD
 dot11Ssid AS DOT11_SSID
 dot11BssType AS LONG ' DOT11_BSS_TYPE
 dot11Bssid AS DOT11_MAC_ADDRESS
 dot11PhyType AS DWORD ' DOT11_PHY_TYPE
 uDot11PhyIndex AS DWORD ' ULONG
 wlanSignalQuality AS DWORD ' WLAN_SIGNAL_QUALITY
 ulRxRate AS DWORD ' ULONG
 ulTxRate AS DWORD ' ULONG
END TYPE
' // Size = 16 bytes
TYPE WLAN_SECURITY_ATTRIBUTES DWORD
 bSecurityEnabled AS LONG
 bOneXEnabled AS LONG
 dot11AuthAlgorithm AS LONG ' DOT11_AUTH_ALGORITHM
 dot11CipherAlgorithm AS LONG ' DOT11_CIPHER_ALGORITHM
END TYPE
'// structure WLAN_CONNECTION_ATTRIBUTES defines attributes of a wireless connection
' // Size = 604 bytes
TYPE WLAN_CONNECTION_ATTRIBUTES DWORD
 isState AS LONG ' WLAN_INTERFACE_STATE
 wlanConnectionMode AS LONG ' WLAN_CONNECTION_MODE
 strProfileName AS WSTRINGZ * %WLAN_MAX_NAME_LENGTH ' WCHAR
 wlanAssociationAttributes AS WLAN_ASSOCIATION_ATTRIBUTES
 wlanSecurityAttributes AS WLAN_SECURITY_ATTRIBUTES
END TYPE
'// use the 4-byte enum
' enum _DOT11_RADIO_STATE
%EQUATE `dot11_radio_state_unknown = 0
%EQUATE `dot11_radio_state_on = 1
%EQUATE `dot11_radio_state_off = 2
'// the maximum number of PHYs supported by a NIC
%EQUATE `WLAN_MAX_PHY_INDEX = 64
' // Size = 12 bytes
TYPE WLAN_PHY_RADIO_STATE DWORD
 dwPhyIndex AS DWORD
 dot11SoftwareRadioState AS LONG ' DOT11_RADIO_STATE
 dot11HardwareRadioState AS LONG ' DOT11_RADIO_STATE
END TYPE
' // Size = 772 bytes
TYPE WLAN_RADIO_STATE DWORD
 dwNumberOfPhys AS DWORD
 PhyRadioState(%WLAN_MAX_PHY_INDEX - 1) AS WLAN_PHY_RADIO_STATE
END TYPE
' enum WLAN_INTERFACE_TYPE
%EQUATE `wlan_interface_type_emulated_802_11 = 0
%EQUATE `wlan_interface_type_native_802_11 = 1
%EQUATE `wlan_interface_type_invalid = 2
' // Size = 276 bytes
TYPE WLAN_INTERFACE_CAPABILITY DWORD
 interfaceType AS LONG ' WLAN_INTERFACE_TYPE
 bDot11DSupported AS LONG
 dwMaxDesiredSsidListSize AS DWORD
 dwMaxDesiredBssidListSize AS DWORD
 dwNumberOfSupportedPhys AS DWORD
 dot11PhyTypes(%WLAN_MAX_PHY_INDEX - 1) AS DWORD ' DOT11_PHY_TYPE
END TYPE
' // Size = 12 bytes
TYPE WLAN_AUTH_CIPHER_PAIR_LIST DWORD
 dwNumberOfItems AS DWORD
 pAuthCipherPairList(0) AS DOT11_AUTH_CIPHER_PAIR
END TYPE
' // Size = 8 bytes
TYPE WLAN_COUNTRY_OR_REGION_STRING_LIST DWORD
 dwNumberOfItems AS DWORD
 pCountryOrRegionStringList(0) AS DOT11_COUNTRY_OR_REGION_STRING
END TYPE
' // Size = 524 bytes
TYPE WLAN_PROFILE_INFO_LIST DWORD
 dwNumberOfItems AS DWORD
 dwIndex AS DWORD
 ProfileInfo(0) AS WLAN_PROFILE_INFO
END TYPE
' // Size = 636 bytes
TYPE WLAN_AVAILABLE_NETWORK_LIST DWORD
 dwNumberOfItems AS DWORD
 dwIndex AS DWORD
 Network(0) AS WLAN_AVAILABLE_NETWORK
END TYPE
' // Size = 540 bytes
TYPE WLAN_INTERFACE_INFO_LIST DWORD
 dwNumberOfItems AS DWORD
 dwIndex AS DWORD
 InterfaceInfo(0) AS WLAN_INTERFACE_INFO
END TYPE
'// network list
' // Size = 48 bytes
TYPE DOT11_NETWORK_LIST DWORD
 dwNumberOfItems AS DWORD
 dwIndex AS DWORD
 Network(0) AS DOT11_NETWORK
END TYPE
'// power settings
' enum WLAN_POWER_SETTING
%EQUATE `wlan_power_setting_no_saving = 0
%EQUATE `wlan_power_setting_low_saving = 1
%EQUATE `wlan_power_setting_medium_saving = 2
%EQUATE `wlan_power_setting_maximum_saving = 3
%EQUATE `wlan_power_setting_invalid = 4
'// Wlan connection flags used in WLAN_CONNECTION_PARAMETERS
'// The network to be connected is a hidden network
'// This flag cannnot be set if the network to connected is an ad hoc network
%EQUATE `WLAN_CONNECTION_HIDDEN_NETWORK = &H00000001
'// Only join an ad hoc network, do not form it if it doesn't exist
'// This flag cannnot be set if the network to connected is not an ad hoc network
%EQUATE `WLAN_CONNECTION_ADHOC_JOIN_ONLY = &H00000002
'// Ignore the privacy bit for the association. This is used to support easy config.
'// This flag is valid only for wlan_connection_mode_temporary_profile and infrastructure networks.
%EQUATE `WLAN_CONNECTION_IGNORE_PRIVACY_BIT = &H00000004
'// Exempt EAPOL traffic from encryption/decryption. This is used to
'// support an application that needs to send EAPOL traffic in non-802.1x WEP
'// networks. This flag is valid only for wlan_connection_mode_temporary_profile
'// in infrastructure networks when using authentication algorithm Open and
'// Cipher WEP with 802.1x disabled
%EQUATE `WLAN_CONNECTION_EAPOL_PASSTHROUGH = &H00000008
'// connection parameters
' // Size = 24 bytes
TYPE WLAN_CONNECTION_PARAMETERS DWORD
 wlanConnectionMode AS LONG ' WLAN_CONNECTION_MODE
 strProfile AS WSTRINGZ PTR
 pDot11Ssid AS DOT11_SSID PTR ' PDOT11_SSID
 pDesiredBssidList AS DOT11_BSSID_LIST PTR ' PDOT11_BSSID_LIST
 dot11BssType AS LONG ' DOT11_BSS_TYPE
 dwFlags AS DWORD
END TYPE
'// data structure for connection-related notifications.
' // Size = 580 bytes
TYPE WLAN_MSM_NOTIFICATION_DATA DWORD
 wlanConnectionMode AS LONG ' WLAN_CONNECTION_MODE
 strProfileName AS WSTRINGZ * %WLAN_MAX_NAME_LENGTH ' WCHAR
 dot11Ssid AS DOT11_SSID
 dot11BssType AS LONG ' DOT11_BSS_TYPE
 dot11MacAddr AS DOT11_MAC_ADDRESS
 bSecurityEnabled AS LONG
 bFirstPeer AS LONG
 bLastPeer AS LONG
 wlanReasonCode AS DWORD ' WLAN_REASON_CODE
END TYPE
'// flags for connection notifications
'// whether an adhoc network is formed or joined
%EQUATE `WLAN_CONNECTION_NOTIFICATION_ADHOC_NETWORK_FORMED = &H00000001 ' // Formed ad hoc network
%EQUATE `WLAN_CONNECTION_NOTIFICATION_CONSOLE_USER_PROFILE = &H00000004 ' // The profile is the active console user's per user profile
' // Size = 572 bytes
TYPE WLAN_CONNECTION_NOTIFICATION_DATA DWORD
 wlanConnectionMode AS LONG ' WLAN_CONNECTION_MODE
 strProfileName AS WSTRINGZ * %WLAN_MAX_NAME_LENGTH ' WCHAR
 dot11Ssid AS DOT11_SSID
 dot11BssType AS LONG ' DOT11_BSS_TYPE
 bSecurityEnabled AS LONG
 wlanReasonCode AS DWORD ' WLAN_REASON_CODE
 dwFlags AS DWORD
 strProfileXml AS WSTRINGZ * 1 ' WCHAR ' variable-length
END TYPE
'// the types of notification
'// compatible with L2_NOTIFICATION_SOURCE
%EQUATE `WLAN_NOTIFICATION_SOURCE_NONE = %L2_NOTIFICATION_SOURCE_NONE
%EQUATE `WLAN_NOTIFICATION_SOURCE_ALL = %L2_NOTIFICATION_SOURCE_ALL
%EQUATE `WLAN_NOTIFICATION_SOURCE_ACM = %L2_NOTIFICATION_SOURCE_WLAN_ACM
%EQUATE `WLAN_NOTIFICATION_SOURCE_MSM = %L2_NOTIFICATION_SOURCE_WLAN_MSM
%EQUATE `WLAN_NOTIFICATION_SOURCE_SECURITY = %L2_NOTIFICATION_SOURCE_WLAN_SECURITY
%EQUATE `WLAN_NOTIFICATION_SOURCE_IHV = %L2_NOTIFICATION_SOURCE_WLAN_IHV
%EQUATE `WLAN_NOTIFICATION_SOURCE_HNWK = %L2_NOTIFICATION_SOURCE_WLAN_HNWK
%EQUATE `WLAN_NOTIFICATION_SOURCE_ONEX = %L2_NOTIFICATION_SOURCE_ONEX
' enum _WLAN_NOTIFICATION_ACM
%EQUATE `wlan_notification_acm_start = %L2_NOTIFICATION_CODE_PUBLIC_BEGIN
%EQUATE `wlan_notification_acm_autoconf_enabled = %wlan_notification_acm_start + 1
%EQUATE `wlan_notification_acm_autoconf_disabled = %wlan_notification_acm_autoconf_enabled + 1
%EQUATE `wlan_notification_acm_background_scan_enabled = %wlan_notification_acm_autoconf_disabled + 1
%EQUATE `wlan_notification_acm_background_scan_disabled = %wlan_notification_acm_background_scan_enabled + 1
%EQUATE `wlan_notification_acm_bss_type_change = %wlan_notification_acm_background_scan_disabled + 1
%EQUATE `wlan_notification_acm_power_setting_change = %wlan_notification_acm_bss_type_change + 1
%EQUATE `wlan_notification_acm_scan_complete = %wlan_notification_acm_power_setting_change + 1
%EQUATE `wlan_notification_acm_scan_fail = %wlan_notification_acm_scan_complete + 1
%EQUATE `wlan_notification_acm_connection_start = %wlan_notification_acm_scan_fail + 1
%EQUATE `wlan_notification_acm_connection_complete = %wlan_notification_acm_connection_start + 1
%EQUATE `wlan_notification_acm_connection_attempt_fail = %wlan_notification_acm_connection_complete + 1
%EQUATE `wlan_notification_acm_filter_list_change = %wlan_notification_acm_connection_attempt_fail + 1
%EQUATE `wlan_notification_acm_interface_arrival = %wlan_notification_acm_filter_list_change + 1
%EQUATE `wlan_notification_acm_interface_removal = %wlan_notification_acm_interface_arrival + 1
%EQUATE `wlan_notification_acm_profile_change = %wlan_notification_acm_interface_removal + 1
%EQUATE `wlan_notification_acm_profile_name_change = %wlan_notification_acm_profile_change + 1
%EQUATE `wlan_notification_acm_profiles_exhausted = %wlan_notification_acm_profile_name_change + 1
%EQUATE `wlan_notification_acm_network_not_available = %wlan_notification_acm_profiles_exhausted + 1
%EQUATE `wlan_notification_acm_network_available = %wlan_notification_acm_network_not_available + 1
%EQUATE `wlan_notification_acm_disconnecting = %wlan_notification_acm_network_available + 1
%EQUATE `wlan_notification_acm_disconnected = %wlan_notification_acm_disconnecting + 1
%EQUATE `wlan_notification_acm_adhoc_network_state_change = %wlan_notification_acm_disconnected + 1
%EQUATE `wlan_notification_acm_end = %wlan_notification_acm_adhoc_network_state_change + 1
' enum _WLAN_NOTIFICATION_MSM
%EQUATE `wlan_notification_msm_start = %L2_NOTIFICATION_CODE_PUBLIC_BEGIN
%EQUATE `wlan_notification_msm_associating = %wlan_notification_msm_start + 1
%EQUATE `wlan_notification_msm_associated = %wlan_notification_msm_associating + 1
%EQUATE `wlan_notification_msm_authenticating = %wlan_notification_msm_associated + 1
%EQUATE `wlan_notification_msm_connected = %wlan_notification_msm_authenticating + 1
%EQUATE `wlan_notification_msm_roaming_start = %wlan_notification_msm_connected + 1
%EQUATE `wlan_notification_msm_roaming_end = %wlan_notification_msm_roaming_start + 1
%EQUATE `wlan_notification_msm_radio_state_change = %wlan_notification_msm_roaming_end + 1
%EQUATE `wlan_notification_msm_signal_quality_change = %wlan_notification_msm_radio_state_change + 1
%EQUATE `wlan_notification_msm_disassociating = %wlan_notification_msm_signal_quality_change + 1
%EQUATE `wlan_notification_msm_disconnected = %wlan_notification_msm_disassociating + 1
%EQUATE `wlan_notification_msm_peer_join = %wlan_notification_msm_disconnected + 1
%EQUATE `wlan_notification_msm_peer_leave = %wlan_notification_msm_peer_join + 1
%EQUATE `wlan_notification_msm_adapter_removal = %wlan_notification_msm_peer_leave + 1
%EQUATE `wlan_notification_msm_adapter_operation_mode_change = %wlan_notification_msm_adapter_removal + 1
%EQUATE `wlan_notification_msm_end = %wlan_notification_msm_adapter_operation_mode_change + 1
' enum WLAN_NOTIFICATION_SECURITY
%EQUATE `wlan_notification_security_start = %L2_NOTIFICATION_CODE_PUBLIC_BEGIN
%EQUATE `wlan_notification_security_end = %wlan_notification_security_start + 1
'typedef L2_NOTIFICATION_DATA WLAN_NOTIFICATION_DATA, *PWLAN_NOTIFICATION_DATA;
MACRO WLAN_NOTIFICATION_DATA = L2_NOTIFICATION_DATA
'// the callback function for notifications
'typedef VOID (WINAPI *WLAN_NOTIFICATION_CALLBACK) (PWLAN_NOTIFICATION_DATA, PVOID);
'SUB WLAN_NOTIFICATION_CALLBACK (BYREF WLAN_NOTIFICATION_DATA, BYVAL DWORD)
' enum WLAN_OPCODE_VALUE_TYPE
%EQUATE `wlan_opcode_value_type_query_only = 0
%EQUATE `wlan_opcode_value_type_set_by_group_policy = 1
%EQUATE `wlan_opcode_value_type_set_by_user = 2
%EQUATE `wlan_opcode_value_type_invalid = 3
'// OpCodes for set/query interfaces
' enum WLAN_INTF_OPCODE
%EQUATE `wlan_intf_opcode_autoconf_start = &H000000000
%EQUATE `wlan_intf_opcode_autoconf_enabled = %wlan_intf_opcode_autoconf_start + 1
%EQUATE `wlan_intf_opcode_background_scan_enabled = %wlan_intf_opcode_autoconf_enabled + 1
%EQUATE `wlan_intf_opcode_media_streaming_mode = %wlan_intf_opcode_background_scan_enabled + 1
%EQUATE `wlan_intf_opcode_radio_state = %wlan_intf_opcode_media_streaming_mode + 1
%EQUATE `wlan_intf_opcode_bss_type = %wlan_intf_opcode_radio_state + 1
%EQUATE `wlan_intf_opcode_interface_state = %wlan_intf_opcode_bss_type + 1
%EQUATE `wlan_intf_opcode_current_connection = %wlan_intf_opcode_interface_state + 1
%EQUATE `wlan_intf_opcode_channel_number = %wlan_intf_opcode_current_connection + 1
%EQUATE `wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs = %wlan_intf_opcode_channel_number + 1
%EQUATE `wlan_intf_opcode_supported_adhoc_auth_cipher_pairs = %wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs + 1
%EQUATE `wlan_intf_opcode_supported_country_or_region_string_list = %wlan_intf_opcode_supported_adhoc_auth_cipher_pairs + 1
%EQUATE `wlan_intf_opcode_current_operation_mode = %wlan_intf_opcode_supported_country_or_region_string_list + 1
%EQUATE `wlan_intf_opcode_supported_safe_mode = %wlan_intf_opcode_current_operation_mode + 1
%EQUATE `wlan_intf_opcode_certified_safe_mode = %wlan_intf_opcode_supported_safe_mode + 1
%EQUATE `wlan_intf_opcode_hosted_network_capable = %wlan_intf_opcode_certified_safe_mode + 1
%EQUATE `wlan_intf_opcode_autoconf_end = &H0fffffff
%EQUATE `wlan_intf_opcode_msm_start = &H10000100
%EQUATE `wlan_intf_opcode_statistics = %wlan_intf_opcode_msm_start + 1
%EQUATE `wlan_intf_opcode_rssi = %wlan_intf_opcode_statistics + 1
%EQUATE `wlan_intf_opcode_msm_end = &H1fffffff
%EQUATE `wlan_intf_opcode_security_start = &H20010000
%EQUATE `wlan_intf_opcode_security_end = &H2fffffff
%EQUATE `wlan_intf_opcode_ihv_start = &H30000000
%EQUATE `wlan_intf_opcode_ihv_end = &H3fffffff
'// OpCodes for set/query auto config parameters
' enum WLAN_AUTOCONF_OPCODE
%EQUATE `wlan_autoconf_opcode_start = 0
%EQUATE `wlan_autoconf_opcode_show_denied_networks = 1
%EQUATE `wlan_autoconf_opcode_power_setting = 2
%EQUATE `wlan_autoconf_opcode_only_use_gp_profiles_for_allowed_networks = 3
%EQUATE `wlan_autoconf_opcode_allow_explicit_creds = 4
%EQUATE `wlan_autoconf_opcode_block_period = 5
%EQUATE `wlan_autoconf_opcode_allow_virtual_station_extensibility = 6
%EQUATE `wlan_autoconf_opcode_end = 7
'// IHV control types
' enum WLAN_IHV_CONTROL_TYPE
%EQUATE `wlan_ihv_control_type_service = 0
%EQUATE `wlan_ihv_control_type_driver = 1
' enum _WLAN_FILTER_LIST_TYPE
%EQUATE `wlan_filter_list_type_gp_permit = 0
%EQUATE `wlan_filter_list_type_gp_deny = 1
%EQUATE `wlan_filter_list_type_user_permit = 2
%EQUATE `wlan_filter_list_type_user_deny = 3
'// Driver statistics
' // Size = 144 bytes
TYPE WLAN_PHY_FRAME_STATISTICS QWORD
 ' // TX counters (MSDU/MMPDU)
 ullTransmittedFrameCount AS QUAD ' ULONGLONG
 ullMulticastTransmittedFrameCount AS QUAD ' ULONGLONG
 ullFailedCount AS QUAD ' ULONGLONG
 ullRetryCount AS QUAD ' ULONGLONG
 ullMultipleRetryCount AS QUAD ' ULONGLONG
 ullMaxTXLifetimeExceededCount AS QUAD ' ULONGLONG
 ' // TX counters (MPDU)
 ullTransmittedFragmentCount AS QUAD ' ULONGLONG
 ullRTSSuccessCount AS QUAD ' ULONGLONG
 ullRTSFailureCount AS QUAD ' ULONGLONG
 ullACKFailureCount AS QUAD ' ULONGLONG
 ' // RX counters (MSDU/MMPDU)
 ullReceivedFrameCount AS QUAD ' ULONGLONG
 ullMulticastReceivedFrameCount AS QUAD ' ULONGLONG
 ullPromiscuousReceivedFrameCount AS QUAD ' ULONGLONG
 ullMaxRXLifetimeExceededCount AS QUAD ' ULONGLONG
 ' // RX counters (MPDU)
 ullFrameDuplicateCount AS QUAD ' ULONGLONG
 ullReceivedFragmentCount AS QUAD ' ULONGLONG
 ullPromiscuousReceivedFragmentCount AS QUAD ' ULONGLONG
 ullFCSErrorCount AS QUAD ' ULONGLONG
END TYPE
' // Size = 96 bytes
TYPE WLAN_MAC_FRAME_STATISTICS QWORD
 ullTransmittedFrameCount AS QUAD ' ULONGLONG
 ullReceivedFrameCount AS QUAD ' ULONGLONG
 ullWEPExcludedCount AS QUAD ' ULONGLONG
 ullTKIPLocalMICFailures AS QUAD ' ULONGLONG
 ullTKIPReplays AS QUAD ' ULONGLONG
 ullTKIPICVErrorCount AS QUAD ' ULONGLONG
 ullCCMPReplays AS QUAD ' ULONGLONG
 ullCCMPDecryptErrors AS QUAD ' ULONGLONG
 ullWEPUndecryptableCount AS QUAD ' ULONGLONG
 ullWEPICVErrorCount AS QUAD ' ULONGLONG
 ullDecryptSuccessCount AS QUAD ' ULONGLONG
 ullDecryptFailureCount AS QUAD ' ULONGLONG
END TYPE
' // Size = 368 bytes
TYPE WLAN_STATISTICS QWORD
 ullFourWayHandshakeFailures AS QUAD ' ULONGLONG
 ullTKIPCounterMeasuresInvoked AS QUAD ' ULONGLONG
 ullReserved AS QUAD ' ULONGLONG
 MacUcastCounters AS WLAN_MAC_FRAME_STATISTICS
 MacMcastCounters AS WLAN_MAC_FRAME_STATISTICS
 dwNumberOfPhys AS DWORD
 PhyCounters(0) AS WLAN_PHY_FRAME_STATISTICS
END TYPE
'// API protection settings
'// Definition of access masks for setting non-default security
'// settings on WLAN configuration objects and connection profiles.
%EQUATE `WLAN_READ_ACCESS = %STANDARD_RIGHTS_READ OR %FILE_READ_DATA
%EQUATE `WLAN_EXECUTE_ACCESS = %WLAN_READ_ACCESS OR %STANDARD_RIGHTS_EXECUTE OR %FILE_EXECUTE
%EQUATE `WLAN_WRITE_ACCESS = %WLAN_READ_ACCESS OR %WLAN_EXECUTE_ACCESS OR %STANDARD_RIGHTS_WRITE OR %FILE_WRITE_DATA OR %DELETE OR %WRITE_DAC
' enum WLAN_SECURABLE_OBJECT
%EQUATE `wlan_secure_permit_list = 0
%EQUATE `wlan_secure_deny_list = 1
%EQUATE `wlan_secure_ac_enabled = 2
%EQUATE `wlan_secure_bc_scan_enabled = 3
%EQUATE `wlan_secure_bss_type = 4
%EQUATE `wlan_secure_show_denied = 5
%EQUATE `wlan_secure_interface_properties = 6
%EQUATE `wlan_secure_ihv_control = 7
%EQUATE `wlan_secure_all_user_profiles_order = 8
%EQUATE `wlan_secure_add_new_all_user_profiles = 9
%EQUATE `wlan_secure_add_new_per_user_profiles = 10
%EQUATE `wlan_secure_media_streaming_mode_enabled = 11
%EQUATE `wlan_secure_current_operation_mode = 12
%EQUATE `wlan_secure_get_plaintext_key = 13
%EQUATE `wlan_secure_hosted_network_elevated_access = 14
%EQUATE `wlan_secure_virtual_station_extensibility = 15
'// public APIs
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanOpenHandle LIB "WLanApi.dll" ALIAS "WlanOpenHandle" ( BYVAL dwClientVersion AS QUAD, pReserved AS ANY,
 pdwNegotiatedVersion AS QUAD , phClientHandle AS QUAD
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanOpenHandle LIB "wlanapi.dll" ALIAS "WlanOpenHandle" ( BYVAL dwClientVersion AS QUAD , BYVAL pReserved AS QUAD , BYREF pdwNegotiatedVersion AS QUAD , BYREF phClientHandle AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanCloseHandle LIB "WLanApi.dll" ALIAS "WlanCloseHandle" ( BYVAL hClientHandle AS QUAD,
 pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanCloseHandle LIB "wlanapi.dll" ALIAS "WlanCloseHandle" ( BYVAL hClientHandle AS QUAD , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanEnumInterfaces LIB "WLanApi.dll" ALIAS "WlanEnumInterfaces" ( BYVAL hClientHandle AS QUAD,
 pReserved AS ANY,
 ppInterfaceList AS ANY ' PWLAN_INTERFACE_INFO_LIST * ) AS QUAD
#ELSE
DECLARE FUNCTION WlanEnumInterfaces LIB "wlanapi.dll" ALIAS "WlanEnumInterfaces" ( BYVAL hClientHandle AS QUAD , BYVAL pReserved AS QUAD , BYREF ppInterfaceList AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetAutoConfigParameter LIB "WLanApi.dll" ALIAS "WlanSetAutoConfigParameter" ( BYVAL hClientHandle AS QUAD,
 BYVAL OpCode AS LONG, BYVAL dwDataSize AS QUAD, pData AS ANY,
 pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetAutoConfigParameter LIB "wlanapi.dll" ALIAS "WlanSetAutoConfigParameter" ( BYVAL hClientHandle AS QUAD , BYVAL OpCode AS LONG , BYVAL dwDataSize AS QUAD , BYREF pData AS ANY , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanQueryAutoConfigParameter LIB "WLanApi.dll" ALIAS "WlanQueryAutoConfigParameter" ( BYVAL hClientHandle AS QUAD,
 BYVAL OpCode AS LONG, pReserved AS ANY,
 pdwDataSize AS QUAD, ppData AS ANY, ' PVOID *
 pWlanOpcodeValueType AS LONG ) AS DWORD
#ELSE
DECLARE FUNCTION WlanQueryAutoConfigParameter LIB "wlanapi.dll" ALIAS "WlanQueryAutoConfigParameter" ( BYVAL hClientHandle AS QUAD , BYVAL OpCode AS LONG , BYVAL pReserved AS QUAD , BYREF pdwDataSize AS QUAD , BYREF ppData AS ANY , BYREF pWlanOpcodeValueType AS LONG ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetInterfaceCapability LIB "WLanApi.dll" ALIAS "WlanGetInterfaceCapability" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, pReserved AS ANY,
 ppCapability AS ANY ' PWLAN_INTERFACE_CAPABILITY * ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetInterfaceCapability LIB "wlanapi.dll" ALIAS "WlanGetInterfaceCapability" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL pReserved AS QUAD , BYREF ppCapability AS WLAN_INTERFACE_CAPABILITY ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetInterface LIB "WLanApi.dll" ALIAS "WlanSetInterface" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, BYVAL OpCode AS LONG, BYVAL dwDataSize AS QUAD, pData AS ANY,
 pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetInterface LIB "wlanapi.dll" ALIAS "WlanSetInterface" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL OpCode AS QUAD , BYVAL dwDataSize AS QUAD , BYREF pData AS ANY , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanQueryInterface LIB "WLanApi.dll" ALIAS "WlanQueryInterface" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, BYVAL OpCode AS LONG, pReserved AS ANY,
 pdwDataSize AS QUAD, ppData AS ANY, ' PVOID *
 pWlanOpcodeValueType AS LONG ) AS DWORD
#ELSE
DECLARE FUNCTION WlanQueryInterface LIB "wlanapi.dll" ALIAS "WlanQueryInterface" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL OpCode AS QUAD , BYVAL pReserved AS QUAD , BYREF pdwDataSize AS QUAD , BYREF ppData AS ANY , BYREF pWlanOpcodeValueType AS LONG ) AS QUAD
#ENDIF
DECLARE FUNCTION WlanIhvControl LIB "wlanapi.dll" ALIAS "WlanIhvControl" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL Type AS LONG , BYVAL dwInBufferSize AS QUAD , BYREF pInBuffer AS ANY , BYVAL dwOutBufferSize AS QUAD , BYREF pOutBuffer AS ANY , BYREF pdwBytesReturned AS QUAD ) AS QUAD
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanScan LIB "WLanApi.dll" ALIAS "WlanScan" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, pDot11Ssid AS DOT11_SSID, pIeData AS WLAN_RAW_DATA, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanScan LIB "wlanapi.dll" ALIAS "WlanScan" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF pDot11Ssid AS DOT11_SSID , BYREF pIeData AS WLAN_RAW_DATA , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetAvailableNetworkList LIB "WLanApi.dll" ALIAS "WlanGetAvailableNetworkList" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, BYVAL dwFlags AS QUAD , pReserved AS ANY,
 ppAvailableNetworkList AS ANY ' PWLAN_AVAILABLE_NETWORK_LIST * ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetAvailableNetworkList LIB "wlanapi.dll" ALIAS "WlanGetAvailableNetworkList" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL dwFlags AS QUAD , BYVAL pReserved AS QUAD , BYREF ppAvailableNetworkList AS WLAN_AVAILABLE_NETWORK_LIST ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetNetworkBssList LIB "WLanApi.dll" ALIAS "WlanGetNetworkBssList" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, pDot11Ssid AS DOT11_SSID, BYVAL dot11BssType AS LONG, BYVAL bSecurityEnabled AS LONG,
 pReserved AS ANY,
 ppWlanBssList AS ANY ' PWLAN_BSS_LIST * ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetNetworkBssList LIB "wlanapi.dll" ALIAS "WlanGetNetworkBssList" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF pDot11Ssid AS DOT11_SSID , BYVAL dot11BssType AS LONG , BYVAL bSecurityEnabled AS LONG , BYVAL pReserved AS QUAD , BYREF ppWlanBssList AS WLAN_BSS_LIST ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanConnect LIB "WLanApi.dll" ALIAS "WlanConnect" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, pConnectionParameters AS WLAN_CONNECTION_PARAMETERS, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanConnect LIB "wlanapi.dll" ALIAS "WlanConnect" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF pConnectionParameters AS WLAN_CONNECTION_PARAMETERS , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanDisconnect LIB "WLanApi.dll" ALIAS "WlanDisconnect" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanDisconnect LIB "wlanapi.dll" ALIAS "WlanDisconnect" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanRegisterNotification LIB "WLanApi.dll" ALIAS "WlanRegisterNotification" ( BYVAL hClientHandle AS QUAD,
 BYVAL dwNotifSource AS QUAD, BYVAL bIgnoreDuplicate AS LONG,
 BYVAL funcCallback AS QUAD, ' WLAN_NOTIFICATION_CALLBACK
 pCallbackContext AS ANY,
 pReserved AS ANY,
 pdwPrevNotifSource AS DWORD ) AS DWORD
#ELSE
DECLARE FUNCTION WlanRegisterNotification LIB "wlanapi.dll" ALIAS "WlanRegisterNotification" ( BYVAL hClientHandle AS QUAD , BYVAL dwNotifSource AS QUAD , BYVAL bIgnoreDuplicate AS LONG , BYVAL funcCallback AS QUAD , BYVAL pCallbackContext AS QUAD , BYVAL pReserved AS QUAD , BYREF pdwPrevNotifSource AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetProfile LIB "WLanApi.dll" ALIAS "WlanGetProfile" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, pReserved AS ANY,
 pstrProfileXml AS ANY,
 pdwFlags AS QUAD, pdwGrantedAccess AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetProfile LIB "wlanapi.dll" ALIAS "WlanGetProfile" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL pReserved AS QUAD , BYREF pstrProfileXml AS QUAD , BYREF pdwFlags AS QUAD , BYREF pdwGrantedAccess AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetProfileEapUserData LIB "WLanApi.dll" ALIAS "WlanSetProfileEapUserData" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, BYVAL eapType AS EAP_METHOD_TYPE, BYVAL dwFlags AS QUAD, BYVAL dwEapUserDataSize AS QUAD, BYVAL pbEapUserData AS BYTE PTR, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetProfileEapUserData LIB "wlanapi.dll" ALIAS "WlanSetProfileEapUserData" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL eapType AS EAP_METHOD_TYPE , BYVAL dwFlags AS QUAD , BYVAL dwEapUserDataSize AS QUAD , BYVAL pbEapUserData AS BYTE PTR , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetProfileEapXmlUserData LIB "WLanApi.dll" ALIAS "WlanSetProfileEapXmlUserData" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, BYVAL dwFlags AS QUAD, strEapXmlUserData AS WSTRINGZ, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetProfileEapXmlUserData LIB "wlanapi.dll" ALIAS "WlanSetProfileEapXmlUserData" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL dwFlags AS QUAD , BYREF strEapXmlUserData AS WSTRINGZ , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetProfile LIB "WLanApi.dll" ALIAS "WlanSetProfile" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, BYVAL dwFlags AS QUAD, strProfileXml AS WSTRINGZ, strAllUserProfileSecurity AS WSTRINGZ, BYVAL bOverwrite AS LONG,
 pReserved AS ANY,
 pdwReasonCode AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetProfile LIB "wlanapi.dll" ALIAS "WlanSetProfile" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL dwFlags AS QUAD , BYREF strProfileXml AS WSTRINGZ , BYREF strAllUserProfileSecurity AS WSTRINGZ , BYVAL bOverwrite AS LONG , BYVAL pReserved AS QUAD , BYREF pdwReasonCode AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanDeleteProfile LIB "WLanApi.dll" ALIAS "WlanDeleteProfile" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, pReserved AS ANY
) AS QUAD
#ELSE
DECLARE FUNCTION WlanDeleteProfile LIB "wlanapi.dll" ALIAS "WlanDeleteProfile" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanRenameProfile LIB "WLanApi.dll" ALIAS "WlanRenameProfile" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strOldProfileName AS WSTRINGZ, strNewProfileName AS WSTRINGZ, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanRenameProfile LIB "wlanapi.dll" ALIAS "WlanRenameProfile" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strOldProfileName AS WSTRINGZ , BYREF strNewProfileName AS WSTRINGZ , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetProfileList LIB "WLanApi.dll" ALIAS "WlanGetProfileList" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, pReserved AS ANY,
 BYVAL ppProfileList AS WLAN_PROFILE_INFO_LIST PTR ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetProfileList LIB "wlanapi.dll" ALIAS "WlanGetProfileList" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL pReserved AS QUAD , BYREF ppProfileList AS WLAN_PROFILE_INFO_LIST ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetProfileList LIB "WLanApi.dll" ALIAS "WlanSetProfileList" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, BYVAL dwItems AS QUAD, strProfileNames AS ANY, ' LPCWSTR *
 pReserved AS ANY
 ) AS DWORD
#ELSE
DECLARE FUNCTION WlanSetProfileList LIB "wlanapi.dll" ALIAS "WlanSetProfileList" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYVAL dwItems AS QUAD , BYREF strProfileNames AS WSTRINGZ , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetProfilePosition LIB "WLanApi.dll" ALIAS "WlanSetProfilePosition" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, BYVAL dwPosition AS QUAD, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetProfilePosition LIB "wlanapi.dll" ALIAS "WlanSetProfilePosition" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL dwPosition AS QUAD , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetProfileCustomUserData LIB "WLanApi.dll" ALIAS "WlanSetProfileCustomUserData" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, BYVAL dwDataSize AS QUAD, BYVAL pData AS BYTE PTR, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetProfileCustomUserData LIB "wlanapi.dll" ALIAS "WlanSetProfileCustomUserData" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL dwDataSize AS QUAD , BYVAL pData AS BYTE PTR , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetProfileCustomUserData LIB "WLanApi.dll" ALIAS "WlanGetProfileCustomUserData" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, pReserved AS ANY,
 pdwDataSize AS QUAD, ppData AS ANY ' PBYTE * ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetProfileCustomUserData LIB "wlanapi.dll" ALIAS "WlanGetProfileCustomUserData" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYVAL pReserved AS QUAD , BYREF pdwDataSize AS QUAD , BYREF ppData AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetFilterList LIB "WLanApi.dll" ALIAS "WlanSetFilterList" ( BYVAL hClientHandle AS QUAD,
 BYVAL wlanFilterListType AS LONG, BYVAL pNetworkList AS DOT11_NETWORK_LIST PTR, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetFilterList LIB "wlanapi.dll" ALIAS "WlanSetFilterList" ( BYVAL hClientHandle AS QUAD , BYVAL wlanFilterListType AS LONG , BYREF pNetworkList AS DOT11_NETWORK_LIST , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetFilterList LIB "WLanApi.dll" ALIAS "WlanGetFilterList" ( BYVAL hClientHandle AS QUAD,
 BYVAL wlanFilterListType AS LONG, pReserved AS ANY,
 ppNetworkList AS ANY ' PDOT11_NETWORK_LIST * ) AS QUAD
#ELSE
DECLARE FUNCTION WlanGetFilterList LIB "wlanapi.dll" ALIAS "WlanGetFilterList" ( BYVAL hClientHandle AS QUAD , BYVAL wlanFilterListType AS LONG , BYVAL pReserved AS QUAD , BYREF ppNetworkList AS DOT11_NETWORK_LIST ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSetPsdIEDataList LIB "WLanApi.dll" ALIAS "WlanSetPsdIEDataList" ( BYVAL hClientHandle AS QUAD,
 strFormat AS WSTRINGZ, BYVAL pPsdIEDataList AS WLAN_RAW_DATA_LIST PTR, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSetPsdIEDataList LIB "wlanapi.dll" ALIAS "WlanSetPsdIEDataList" ( BYVAL hClientHandle AS QUAD , BYREF strFormat AS WSTRINGZ , BYREF pPsdIEDataList AS WLAN_RAW_DATA_LIST , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanSaveTemporaryProfile LIB "WLanApi.dll" ALIAS "WlanSaveTemporaryProfile" ( BYVAL hClientHandle AS QUAD,
 pInterfaceGuid AS GUID, strProfileName AS WSTRINGZ, strAllUserProfileSecurity AS WSTRINGZ, BYVAL dwFlags AS QUAD, BYVAL bOverWrite AS LONG,
 pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanSaveTemporaryProfile LIB "wlanapi.dll" ALIAS "WlanSaveTemporaryProfile" ( BYVAL hClientHandle AS QUAD , BYREF pInterfaceGuid AS GUID , BYREF strProfileName AS WSTRINGZ , BYREF strAllUserProfileSecurity AS WSTRINGZ , BYVAL dwFlags AS QUAD , BYVAL bOverWrite AS LONG , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
'// client side APIs
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanExtractPsdIEDataList LIB "WLanApi.dll" ALIAS "WlanExtractPsdIEDataList" ( BYVAL hClientHandle AS QUAD, ' HANDLE,
 BYVAL dwIeDataSize AS DWORD, BYVAL pRawIeData AS BYTE PTR, strFormat AS WSTRINGZ, pReserved AS ANY, ' PVOID,
 ppPsdIEDataList AS ANY ' PWLAN_RAW_DATA_LIST *
 ) AS DWORD
#ELSE
DECLARE FUNCTION WlanExtractPsdIEDataList LIB "wlanapi.dll" ALIAS "WlanExtractPsdIEDataList" ( BYVAL hClientHandle AS QUAD , BYVAL dwIeDataSize AS QUAD , BYVAL pRawIeData AS BYTE PTR , BYREF strFormat AS WSTRINGZ , BYVAL pReserved AS QUAD , BYREF ppPsdIEDataList AS WLAN_RAW_DATA_LIST ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanReasonCodeToString LIB "WLanApi.dll" ALIAS "WlanReasonCodeToString" ( BYVAL dwReasonCode AS QUAD, BYVAL dwBufferSize AS QUAD, pStringBuffer AS WSTRINGZ, pReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanReasonCodeToString LIB "wlanapi.dll" ALIAS "WlanReasonCodeToString" ( BYVAL dwReasonCode AS QUAD , BYVAL dwBufferSize AS QUAD , BYREF pStringBuffer AS WSTRINGZ , BYVAL pReserved AS QUAD ) AS QUAD
#ENDIF
DECLARE FUNCTION WlanAllocateMemory LIB "wlanapi.dll" ALIAS "WlanAllocateMemory" ( BYVAL dwMemorySize AS QUAD ) AS QUAD
#IF %DEF(%USEPBDECL)
DECLARE SUB WlanFreeMemory LIB "WLanApi.dll" ALIAS "WlanFreeMemory" ( pMemory AS ANY
 )
#ELSE
DECLARE SUB WlanFreeMemory LIB "wlanapi.dll" ALIAS "WlanFreeMemory" ( BYVAL pMemory AS QUAD )
#ENDIF
DECLARE FUNCTION WlanSetSecuritySettings LIB "wlanapi.dll" ALIAS "WlanSetSecuritySettings" ( BYVAL hClientHandle AS QUAD , BYVAL SecurableObject AS LONG , BYREF strModifiedSDDL AS WSTRINGZ ) AS QUAD
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanGetSecuritySettings LIB "WLanApi.dll" ALIAS "WlanGetSecuritySettings" ( BYVAL hClientHandle AS QUAD,
 BYVAL SecurableObject AS LONG, pValueType AS LONG, pstrCurrentSDDL AS ANY, ' LPWSTR*,
 pdwGrantedAccess AS DWORD ) AS DWORD
#ELSE
DECLARE FUNCTION WlanGetSecuritySettings LIB "wlanapi.dll" ALIAS "WlanGetSecuritySettings" ( BYVAL hClientHandle AS QUAD , BYVAL SecurableObject AS LONG , BYREF pValueType AS LONG , BYREF pstrCurrentSDDL AS QUAD , BYREF pdwGrantedAccess AS QUAD ) AS QUAD
#ENDIF
'// the following structures and defs are
'// for the UI related functions
'// current version
%EQUATE `WLAN_UI_API_VERSION = 1
'// earliest version supported
%EQUATE `WLAN_UI_API_INITIAL_VERSION = 1
'// The list of pages displayed by the wireless profile UI
' enum WL_DISPLAY_PAGES
%EQUATE `WLConnectionPage = 0
%EQUATE `WLSecurityPage = 1
%EQUATE `WLAdvPage = 2
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanUIEditProfile LIB "WLanUI.dll" ALIAS "WlanUIEditProfile" ( BYVAL dwClientVersion AS QUAD, wstrProfileName AS WSTRINGZ, pInterfaceGuid AS GUID, BYVAL hWnd AS QUAD,
 BYVAL wlStartPage AS LONG, pReserved AS ANY,
 pWlanReasonCode AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION WlanUIEditProfile LIB "wlanapi.dll" ALIAS "WlanUIEditProfile" ( BYVAL dwClientVersion AS QUAD , BYREF wstrProfileName AS WSTRINGZ , BYREF pInterfaceGuid AS GUID , BYVAL hWnd AS QUAD , BYVAL wlStartPage AS LONG , BYVAL pReserved AS QUAD , BYREF pWlanReasonCode AS QUAD ) AS QUAD
#ENDIF
'#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
'// Hosted Network APIs
' enum WLAN_HOSTED_NETWORK_STATE
%EQUATE `wlan_hosted_network_unavailable = 0
%EQUATE `wlan_hosted_network_idle = 1
%EQUATE `wlan_hosted_network_active = 2
' enum _WLAN_HOSTED_NETWORK_REASON
%EQUATE `wlan_hosted_network_reason_success = 0
%EQUATE `wlan_hosted_network_reason_unspecified = 1
%EQUATE `wlan_hosted_network_reason_bad_parameters = 2
%EQUATE `wlan_hosted_network_reason_service_shutting_down = 3
%EQUATE `wlan_hosted_network_reason_insufficient_resources = 4
%EQUATE `wlan_hosted_network_reason_elevation_required = 5
%EQUATE `wlan_hosted_network_reason_read_only = 6
%EQUATE `wlan_hosted_network_reason_persistence_failed = 7
%EQUATE `wlan_hosted_network_reason_crypt_error = 8
%EQUATE `wlan_hosted_network_reason_impersonation = 9
%EQUATE `wlan_hosted_network_reason_stop_before_start = 10
%EQUATE `wlan_hosted_network_reason_interface_available = 11
%EQUATE `wlan_hosted_network_reason_interface_unavailable = 12
%EQUATE `wlan_hosted_network_reason_miniport_stopped = 13
%EQUATE `wlan_hosted_network_reason_miniport_started = 14
%EQUATE `wlan_hosted_network_reason_incompatible_connection_started = 15
%EQUATE `wlan_hosted_network_reason_incompatible_connection_stopped = 16
%EQUATE `wlan_hosted_network_reason_user_action = 17
%EQUATE `wlan_hosted_network_reason_client_abort = 18
%EQUATE `wlan_hosted_network_reason_ap_start_failed = 19
%EQUATE `wlan_hosted_network_reason_peer_arrived = 20
%EQUATE `wlan_hosted_network_reason_peer_departed = 21
%EQUATE `wlan_hosted_network_reason_peer_timeout = 22
%EQUATE `wlan_hosted_network_reason_gp_denied = 23
%EQUATE `wlan_hosted_network_reason_service_unavailable = 24
%EQUATE `wlan_hosted_network_reason_device_change = 25
%EQUATE `wlan_hosted_network_reason_properties_change = 26
%EQUATE `wlan_hosted_network_reason_virtual_station_blocking_use = 27
%EQUATE `wlan_hosted_network_reason_service_available_on_virtual_station = 28
' enum _WLAN_HOSTED_NETWORK_PEER_AUTH_STATE
%EQUATE `wlan_hosted_network_peer_state_invalid = 0
%EQUATE `wlan_hosted_network_peer_state_authenticated = 1
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkStartUsing LIB "WLanApi.dll" ALIAS "WlanHostedNetworkStartUsing" ( BYVAL hClientHandle AS QUAD,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkStartUsing LIB "wlanapi.dll" ALIAS "WlanHostedNetworkStartUsing" ( BYVAL hClientHandle AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkStopUsing LIB "WLanApi.dll" ALIAS "WlanHostedNetworkStopUsing" ( BYVAL hClientHandle AS QUAD,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkStopUsing LIB "wlanapi.dll" ALIAS "WlanHostedNetworkStopUsing" ( BYVAL hClientHandle AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkForceStart LIB "WLanApi.dll" ALIAS "WlanHostedNetworkForceStart" ( BYVAL hClientHandle AS QUAD,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkForceStart LIB "wlanapi.dll" ALIAS "WlanHostedNetworkForceStart" ( BYVAL hClientHandle AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkForceStop LIB "WLanApi.dll" ALIAS "WlanHostedNetworkForceStop" ( BYVAL hClientHandle AS QUAD,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkForceStop LIB "wlanapi.dll" ALIAS "WlanHostedNetworkForceStop" ( BYVAL hClientHandle AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
' // Size = 12 bytes
TYPE WLAN_HOSTED_NETWORK_PEER_STATE DWORD FILL
 PeerMacAddress AS DOT11_MAC_ADDRESS
 PeerAuthState AS LONG ' WLAN_HOSTED_NETWORK_PEER_AUTH_STATE
END TYPE
' // Size = 8 bytes
TYPE WLAN_HOSTED_NETWORK_RADIO_STATE DWORD
 dot11SoftwareRadioState AS LONG ' DOT11_RADIO_STATE
 dot11HardwareRadioState AS LONG ' DOT11_RADIO_STATE
END TYPE
'// Definitions required for calling WlanRegisterNotification
'// Notification source - L2_NOTIFICATION_SOURCE_WLAN_HNWK
'// Notification code
' enum _WLAN_HOSTED_NETWORK_NOTIFICATION_CODE
%EQUATE `wlan_hosted_network_state_change = %L2_NOTIFICATION_CODE_V2_BEGIN
%EQUATE `wlan_hosted_network_peer_state_change = %wlan_hosted_network_state_change + 1
%EQUATE `wlan_hosted_network_radio_state_change = %wlan_hosted_network_peer_state_change + 1
'// Notification data associated with wlan_hosted_network_state_change
' // Size = 12 bytes
TYPE WLAN_HOSTED_NETWORK_STATE_CHANGE DWORD
 OldState AS LONG ' WLAN_HOSTED_NETWORK_STATE
 NewState AS LONG ' WLAN_HOSTED_NETWORK_STATE
 StateChangeReason AS LONG ' WLAN_HOSTED_NETWORK_REASON
END TYPE
'// Notification data associated with wlan_hosted_network_peer_state_change
' // Size = 28 bytes
TYPE WLAN_HOSTED_NETWORK_DATA_PEER_STATE_CHANGE DWORD
 OldState AS WLAN_HOSTED_NETWORK_PEER_STATE
 NewState AS WLAN_HOSTED_NETWORK_PEER_STATE
 PeerStateChangeReason AS LONG ' WLAN_HOSTED_NETWORK_REASON
END TYPE
'// Notification data associated with wlan_hosted_network_radio_state_change
'// WLAN_HOSTED_NETWORK_RADIO_STATE
'// Definitions required for calling WlanHostedNetworkQueryProperty and WlanHostedNetworkSetProperty
' enum WLAN_HOSTED_NETWORK_OPCODE
%EQUATE `wlan_hosted_network_opcode_connection_settings = 0
%EQUATE `wlan_hosted_network_opcode_security_settings = 1
%EQUATE `wlan_hosted_network_opcode_station_profile = 2
%EQUATE `wlan_hosted_network_opcode_enable = 3
'// Data structure associated with wlan_hosted_network_opcode_connection_settings
'// can be used for query and set
' // Size = 40 bytes
TYPE WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS DWORD
 hostedNetworkSSID AS DOT11_SSID
 dwMaxNumberOfPeers AS DWORD
END TYPE
'// Data structure associated with wlan_hosted_network_opcode_security_settings
'// can be used for query only
' // Size = 8 bytes
TYPE WLAN_HOSTED_NETWORK_SECURITY_SETTINGS DWORD
 dot11AuthAlgo AS LONG ' DOT11_AUTH_ALGORITHM
 dot11CipherAlgo AS LONG ' DOT11_CIPHER_ALGORITHM
END TYPE
'// Data structure associated with wlan_hosted_network_opcode_station_profile
'// can be used for query only
'// LPWSTR
'// Data structure associated with wlan_hosted_network_opcode_enable
'// can be used for query and set
'// BOOL
'//
'// This function queries the static properties of the hosted network
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkQueryProperty LIB "WLanApi.dll" ALIAS "WlanHostedNetworkQueryProperty" ( BYVAL hClientHandle AS QUAD,
 BYVAL OpCode AS LONG, pdwDataSize AS QUAD, ppvData AS ANY, ' PVOID*
 pWlanOpcodeValueType AS LONG, pvReserved AS ANY
 ) AS DWORD
#ELSE
DECLARE FUNCTION WlanHostedNetworkQueryProperty LIB "wlanapi.dll" ALIAS "WlanHostedNetworkQueryProperty" ( BYVAL hClientHandle AS QUAD , BYVAL OpCode AS LONG , BYREF pdwDataSize AS QUAD , BYREF ppvData AS ANY , BYREF pWlanOpcodeValueType AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
'//
'// This function sets the static properties of the hosted network
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkSetProperty LIB "WLanApi.dll" ALIAS "WlanHostedNetworkSetProperty" ( BYVAL hClientHandle AS QUAD,
 BYVAL OpCode AS LONG, BYVAL dwDataSize AS QUAD, pvData AS ANY,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkSetProperty LIB "wlanapi.dll" ALIAS "WlanHostedNetworkSetProperty" ( BYVAL hClientHandle AS QUAD , BYVAL OpCode AS LONG , BYVAL dwDataSize AS QUAD , BYVAL pvData AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
'//
'// This function initializes hosted network configuration
'// on a machine. There are no effects if an initial
'// configuration has already been created.
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkInitSettings LIB "WLanApi.dll" ALIAS "WlanHostedNetworkInitSettings" ( BYVAL hClientHandle AS QUAD,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkInitSettings LIB "wlanapi.dll" ALIAS "WlanHostedNetworkInitSettings" ( BYVAL hClientHandle AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkRefreshSecuritySettings LIB "WLanApi.dll" ALIAS "WlanHostedNetworkRefreshSecuritySettings" ( BYVAL hClientHandle AS QUAD,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkRefreshSecuritySettings LIB "wlanapi.dll" ALIAS "WlanHostedNetworkRefreshSecuritySettings" ( BYVAL hClientHandle AS QUAD , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
' // Size = 52 bytes
TYPE WLAN_HOSTED_NETWORK_STATUS DWORD
 HostedNetworkState AS LONG ' WLAN_HOSTED_NETWORK_STATE
 IPDeviceID AS GUID ' GUID
 wlanHostedNetworkBSSID AS DOT11_MAC_ADDRESS ' DOT11_MAC_ADDRESS
 dot11PhyType AS LONG ' DOT11_PHY_TYPE
 ulChannelFrequency AS DWORD ' ULONG
 dwNumberOfPeers AS DWORD
 PeerList(0) AS WLAN_HOSTED_NETWORK_PEER_STATE ' WLAN_HOSTED_NETWORK_PEER_STATE[1]
END TYPE
'//
'// This function queries the runtime status of the hosted network
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkQueryStatus LIB "WLanApi.dll" ALIAS "WlanHostedNetworkQueryStatus" ( BYVAL hClientHandle AS QUAD,
 ppWlanHostedNetworkStatus AS ANY, ' PWLAN_HOSTED_NETWORK_STATUS*
 pvReserved AS ANY
 ) AS DWORD
#ELSE
DECLARE FUNCTION WlanHostedNetworkQueryStatus LIB "wlanapi.dll" ALIAS "WlanHostedNetworkQueryStatus" ( BYVAL hClientHandle AS QUAD , BYREF ppWlanHostedNetworkStatus AS WLAN_HOSTED_NETWORK_STATUS , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
'//
'// This function set the additional security key used by hosted network
'// if it is passphrase, key length includes the terminating '\0',
'// if not, key length is the number of bytes in the key data array.
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkSetSecondaryKey LIB "WLanApi.dll" ALIAS "WlanHostedNetworkSetSecondaryKey" ( BYVAL hClientHandle AS QUAD,
 BYVAL dwKeyLength AS QUAD, pucKeyData AS ANY,
 BYVAL bIsPassPhrase AS LONG,
 BYVAL bPersistent AS LONG,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION WlanHostedNetworkSetSecondaryKey LIB "wlanapi.dll" ALIAS "WlanHostedNetworkSetSecondaryKey" ( BYVAL hClientHandle AS QUAD , BYVAL dwKeyLength AS QUAD , BYVAL pucKeyData AS BYTE PTR , BYVAL bIsPassPhrase AS LONG , BYVAL bPersistent AS LONG , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
'//
'// This function query the additional security key used by hosted network
'// If it is passphrase, key length includes the terminating '\0',
'// if not, key length is the number of bytes in the key data array.
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanHostedNetworkQuerySecondaryKey LIB "WLanApi.dll" ALIAS "WlanHostedNetworkQuerySecondaryKey" ( BYVAL hClientHandle AS QUAD,
 pdwKeyLength AS QUAD,
 ppucKeyData AS ANY, ' PUCHAR*
 pbIsPassPhrase AS LONG,
 pbPersistent AS LONG,
 pFailReason AS LONG, pvReserved AS ANY
 ) AS DWORD
#ELSE
DECLARE FUNCTION WlanHostedNetworkQuerySecondaryKey LIB "wlanapi.dll" ALIAS "WlanHostedNetworkQuerySecondaryKey" ( BYVAL hClientHandle AS QUAD , BYREF pdwKeyLength AS QUAD , BYVAL pucKeyData AS BYTE PTR , BYVAL bIsPassPhrase AS LONG , BYVAL bPersistent AS LONG , BYREF pFailReason AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
'//
'// This function is used to register and unregister notifications on virtual station.
'//
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION WlanRegisterVirtualStationNotification LIB "WLanApi.dll" ALIAS "WlanRegisterVirtualStationNotification" ( BYVAL hClientHandle AS QUAD,
 BYVAL bRegister AS LONG,
 pReserved AS ANY
) AS QUAD
#ELSE
DECLARE FUNCTION WlanRegisterVirtualStationNotification LIB "wlanapi.dll" ALIAS "WlanRegisterVirtualStationNotification" ( BYVAL hClientHandle AS QUAD , BYVAL bRegister AS LONG , BYVAL pvReserved AS QUAD ) AS QUAD
#ENDIF
'#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#ENDIF
