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