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