1 #ifndef _WLANAPI_H 2 #define _WLANAPI_H 3 4 #include <l2cmn.h> 5 #include <windot11.h> 6 #include <eaptypes.h> 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 /* Defines */ 13 #define WLAN_API_VERSION_1_0 0x00000001 14 #define WLAN_API_VERSION_2_0 0x00000002 15 16 #define WLAN_MAX_PHY_INDEX 64 17 #define WLAN_MAX_NAME_LENGTH 256 18 19 /* Enumerations */ 20 21 #if defined(__midl) || defined(__WIDL__) 22 typedef [v1_enum] enum _WLAN_OPCODE_VALUE_TYPE { 23 #else 24 typedef enum _WLAN_OPCODE_VALUE_TYPE { 25 #endif 26 wlan_opcode_value_type_query_only = 0, 27 wlan_opcode_value_type_set_by_group_policy, 28 wlan_opcode_value_type_set_by_user, 29 wlan_opcode_value_type_invalid 30 } WLAN_OPCODE_VALUE_TYPE; /* HACK: WIDL is broken , *PWLAN_OPCODE_VALUE_TYPE; */ 31 32 typedef enum _WLAN_SECURABLE_OBJECT { 33 wlan_secure_permit_list = 0, 34 wlan_secure_deny_list, 35 wlan_secure_ac_enabled, 36 wlan_secure_bc_scan_enabled, 37 wlan_secure_bss_type, 38 wlan_secure_show_denied, 39 wlan_secure_interface_properties, 40 wlan_secure_ihv_control, 41 wlan_secure_all_user_profiles_order, 42 wlan_secure_add_new_all_user_profiles, 43 wlan_secure_add_new_per_user_profiles, 44 wlan_secure_media_streaming_mode_enabled, 45 wlan_secure_current_operation_mode, 46 WLAN_SECURABLE_OBJECT_COUNT 47 } WLAN_SECURABLE_OBJECT, *PWLAN_SECURABLE_OBJECT; 48 49 typedef enum _WLAN_CONNECTION_MODE { 50 wlan_connection_mode_profile = 0, 51 wlan_connection_mode_temporary_profile, 52 wlan_connection_mode_discovery_secure, 53 wlan_connection_mode_discovery_unsecure, 54 wlan_connection_mode_auto, 55 wlan_connection_mode_invalid 56 } WLAN_CONNECTION_MODE, *PWLAN_CONNECTION_MODE; 57 58 #if defined(__midl) || defined(__WIDL__) 59 typedef [v1_enum] enum _WLAN_IHV_CONTROL_TYPE { 60 #else 61 typedef enum _WLAN_IHV_CONTROL_TYPE { 62 #endif 63 wlan_ihv_control_type_service, 64 wlan_ihv_control_type_driver 65 } WLAN_IHV_CONTROL_TYPE; /* HACK , *PWLAN_IHV_CONTROL_TYPE; */ 66 67 #if defined(__midl) || defined(__WIDL__) 68 typedef [v1_enum] enum _WLAN_INTF_OPCODE { 69 #else 70 typedef enum _WLAN_INTF_OPCODE { 71 #endif 72 wlan_intf_opcode_autoconf_start = 0x000000000, 73 wlan_intf_opcode_autoconf_enabled, 74 wlan_intf_opcode_background_scan_enabled, 75 wlan_intf_opcode_media_streaming_mode, 76 wlan_intf_opcode_radio_state, 77 wlan_intf_opcode_bss_type, 78 wlan_intf_opcode_interface_state, 79 wlan_intf_opcode_current_connection, 80 wlan_intf_opcode_channel_number, 81 wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs, 82 wlan_intf_opcode_supported_adhoc_auth_cipher_pairs, 83 wlan_intf_opcode_supported_country_or_region_string_list, 84 wlan_intf_opcode_current_operation_mode, 85 wlan_intf_opcode_supported_safe_mode, 86 wlan_intf_opcode_certified_safe_mode, 87 wlan_intf_opcode_hosted_network_capable, 88 wlan_intf_opcode_management_frame_protection_capable, 89 wlan_intf_opcode_autoconf_end = 0x0fffffff, 90 wlan_intf_opcode_msm_start = 0x10000100, 91 wlan_intf_opcode_statistics, 92 wlan_intf_opcode_rssi, 93 wlan_intf_opcode_msm_end = 0x1fffffff, 94 wlan_intf_opcode_security_start = 0x20010000, 95 wlan_intf_opcode_security_end = 0x2fffffff, 96 wlan_intf_opcode_ihv_start = 0x30000000, 97 wlan_intf_opcode_ihv_end = 0x3fffffff 98 } WLAN_INTF_OPCODE; /* HACK: WIDL is broken , *PWLAN_INTF_OPCODE; */ 99 100 #if defined(__midl) || defined(__WIDL__) 101 typedef [v1_enum] enum _WLAN_INTERFACE_STATE { 102 #else 103 typedef enum _WLAN_INTERFACE_STATE { 104 #endif 105 wlan_interface_state_not_ready = 0, 106 wlan_interface_state_connected, 107 wlan_interface_state_ad_hoc_network_formed, 108 wlan_interface_state_disconnecting, 109 wlan_interface_state_disconnected, 110 wlan_interface_state_associating, 111 wlan_interface_state_discovering, 112 wlan_interface_state_authenticating 113 } WLAN_INTERFACE_STATE; 114 115 typedef enum _WLAN_INTERFACE_TYPE { 116 wlan_interface_type_emulated_802_11 = 0, 117 wlan_interface_type_native_802_11, 118 wlan_interface_type_invalid 119 } WLAN_INTERFACE_TYPE, *PWLAN_INTERFACE_TYPE; 120 121 /* Types */ 122 typedef DWORD WLAN_REASON_CODE, *PWLAN_REASON_CODE; 123 typedef ULONG WLAN_SIGNAL_QUALITY, *PWLAN_SIGNAL_QUALITY; 124 125 typedef struct _DOT11_NETWORK { 126 DOT11_SSID dot11Ssid; 127 DOT11_BSS_TYPE dot11BssType; 128 } DOT11_NETWORK, *PDOT11_NETWORK; 129 130 typedef struct _DOT11_NETWORK_LIST { 131 DWORD dwNumberOfItems; 132 DWORD dwIndex; 133 #if defined(__midl) || defined(__WIDL__) 134 [size_is(dwNumberOfItems)] DOT11_NETWORK Network[]; 135 #else 136 DOT11_NETWORK Network[1]; 137 #endif 138 } DOT11_NETWORK_LIST, *PDOT11_NETWORK_LIST; 139 140 typedef struct _WLAN_INTERFACE_INFO { 141 GUID InterfaceGuid; 142 WCHAR strInterfaceDescription[256]; 143 WLAN_INTERFACE_STATE isState; 144 } WLAN_INTERFACE_INFO, *PWLAN_INTERFACE_INFO; 145 146 typedef struct _WLAN_INTERFACE_INFO_LIST { 147 DWORD dwNumberOfItems; 148 DWORD dwIndex; 149 #if defined(__midl) || defined(__WIDL__) 150 [unique, size_is(dwNumberOfItems)] WLAN_INTERFACE_INFO InterfaceInfo[*]; 151 #else 152 WLAN_INTERFACE_INFO InterfaceInfo[1]; 153 #endif 154 } WLAN_INTERFACE_INFO_LIST, *PWLAN_INTERFACE_INFO_LIST; 155 156 typedef struct _WLAN_INTERFACE_CAPABILITY { 157 WLAN_INTERFACE_TYPE interfaceType; 158 BOOL bDot11DSupported; 159 DWORD dwMaxDesiredSsidListSize; 160 DWORD dwMaxDesiredBssidListSize; 161 DWORD dwNumberOfSupportedPhys; 162 /* enum32 */ long dot11PhyTypes[WLAN_MAX_PHY_INDEX]; 163 } WLAN_INTERFACE_CAPABILITY, *PWLAN_INTERFACE_CAPABILITY; 164 165 typedef struct _WLAN_RAW_DATA { 166 DWORD dwDataSize; 167 #if defined(__midl) || defined(__WIDL__) 168 [size_is(dwDataSize)] BYTE DataBlob[]; 169 #else 170 BYTE DataBlob[1]; 171 #endif 172 } WLAN_RAW_DATA, *PWLAN_RAW_DATA; 173 174 typedef struct _WLAN_PROFILE_INFO { 175 WCHAR strProfileName[256]; 176 DWORD dwFlags; 177 } WLAN_PROFILE_INFO, *PWLAN_PROFILE_INFO; 178 179 typedef struct _WLAN_PROFILE_INFO_LIST { 180 DWORD dwNumberOfItems; 181 DWORD dwIndex; 182 #if defined(__midl) || defined(__WIDL__) 183 [size_is(dwNumberOfItems)] WLAN_PROFILE_INFO ProfileInfo[]; 184 #else 185 WLAN_PROFILE_INFO ProfileInfo[1]; 186 #endif 187 } WLAN_PROFILE_INFO_LIST, *PWLAN_PROFILE_INFO_LIST; 188 189 typedef struct _WLAN_AVAILABLE_NETWORK { 190 WCHAR strProfileName[WLAN_MAX_NAME_LENGTH]; 191 DOT11_SSID dot11Ssid; 192 DOT11_BSS_TYPE dot11BssType; 193 ULONG uNumberOfBssids; 194 BOOL bNetworkConnectable; 195 WLAN_REASON_CODE wlanNotConnectableReason; 196 ULONG uNumberOfPhyTypes; 197 DOT11_PHY_TYPE dot11PhyTypes[8]; 198 BOOL bMorePhyTypes; 199 WLAN_SIGNAL_QUALITY wlanSignalQuality; 200 BOOL bSecurityEnabled; 201 DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm; 202 DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm; 203 DWORD dwFlags; 204 DWORD dwReserved; 205 } WLAN_AVAILABLE_NETWORK, *PWLAN_AVAILABLE_NETWORK; 206 207 typedef struct _WLAN_AVAILABLE_NETWORK_LIST { 208 DWORD dwNumberOfItems; 209 DWORD dwIndex; 210 #if defined(__midl) || defined(__WIDL__) 211 [size_is(dwNumberOfItems)] WLAN_AVAILABLE_NETWORK Network[*]; 212 #else 213 WLAN_AVAILABLE_NETWORK Network[1]; 214 #endif 215 } WLAN_AVAILABLE_NETWORK_LIST ,*PWLAN_AVAILABLE_NETWORK_LIST; 216 217 typedef struct _WLAN_CONNECTION_PARAMETERS { 218 WLAN_CONNECTION_MODE wlanConnectionMode; 219 #if defined(__midl) || defined(__WIDL__) 220 [string] LPCWSTR strProfile; 221 #else 222 LPCWSTR strProfile; 223 #endif 224 PDOT11_SSID pDot11Ssid; 225 PDOT11_BSSID_LIST pDesiredBssidList; 226 DOT11_BSS_TYPE dot11BssType; 227 DWORD dwFlags; 228 } WLAN_CONNECTION_PARAMETERS, *PWLAN_CONNECTION_PARAMETERS; 229 230 typedef L2_NOTIFICATION_DATA WLAN_NOTIFICATION_DATA, *PWLAN_NOTIFICATION_DATA; 231 232 typedef void (__stdcall *WLAN_NOTIFICATION_CALLBACK) (PWLAN_NOTIFICATION_DATA, PVOID); 233 234 /* Functions */ 235 #if !defined(__midl) && !defined(__WIDL__) 236 PVOID WINAPI WlanAllocateMemory(DWORD dwSize); 237 VOID WINAPI WlanFreeMemory(PVOID pMemory); 238 DWORD WINAPI WlanOpenHandle(IN DWORD dwClientVersion, PVOID pReserved, OUT DWORD *pdwNegotiatedVersion, OUT HANDLE *phClientHandle); 239 DWORD WINAPI WlanCloseHandle(IN HANDLE hClientHandle, PVOID pReserved); 240 DWORD WINAPI WlanConnect(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN const PWLAN_CONNECTION_PARAMETERS pConnectionParameters, PVOID pReserved); 241 DWORD WINAPI WlanDisconnect(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved); 242 DWORD WINAPI WlanEnumInterfaces(IN HANDLE hClientHandle, PVOID pReserved, OUT PWLAN_INTERFACE_INFO_LIST *ppInterfaceList); 243 DWORD WINAPI WlanGetAvailableNetworkList(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN DWORD dwFlags, PVOID pReserved, OUT PWLAN_AVAILABLE_NETWORK_LIST *ppAvailableNetworkList); 244 DWORD WINAPI WlanGetInterfaceCapability(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved, OUT PWLAN_INTERFACE_CAPABILITY *ppCapability); 245 DWORD WINAPI WlanDeleteProfile(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN LPCWSTR strProfileName, PVOID pReserved); 246 DWORD WINAPI WlanGetProfile(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN LPCWSTR strProfileName, PVOID pReserved, OUT LPWSTR *pstrProfileXml, DWORD *pdwFlags, PDWORD pdwGrantedAccess); 247 DWORD WINAPI WlanGetProfileCustomUserData(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN LPCWSTR strProfileName, PVOID pReserved, OUT DWORD *pdwDataSize, OUT PBYTE *ppData); 248 DWORD WINAPI WlanGetProfileList(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, PVOID pReserved, OUT PWLAN_PROFILE_INFO_LIST *ppProfileList); 249 DWORD WINAPI WlanIhvControl(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN WLAN_IHV_CONTROL_TYPE Type, IN DWORD dwInBufferSize, IN PVOID pInBuffer, IN DWORD dwOutBufferSize, PVOID pOutBuffer, OUT PDWORD pdwBytesReturned); 250 DWORD WINAPI WlanQueryInterface(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN WLAN_INTF_OPCODE OpCode, PVOID pReserved, OUT PDWORD pdwDataSize, OUT PVOID *ppData, WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType); 251 DWORD WINAPI WlanReasonCodeToString(IN DWORD dwReasonCode, IN DWORD dwBufferSize, IN PWCHAR pStringBuffer, PVOID pReserved); 252 DWORD WINAPI WlanRegisterNotification(IN HANDLE hClientHandle,IN DWORD dwNotifSource, IN BOOL bIgnoreDuplicate, WLAN_NOTIFICATION_CALLBACK funcCallback, PVOID pCallbackContext, PVOID pReserved, PDWORD pdwPrevNotifSource); 253 DWORD WINAPI WlanRenameProfile(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN LPCWSTR strOldProfileName, IN LPCWSTR strNewProfileName, PVOID pReserved); 254 DWORD WINAPI WlanSetProfile(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN DWORD dwFlags, IN LPCWSTR strProfileXml, LPCWSTR strAllUserProfileSecurity, IN BOOL bOverwrite, PVOID pReserved, OUT DWORD *pdwReasonCode); 255 DWORD WINAPI WlanSetProfileCustomUserData(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN LPCWSTR strProfileName, IN DWORD dwDataSize, IN const PBYTE pData, PVOID pReserved); 256 DWORD WINAPI WlanSetProfileEapUserData(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN LPCWSTR strProfileName, IN EAP_METHOD_TYPE eapType, IN DWORD dwFlags, IN DWORD dwEapUserDataSize, IN const LPBYTE pbEapUserData, PVOID pReserved); 257 DWORD WINAPI WlanSetProfileList(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, DWORD dwItems, IN LPCWSTR *strProfileNames, PVOID pReserved); 258 DWORD WINAPI WlanSetSecuritySettings(IN HANDLE hClientHandle, IN WLAN_SECURABLE_OBJECT SecurableObject, IN LPCWSTR strModifiedSDDL); 259 DWORD WINAPI WlanScan(IN HANDLE hClientHandle, IN const GUID *pInterfaceGuid, IN PDOT11_SSID pDot11Ssid, IN PWLAN_RAW_DATA pIeData, PVOID pReserved); 260 #endif 261 262 #ifdef __cplusplus 263 } 264 #endif 265 266 267 #endif // _WLANAPI_H 268