| 1 |
// Licensed under the Apache License, Version 2.0 |
| 2 |
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 3 |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. |
| 4 |
// All files in the project carrying such notice may not be copied, modified, or distributed |
| 5 |
// except according to those terms. |
| 6 |
use shared::guiddef::GUID; |
| 7 |
use shared::minwindef::ULONG; |
| 8 |
use um::unknwnbase::{IUnknown, IUnknownVtbl}; |
| 9 |
use um::winnt::{BOOLEAN, HRESULT, LONG, LPCWSTR, LPWSTR}; |
| 10 |
ENUM!{enum DOT11_ADHOC_CIPHER_ALGORITHM { |
| 11 |
DOT11_ADHOC_CIPHER_ALGO_INVALID = -1i32 as u32, |
| 12 |
DOT11_ADHOC_CIPHER_ALGO_NONE = 0, |
| 13 |
DOT11_ADHOC_CIPHER_ALGO_CCMP = 0x4, |
| 14 |
DOT11_ADHOC_CIPHER_ALGO_WEP = 0x101, |
| 15 |
}} |
| 16 |
ENUM!{enum DOT11_ADHOC_AUTH_ALGORITHM { |
| 17 |
DOT11_ADHOC_AUTH_ALGO_INVALID = -1i32 as u32, |
| 18 |
DOT11_ADHOC_AUTH_ALGO_80211_OPEN = 1, |
| 19 |
DOT11_ADHOC_AUTH_ALGO_RSNA_PSK = 7, |
| 20 |
}} |
| 21 |
ENUM!{enum DOT11_ADHOC_NETWORK_CONNECTION_STATUS { |
| 22 |
DOT11_ADHOC_NETWORK_CONNECTION_STATUS_INVALID = 0, |
| 23 |
DOT11_ADHOC_NETWORK_CONNECTION_STATUS_DISCONNECTED = 11, |
| 24 |
DOT11_ADHOC_NETWORK_CONNECTION_STATUS_CONNECTING = 12, |
| 25 |
DOT11_ADHOC_NETWORK_CONNECTION_STATUS_CONNECTED = 13, |
| 26 |
DOT11_ADHOC_NETWORK_CONNECTION_STATUS_FORMED = 14, |
| 27 |
}} |
| 28 |
ENUM!{enum DOT11_ADHOC_CONNECT_FAIL_REASON { |
| 29 |
DOT11_ADHOC_CONNECT_FAIL_DOMAIN_MISMATCH = 0, |
| 30 |
DOT11_ADHOC_CONNECT_FAIL_PASSPHRASE_MISMATCH = 1, |
| 31 |
DOT11_ADHOC_CONNECT_FAIL_OTHER = 2, |
| 32 |
}} |
| 33 |
RIDL!{#[uuid(0x8f10cc26, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 34 |
interface IDot11AdHocManager(IDot11AdHocManagerVtbl): IUnknown(IUnknownVtbl) { |
| 35 |
fn CreateNetwork( |
| 36 |
Name: LPCWSTR, |
| 37 |
Password: LPCWSTR, |
| 38 |
GeographicalId: LONG, |
| 39 |
pInterface: *mut IDot11AdHocInterface, |
| 40 |
pSecurity: *mut IDot11AdHocSecuritySettings, |
| 41 |
pContextGuid: *mut GUID, |
| 42 |
pIAdHoc: *mut *mut IDot11AdHocNetwork, |
| 43 |
) -> HRESULT, |
| 44 |
fn CommitCreatedNetwork( |
| 45 |
pIAdHoc: *mut IDot11AdHocNetwork, |
| 46 |
fSaveProfile: BOOLEAN, |
| 47 |
fMakeSavedProfileUserSpecific: BOOLEAN, |
| 48 |
) -> HRESULT, |
| 49 |
fn GetIEnumDot11AdHocNetworks( |
| 50 |
pContextGuid: *mut GUID, |
| 51 |
ppEnum: *mut *mut IEnumDot11AdHocNetworks, |
| 52 |
) -> HRESULT, |
| 53 |
fn GetIEnumDot11AdHocInterfaces( |
| 54 |
ppEnum: *mut *mut IEnumDot11AdHocInterfaces, |
| 55 |
) -> HRESULT, |
| 56 |
fn GetNetwork( |
| 57 |
NetworkSignature: *mut GUID, |
| 58 |
pNetwork: *mut *mut IDot11AdHocNetwork, |
| 59 |
) -> HRESULT, |
| 60 |
}} |
| 61 |
RIDL!{#[uuid(0x8f10cc27, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 62 |
interface IDot11AdHocManagerNotificationSink(IDot11AdHocManagerNotificationSinkVtbl): |
| 63 |
IUnknown(IUnknownVtbl) { |
| 64 |
fn OnNetworkAdd( |
| 65 |
pIAdHocNetwork: *mut IDot11AdHocNetwork, |
| 66 |
) -> HRESULT, |
| 67 |
fn OnNetworkRemove( |
| 68 |
Signature: *mut GUID, |
| 69 |
) -> HRESULT, |
| 70 |
fn OnInterfaceAdd( |
| 71 |
pIAdHocInterface: *mut IDot11AdHocInterface, |
| 72 |
) -> HRESULT, |
| 73 |
fn OnInterfaceRemove( |
| 74 |
Signature: *mut GUID, |
| 75 |
) -> HRESULT, |
| 76 |
}} |
| 77 |
RIDL!{#[uuid(0x8f10cc28, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 78 |
interface IEnumDot11AdHocNetworks(IEnumDot11AdHocNetworksVtbl): IUnknown(IUnknownVtbl) { |
| 79 |
fn Next( |
| 80 |
cElt: ULONG, |
| 81 |
rgElt: *mut *mut IDot11AdHocNetwork, |
| 82 |
pcEltFetched: *mut ULONG, |
| 83 |
) -> HRESULT, |
| 84 |
fn Skip( |
| 85 |
cElt: ULONG, |
| 86 |
) -> HRESULT, |
| 87 |
fn Reset() -> HRESULT, |
| 88 |
fn Clone( |
| 89 |
ppEnum: *mut *mut IEnumDot11AdHocNetworks, |
| 90 |
) -> HRESULT, |
| 91 |
}} |
| 92 |
RIDL!{#[uuid(0x8f10cc29, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 93 |
interface IDot11AdHocNetwork(IDot11AdHocNetworkVtbl): IUnknown(IUnknownVtbl) { |
| 94 |
fn GetStatus( |
| 95 |
eStatus: *mut DOT11_ADHOC_NETWORK_CONNECTION_STATUS, |
| 96 |
) -> HRESULT, |
| 97 |
fn GetSSID( |
| 98 |
ppszwSSID: *mut LPWSTR, |
| 99 |
) -> HRESULT, |
| 100 |
fn HasProfile( |
| 101 |
pf11d: *mut BOOLEAN, |
| 102 |
) -> HRESULT, |
| 103 |
fn GetProfileName( |
| 104 |
ppszwProfileName: *mut LPWSTR, |
| 105 |
) -> HRESULT, |
| 106 |
fn DeleteProfile() -> HRESULT, |
| 107 |
fn GetSignalQuality( |
| 108 |
puStrengthValue: *mut ULONG, |
| 109 |
puStrengthMax: *mut ULONG, |
| 110 |
) -> HRESULT, |
| 111 |
fn GetSecuritySetting( |
| 112 |
pAdHocSecuritySetting: *mut *mut IDot11AdHocSecuritySettings, |
| 113 |
) -> HRESULT, |
| 114 |
fn GetContextGuid( |
| 115 |
pContextGuid: *mut GUID, |
| 116 |
) -> HRESULT, |
| 117 |
fn GetSignature( |
| 118 |
pSignature: *mut GUID, |
| 119 |
) -> HRESULT, |
| 120 |
fn GetInterface( |
| 121 |
pAdHocInterface: *mut *mut IDot11AdHocInterface, |
| 122 |
) -> HRESULT, |
| 123 |
fn Connect( |
| 124 |
Passphrase: LPCWSTR, |
| 125 |
GeographicalId: LONG, |
| 126 |
fSaveProfile: BOOLEAN, |
| 127 |
fMakeSavedProfileUserSpecific: BOOLEAN, |
| 128 |
) -> HRESULT, |
| 129 |
fn Disconnect() -> HRESULT, |
| 130 |
}} |
| 131 |
RIDL!{#[uuid(0x8f10cc2a, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 132 |
interface IDot11AdHocNetworkNotificationSink(IDot11AdHocNetworkNotificationSinkVtbl): |
| 133 |
IUnknown(IUnknownVtbl) { |
| 134 |
fn OnStatusChange( |
| 135 |
eStatus: DOT11_ADHOC_NETWORK_CONNECTION_STATUS, |
| 136 |
) -> HRESULT, |
| 137 |
fn OnConnectFail( |
| 138 |
eFailReason: DOT11_ADHOC_CONNECT_FAIL_REASON, |
| 139 |
) -> HRESULT, |
| 140 |
}} |
| 141 |
RIDL!{#[uuid(0x8f10cc2b, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 142 |
interface IDot11AdHocInterface(IDot11AdHocInterfaceVtbl): IUnknown(IUnknownVtbl) { |
| 143 |
fn GetDeviceSignature( |
| 144 |
pSignature: *mut GUID, |
| 145 |
) -> HRESULT, |
| 146 |
fn GetFriendlyName( |
| 147 |
ppszName: *mut LPWSTR, |
| 148 |
) -> HRESULT, |
| 149 |
fn IsDot11d( |
| 150 |
pf11d: *mut BOOLEAN, |
| 151 |
) -> HRESULT, |
| 152 |
fn IsAdHocCapable( |
| 153 |
pfAdHocCapable: *mut BOOLEAN, |
| 154 |
) -> HRESULT, |
| 155 |
fn IsRadioOn( |
| 156 |
pfIsRadioOn: *mut BOOLEAN, |
| 157 |
) -> HRESULT, |
| 158 |
fn GetActiveNetwork( |
| 159 |
ppNetwork: *mut *mut IDot11AdHocNetwork, |
| 160 |
) -> HRESULT, |
| 161 |
fn GetIEnumSecuritySettings( |
| 162 |
ppEnum: *mut *mut IEnumDot11AdHocSecuritySettings, |
| 163 |
) -> HRESULT, |
| 164 |
fn GetIEnumDot11AdHocNetworks( |
| 165 |
pFilterGuid: *mut GUID, |
| 166 |
ppEnum: *mut *mut IEnumDot11AdHocNetworks, |
| 167 |
) -> HRESULT, |
| 168 |
fn GetStatus( |
| 169 |
pState: *mut DOT11_ADHOC_NETWORK_CONNECTION_STATUS, |
| 170 |
) -> HRESULT, |
| 171 |
}} |
| 172 |
RIDL!{#[uuid(0x8f10cc2c, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 173 |
interface IEnumDot11AdHocInterfaces(IEnumDot11AdHocInterfacesVtbl): IUnknown(IUnknownVtbl) { |
| 174 |
fn Next( |
| 175 |
cElt: ULONG, |
| 176 |
rgElt: *mut *mut IDot11AdHocInterface, |
| 177 |
pcEltFetched: *mut ULONG, |
| 178 |
) -> HRESULT, |
| 179 |
fn Skip( |
| 180 |
cElt: ULONG, |
| 181 |
) -> HRESULT, |
| 182 |
fn Reset() -> HRESULT, |
| 183 |
fn Clone( |
| 184 |
ppEnum: *mut *mut IEnumDot11AdHocInterfaces, |
| 185 |
) -> HRESULT, |
| 186 |
}} |
| 187 |
RIDL!{#[uuid(0x8f10cc2d, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 188 |
interface IEnumDot11AdHocSecuritySettings(IEnumDot11AdHocSecuritySettingsVtbl): |
| 189 |
IUnknown(IUnknownVtbl) { |
| 190 |
fn Next( |
| 191 |
cElt: ULONG, |
| 192 |
rgElt: *mut *mut IDot11AdHocSecuritySettings, |
| 193 |
pcEltFetched: *mut ULONG, |
| 194 |
) -> HRESULT, |
| 195 |
fn Skip( |
| 196 |
cElt: ULONG, |
| 197 |
) -> HRESULT, |
| 198 |
fn Reset() -> HRESULT, |
| 199 |
fn Clone( |
| 200 |
ppEnum: *mut *mut IEnumDot11AdHocSecuritySettings, |
| 201 |
) -> HRESULT, |
| 202 |
}} |
| 203 |
RIDL!{#[uuid(0x8f10cc2e, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 204 |
interface IDot11AdHocSecuritySettings(IDot11AdHocSecuritySettingsVtbl): IUnknown(IUnknownVtbl) { |
| 205 |
fn GetDot11AuthAlgorithm( |
| 206 |
pAuth: *mut DOT11_ADHOC_AUTH_ALGORITHM, |
| 207 |
) -> HRESULT, |
| 208 |
fn GetDot11CipherAlgorithm( |
| 209 |
pCipher: *mut DOT11_ADHOC_CIPHER_ALGORITHM, |
| 210 |
) -> HRESULT, |
| 211 |
}} |
| 212 |
RIDL!{#[uuid(0x8f10cc2f, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] |
| 213 |
interface IDot11AdHocInterfaceNotificationSink(IDot11AdHocInterfaceNotificationSinkVtbl): |
| 214 |
IUnknown(IUnknownVtbl) { |
| 215 |
fn OnConnectionStatusChange( |
| 216 |
eStatus: DOT11_ADHOC_NETWORK_CONNECTION_STATUS, |
| 217 |
) -> HRESULT, |
| 218 |
}} |
| 219 |
RIDL!{#[uuid(0xdd06a84f, 0x83bd, 0x4d01, 0x8a, 0xb9, 0x23, 0x89, 0xfe, 0xa0, 0x86, 0x9e)] |
| 220 |
class Dot11AdHocManager;} |