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::bthdef::{AUTHENTICATION_REQUIREMENTS, BTH_ADDR, BTH_MAX_PIN_SIZE};
7 use shared::bthsdpdef::{SDP_LARGE_INTEGER_16, SDP_SPECIFICTYPE, SDP_TYPE, SDP_ULARGE_INTEGER_16};
8 use shared::guiddef::GUID;
9 use shared::minwindef::{BOOL, DWORD, LPBYTE, LPVOID, PULONG, UCHAR, ULONG, USHORT};
10 use shared::windef::HWND;
11 use um::minwinbase::SYSTEMTIME;
12 use um::winnt::{
13     CHAR, HANDLE, LONG, LONGLONG, LPCWSTR, LPWSTR, PVOID, PWSTR, SHORT, ULONGLONG, WCHAR,
14 };
15 pub const BLUETOOTH_MAX_NAME_SIZE: usize = 248;
16 pub const BLUETOOTH_MAX_PASSKEY_SIZE: usize = 16;
17 pub const BLUETOOTH_MAX_PASSKEY_BUFFER_SIZE: usize = BLUETOOTH_MAX_PASSKEY_SIZE + 1;
18 pub const BLUETOOTH_MAX_SERVICE_NAME_SIZE: usize = 256;
19 pub const BLUETOOTH_DEVICE_NAME_SIZE: usize = 256;
20 pub type BLUETOOTH_ADDRESS = BTH_ADDR;
21 pub const BLUETOOTH_NULL_ADDRESS: BLUETOOTH_ADDRESS = 0x0;
22 STRUCT!{struct BLUETOOTH_LOCAL_SERVICE_INFO {
23     Enabled: BOOL,
24     btAddr: BLUETOOTH_ADDRESS,
25     szName: [WCHAR; BLUETOOTH_MAX_SERVICE_NAME_SIZE],
26     szDeviceString: [WCHAR; BLUETOOTH_DEVICE_NAME_SIZE],
27 }}
28 pub type PBLUETOOTH_LOCAL_SERVICE_INFO = *mut BLUETOOTH_LOCAL_SERVICE_INFO;
29 STRUCT!{struct BLUETOOTH_FIND_RADIO_PARAMS {
30     dwSize: DWORD,
31 }}
32 pub type HBLUETOOTH_RADIO_FIND = HANDLE;
33 extern "system" {
BluetoothFindFirstRadio( pbtfrp: *const BLUETOOTH_FIND_RADIO_PARAMS, phRadio: *mut HANDLE, ) -> HBLUETOOTH_RADIO_FIND34     pub fn BluetoothFindFirstRadio(
35         pbtfrp: *const BLUETOOTH_FIND_RADIO_PARAMS,
36         phRadio: *mut HANDLE,
37     ) -> HBLUETOOTH_RADIO_FIND;
BluetoothFindNextRadio( hFind: HBLUETOOTH_RADIO_FIND, phRadio: *mut HANDLE, ) -> BOOL38     pub fn BluetoothFindNextRadio(
39         hFind: HBLUETOOTH_RADIO_FIND,
40         phRadio: *mut HANDLE,
41     ) -> BOOL;
BluetoothFindRadioClose( hFind: HBLUETOOTH_RADIO_FIND, ) -> BOOL42     pub fn BluetoothFindRadioClose(
43         hFind: HBLUETOOTH_RADIO_FIND,
44     ) -> BOOL;
45 }
46 STRUCT!{struct BLUETOOTH_RADIO_INFO {
47     dwSize: DWORD,
48     address: BLUETOOTH_ADDRESS,
49     szName: [WCHAR; BLUETOOTH_MAX_NAME_SIZE],
50     ulClassofDevice: ULONG,
51     lmpSubversion: USHORT,
52     manufacturer: USHORT,
53 }}
54 pub type PBLUETOOTH_RADIO_INFO = *mut BLUETOOTH_RADIO_INFO;
55 extern "system" {
BluetoothGetRadioInfo( hRadio: HANDLE, pRadioInfo: PBLUETOOTH_RADIO_INFO, ) -> DWORD56     pub fn BluetoothGetRadioInfo(
57         hRadio: HANDLE,
58         pRadioInfo: PBLUETOOTH_RADIO_INFO,
59     ) -> DWORD;
60 }
61 STRUCT!{struct BLUETOOTH_DEVICE_INFO {
62     dwSize: DWORD,
63     Address: BLUETOOTH_ADDRESS,
64     ulClassofDevice: ULONG,
65     fConnected: BOOL,
66     fRemembered: BOOL,
67     fAuthenticated: BOOL,
68     stLastSeen: SYSTEMTIME,
69     stLastUsed: SYSTEMTIME,
70     szName: [WCHAR; BLUETOOTH_MAX_NAME_SIZE],
71 }}
72 pub type PBLUETOOTH_DEVICE_INFO = *mut BLUETOOTH_DEVICE_INFO;
73 ENUM!{enum BLUETOOTH_AUTHENTICATION_METHOD {
74     BLUETOOTH_AUTHENTICATION_METHOD_LEGACY = 0x1,
75     BLUETOOTH_AUTHENTICATION_METHOD_OOB,
76     BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON,
77     BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY_NOTIFICATION,
78     BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY,
79 }}
80 pub type PBLUETOOTH_AUTHENTICATION_METHOD = *mut BLUETOOTH_AUTHENTICATION_METHOD;
81 ENUM!{enum BLUETOOTH_IO_CAPABILITY {
82     BLUETOOTH_IO_CAPABILITY_DISPLAYONLY = 0x00,
83     BLUETOOTH_IO_CAPABILITY_DISPLAYYESNO = 0x01,
84     BLUETOOTH_IO_CAPABILITY_KEYBOARDONLY = 0x02,
85     BLUETOOTH_IO_CAPABILITY_NOINPUTNOOUTPUT = 0x03,
86     BLUETOOTH_IO_CAPABILITY_UNDEFINED = 0xff,
87 }}
88 ENUM!{enum BLUETOOTH_AUTHENTICATION_REQUIREMENTS {
89     BLUETOOTH_MITM_ProtectionNotRequired = 0,
90     BLUETOOTH_MITM_ProtectionRequired = 0x1,
91     BLUETOOTH_MITM_ProtectionNotRequiredBonding = 0x2,
92     BLUETOOTH_MITM_ProtectionRequiredBonding = 0x3,
93     BLUETOOTH_MITM_ProtectionNotRequiredGeneralBonding = 0x4,
94     BLUETOOTH_MITM_ProtectionRequiredGeneralBonding = 0x5,
95     BLUETOOTH_MITM_ProtectionNotDefined = 0xff,
96 }}
97 UNION!{union BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS_u {
98     [u32; 1],
99     Numeric_Value Numeric_Value_mut: ULONG,
100     Passkey Passkey_mut: ULONG,
101 }}
102 STRUCT!{struct BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS {
103     deviceInfo: BLUETOOTH_DEVICE_INFO,
104     authenticationMethod: BLUETOOTH_AUTHENTICATION_METHOD,
105     ioCapability: BLUETOOTH_IO_CAPABILITY,
106     authenticationRequirements: BLUETOOTH_AUTHENTICATION_REQUIREMENTS,
107     u: BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS_u,
108 }}
109 pub type PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS = *mut BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS;
110 STRUCT!{struct BLUETOOTH_DEVICE_SEARCH_PARAMS {
111     dwSize: DWORD,
112     fReturnAuthenticated: BOOL,
113     fReturnRemembered: BOOL,
114     fReturnUnknown: BOOL,
115     fReturnConnected: BOOL,
116     fIssueInquiry: BOOL,
117     cTimeoutMultiplier: UCHAR,
118     hRadio: HANDLE,
119 }}
120 pub type HBLUETOOTH_DEVICE_FIND = HANDLE;
121 extern "system" {
BluetoothFindFirstDevice( pbtsp: *const BLUETOOTH_DEVICE_SEARCH_PARAMS, pbtdi: *mut BLUETOOTH_DEVICE_INFO, ) -> HBLUETOOTH_DEVICE_FIND122     pub fn BluetoothFindFirstDevice(
123         pbtsp: *const BLUETOOTH_DEVICE_SEARCH_PARAMS,
124         pbtdi: *mut BLUETOOTH_DEVICE_INFO,
125     ) -> HBLUETOOTH_DEVICE_FIND;
BluetoothFindNextDevice( hFind: HBLUETOOTH_DEVICE_FIND, pbtdi: *mut BLUETOOTH_DEVICE_INFO, ) -> BOOL126     pub fn BluetoothFindNextDevice(
127         hFind: HBLUETOOTH_DEVICE_FIND,
128         pbtdi: *mut BLUETOOTH_DEVICE_INFO,
129     ) -> BOOL;
BluetoothFindDeviceClose( hFind: HBLUETOOTH_DEVICE_FIND, ) -> BOOL130     pub fn BluetoothFindDeviceClose(
131         hFind: HBLUETOOTH_DEVICE_FIND,
132     ) -> BOOL;
BluetoothGetDeviceInfo( hRadio: HANDLE, pbtdi: *mut BLUETOOTH_DEVICE_INFO, ) -> DWORD133     pub fn BluetoothGetDeviceInfo(
134         hRadio: HANDLE,
135         pbtdi: *mut BLUETOOTH_DEVICE_INFO,
136     ) -> DWORD;
BluetoothUpdateDeviceRecord( pbtdi: *const BLUETOOTH_DEVICE_INFO, ) -> DWORD137     pub fn BluetoothUpdateDeviceRecord(
138         pbtdi: *const BLUETOOTH_DEVICE_INFO,
139     ) -> DWORD;
BluetoothRemoveDevice( pAddress: *const BLUETOOTH_ADDRESS, ) -> DWORD140     pub fn BluetoothRemoveDevice(
141         pAddress: *const BLUETOOTH_ADDRESS,
142     ) -> DWORD;
143 }
144 STRUCT!{struct BLUETOOTH_COD_PAIRS {
145     ulCODMask: ULONG,
146     pcszDescription: LPCWSTR,
147 }}
148 FN!{stdcall PFN_DEVICE_CALLBACK(
149     pvParam: LPVOID,
150     pDevice: *const BLUETOOTH_DEVICE_INFO,
151 ) -> BOOL}
152 STRUCT!{struct BLUETOOTH_SELECT_DEVICE_PARAMS {
153     dwSize: DWORD,
154     cNumOfClasses: ULONG,
155     prgClassOfDevices: *mut BLUETOOTH_COD_PAIRS,
156     pszInfo: LPWSTR,
157     hwndParent: HWND,
158     fForceAuthentication: BOOL,
159     fShowAuthenticated: BOOL,
160     fShowRemembered: BOOL,
161     fShowUnknown: BOOL,
162     fAddNewDeviceWizard: BOOL,
163     fSkipServicesPage: BOOL,
164     pfnDeviceCallback: PFN_DEVICE_CALLBACK,
165     pvParam: LPVOID,
166     cNumDevices: DWORD,
167     pDevices: PBLUETOOTH_DEVICE_INFO,
168 }}
169 extern "system" {
BluetoothSelectDevices( pbtsdp: *mut BLUETOOTH_SELECT_DEVICE_PARAMS, ) -> BOOL170     pub fn BluetoothSelectDevices(
171         pbtsdp: *mut BLUETOOTH_SELECT_DEVICE_PARAMS,
172     ) -> BOOL;
BluetoothSelectDevicesFree( pbtsdp: *mut BLUETOOTH_SELECT_DEVICE_PARAMS, ) -> BOOL173     pub fn BluetoothSelectDevicesFree(
174         pbtsdp: *mut BLUETOOTH_SELECT_DEVICE_PARAMS,
175     ) -> BOOL;
BluetoothDisplayDeviceProperties( hwndParent: HWND, pbtdi: *mut BLUETOOTH_DEVICE_INFO, ) -> BOOL176     pub fn BluetoothDisplayDeviceProperties(
177         hwndParent: HWND,
178         pbtdi: *mut BLUETOOTH_DEVICE_INFO,
179     ) -> BOOL;
180     // #[deprecated]
BluetoothAuthenticateDevice( hwndParent: HWND, hRadio: HANDLE, pbtbi: *mut BLUETOOTH_DEVICE_INFO, pszPasskey: PWSTR, ulPasskeyLength: ULONG, ) -> DWORD181     pub fn BluetoothAuthenticateDevice(
182         hwndParent: HWND,
183         hRadio: HANDLE,
184         pbtbi: *mut BLUETOOTH_DEVICE_INFO,
185         pszPasskey: PWSTR,
186         ulPasskeyLength: ULONG,
187     ) -> DWORD;
188 }
189 STRUCT!{struct BLUETOOTH_PIN_INFO {
190     pin: [UCHAR; BTH_MAX_PIN_SIZE],
191     pinLength: UCHAR,
192 }}
193 pub type PBLUETOOTH_PIN_INFO = *mut BLUETOOTH_PIN_INFO;
194 STRUCT!{struct BLUETOOTH_OOB_DATA_INFO {
195     C: [UCHAR; 16],
196     R: [UCHAR; 16],
197 }}
198 pub type PBLUETOOTH_OOB_DATA_INFO = *mut BLUETOOTH_OOB_DATA_INFO;
199 STRUCT!{struct BLUETOOTH_NUMERIC_COMPARISON_INFO {
200     NumericValue: ULONG,
201 }}
202 pub type PBLUETOOTH_NUMERIC_COMPARISON_INFO = *mut BLUETOOTH_NUMERIC_COMPARISON_INFO;
203 STRUCT!{struct BLUETOOTH_PASSKEY_INFO {
204     passkey: ULONG,
205 }}
206 pub type PBLUETOOTH_PASSKEY_INFO = *mut BLUETOOTH_PASSKEY_INFO;
207 extern "system" {
BluetoothAuthenticateDeviceEx( hwndParentIn: HWND, hRadioIn: HANDLE, pbtdiInout: *mut BLUETOOTH_DEVICE_INFO, pbtOobData: PBLUETOOTH_OOB_DATA_INFO, authenticationRequirement: AUTHENTICATION_REQUIREMENTS, ) -> DWORD208     pub fn BluetoothAuthenticateDeviceEx(
209         hwndParentIn: HWND,
210         hRadioIn: HANDLE,
211         pbtdiInout: *mut BLUETOOTH_DEVICE_INFO,
212         pbtOobData: PBLUETOOTH_OOB_DATA_INFO,
213         authenticationRequirement: AUTHENTICATION_REQUIREMENTS,
214     ) -> DWORD;
215     // #[deprecated]
BluetoothAuthenticateMultipleDevices( hwndParent: HWND, hRadio: HANDLE, cDevices: DWORD, rgbtdi: *mut BLUETOOTH_DEVICE_INFO, ) -> DWORD216     pub fn BluetoothAuthenticateMultipleDevices(
217         hwndParent: HWND,
218         hRadio: HANDLE,
219         cDevices: DWORD,
220         rgbtdi: *mut BLUETOOTH_DEVICE_INFO,
221     ) -> DWORD;
222 }
223 pub const BLUETOOTH_SERVICE_DISABLE: DWORD = 0x00;
224 pub const BLUETOOTH_SERVICE_ENABLE: DWORD = 0x01;
225 pub const BLUETOOTH_SERVICE_MASK: DWORD = BLUETOOTH_SERVICE_DISABLE | BLUETOOTH_SERVICE_ENABLE;
226 extern "system" {
BluetoothSetServiceState( hRadio: HANDLE, pbtdi: *const BLUETOOTH_DEVICE_INFO, pGuidService: *const GUID, dwServiceFlags: DWORD, ) -> DWORD227     pub fn BluetoothSetServiceState(
228         hRadio: HANDLE,
229         pbtdi: *const BLUETOOTH_DEVICE_INFO,
230         pGuidService: *const GUID,
231         dwServiceFlags: DWORD,
232     ) -> DWORD;
BluetoothEnumerateInstalledServices( hRadio: HANDLE, pbtdi: *const BLUETOOTH_DEVICE_INFO, pcServiceInout: *mut DWORD, pGuidServices: *mut GUID, ) -> DWORD233     pub fn BluetoothEnumerateInstalledServices(
234         hRadio: HANDLE,
235         pbtdi: *const BLUETOOTH_DEVICE_INFO,
236         pcServiceInout: *mut DWORD,
237         pGuidServices: *mut GUID,
238     ) -> DWORD;
BluetoothEnableDiscovery( hRadio: HANDLE, fEnabled: BOOL, ) -> BOOL239     pub fn BluetoothEnableDiscovery(
240         hRadio: HANDLE,
241         fEnabled: BOOL,
242     ) -> BOOL;
BluetoothIsDiscoverable( hRadio: HANDLE, ) -> BOOL243     pub fn BluetoothIsDiscoverable(
244         hRadio: HANDLE,
245     ) -> BOOL;
BluetoothEnableIncomingConnections( hRadio: HANDLE, fEnabled: BOOL, ) -> BOOL246     pub fn BluetoothEnableIncomingConnections(
247         hRadio: HANDLE,
248         fEnabled: BOOL,
249     ) -> BOOL;
BluetoothIsConnectable( hRadio: HANDLE, ) -> BOOL250     pub fn BluetoothIsConnectable(
251         hRadio: HANDLE,
252     ) -> BOOL;
253 }
254 pub type HBLUETOOTH_AUTHENTICATION_REGISTRATION = HANDLE;
255 FN!{stdcall PFN_AUTHENTICATION_CALLBACK(
256     pvParam: LPVOID,
257     pDevice: PBLUETOOTH_DEVICE_INFO,
258 ) -> BOOL}
259 extern "system" {
260     // #[deprecated]
BluetoothRegisterForAuthentication( pbtdi: *const BLUETOOTH_DEVICE_INFO, phRegHandle: *mut HBLUETOOTH_AUTHENTICATION_REGISTRATION, pfnCallback: PFN_AUTHENTICATION_CALLBACK, pvParam: PVOID, ) -> DWORD261     pub fn BluetoothRegisterForAuthentication(
262         pbtdi: *const BLUETOOTH_DEVICE_INFO,
263         phRegHandle: *mut HBLUETOOTH_AUTHENTICATION_REGISTRATION,
264         pfnCallback: PFN_AUTHENTICATION_CALLBACK,
265         pvParam: PVOID,
266     ) -> DWORD;
267 }
268 FN!{stdcall PFN_AUTHENTICATION_CALLBACK_EX(
269     pvParam: LPVOID,
270     pAuthCallbackParams: PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS,
271 ) -> BOOL}
272 extern "system" {
BluetoothRegisterForAuthenticationEx( pbtdiIn: *const BLUETOOTH_DEVICE_INFO, phRegHandleOut: *mut HBLUETOOTH_AUTHENTICATION_REGISTRATION, pfnCallbackIn: PFN_AUTHENTICATION_CALLBACK_EX, pvParam: PVOID, ) -> DWORD273     pub fn BluetoothRegisterForAuthenticationEx(
274         pbtdiIn: *const BLUETOOTH_DEVICE_INFO,
275         phRegHandleOut: *mut HBLUETOOTH_AUTHENTICATION_REGISTRATION,
276         pfnCallbackIn: PFN_AUTHENTICATION_CALLBACK_EX,
277         pvParam: PVOID,
278     ) -> DWORD;
BluetoothUnregisterAuthentication( hRegHandle: HBLUETOOTH_AUTHENTICATION_REGISTRATION, ) -> BOOL279     pub fn BluetoothUnregisterAuthentication(
280         hRegHandle: HBLUETOOTH_AUTHENTICATION_REGISTRATION,
281     ) -> BOOL;
282     // #[deprecated]
BluetoothSendAuthenticationResponse( hRadio: HANDLE, pbtdi: *const BLUETOOTH_DEVICE_INFO, pszPasskey: LPCWSTR, ) -> DWORD283     pub fn BluetoothSendAuthenticationResponse(
284         hRadio: HANDLE,
285         pbtdi: *const BLUETOOTH_DEVICE_INFO,
286         pszPasskey: LPCWSTR,
287     ) -> DWORD;
288 }
289 UNION!{union BLUETOOTH_AUTHENTICATE_RESPONSE_u {
290     [u32; 8],
291     pinInfo pinInfo_mut: BLUETOOTH_PIN_INFO,
292     oobInfo oobInfo_mut: BLUETOOTH_OOB_DATA_INFO,
293     numericCompInfo numericCompInfo_mut: BLUETOOTH_NUMERIC_COMPARISON_INFO,
294     passkeyInfo passkeyInfo_mut: BLUETOOTH_PASSKEY_INFO,
295 }}
296 STRUCT!{struct BLUETOOTH_AUTHENTICATE_RESPONSE {
297     bthAddressRemote: BLUETOOTH_ADDRESS,
298     authMethod: BLUETOOTH_AUTHENTICATION_METHOD,
299     u: BLUETOOTH_AUTHENTICATE_RESPONSE_u,
300     negativeResponse: UCHAR,
301 }}
302 pub type PBLUETOOTH_AUTHENTICATE_RESPONSE = *mut BLUETOOTH_AUTHENTICATE_RESPONSE;
303 extern "system" {
BluetoothSendAuthenticationResponseEx( hRadioIn: HANDLE, pauthResponse: PBLUETOOTH_AUTHENTICATE_RESPONSE, ) -> DWORD304     pub fn BluetoothSendAuthenticationResponseEx(
305         hRadioIn: HANDLE,
306         pauthResponse: PBLUETOOTH_AUTHENTICATE_RESPONSE,
307     ) -> DWORD;
308 }
309 STRUCT!{struct SDP_ELEMENT_DATA_data_string {
310     value: LPBYTE,
311     length: ULONG,
312 }}
313 STRUCT!{struct SDP_ELEMENT_DATA_data_url {
314     value: LPBYTE,
315     length: ULONG,
316 }}
317 STRUCT!{struct SDP_ELEMENT_DATA_data_sequence {
318     value: LPBYTE,
319     length: ULONG,
320 }}
321 STRUCT!{struct SDP_ELEMENT_DATA_data_alternative {
322     value: LPBYTE,
323     length: ULONG,
324 }}
325 UNION!{union SDP_ELEMENT_DATA_data {
326     [u64; 2],
327     int128 int128_mut: SDP_LARGE_INTEGER_16,
328     int64 int64_mut: LONGLONG,
329     int32 int32_mut: LONG,
330     int16 int16_mut: SHORT,
331     int8 int8_mut: CHAR,
332     uint128 uint128_mut: SDP_ULARGE_INTEGER_16,
333     uint64 uint64_mut: ULONGLONG,
334     uint32 uint32_mut: ULONG,
335     uint16 uint16_mut: USHORT,
336     uint8 uint8_mut: UCHAR,
337     booleanVal booleanVal_mut: UCHAR,
338     uuid128 uuid128_mut: GUID,
339     uuid32 uuid32_mut: ULONG,
340     uuid16 uuid16_mut: USHORT,
341     string string_mut: SDP_ELEMENT_DATA_data_string,
342     url url_mut: SDP_ELEMENT_DATA_data_url,
343     sequence sequence_mut: SDP_ELEMENT_DATA_data_sequence,
344     alternative alternative_mut: SDP_ELEMENT_DATA_data_alternative,
345 }}
346 STRUCT!{struct SDP_ELEMENT_DATA {
347     type_: SDP_TYPE,
348     specificType: SDP_SPECIFICTYPE,
349     data: SDP_ELEMENT_DATA_data,
350 }}
351 pub type PSDP_ELEMENT_DATA = *mut SDP_ELEMENT_DATA;
352 extern "system" {
BluetoothSdpGetElementData( pSdpStream: LPBYTE, cbSdpStreamLength: ULONG, pData: PSDP_ELEMENT_DATA, ) -> DWORD353     pub fn BluetoothSdpGetElementData(
354         pSdpStream: LPBYTE,
355         cbSdpStreamLength: ULONG,
356         pData: PSDP_ELEMENT_DATA,
357     ) -> DWORD;
358 }
359 pub type HBLUETOOTH_CONTAINER_ELEMENT = HANDLE;
360 extern "system" {
BluetoothSdpGetContainerElementData( pContainerStream: LPBYTE, cbContainerLength: ULONG, pElement: *mut HBLUETOOTH_CONTAINER_ELEMENT, pData: PSDP_ELEMENT_DATA, ) -> DWORD361     pub fn BluetoothSdpGetContainerElementData(
362         pContainerStream: LPBYTE,
363         cbContainerLength: ULONG,
364         pElement: *mut HBLUETOOTH_CONTAINER_ELEMENT,
365         pData: PSDP_ELEMENT_DATA,
366     ) -> DWORD;
BluetoothSdpGetAttributeValue( pRecordStream: LPBYTE, cbRecordLength: ULONG, usAttributeId: USHORT, pAttributeData: PSDP_ELEMENT_DATA, ) -> DWORD367     pub fn BluetoothSdpGetAttributeValue(
368         pRecordStream: LPBYTE,
369         cbRecordLength: ULONG,
370         usAttributeId: USHORT,
371         pAttributeData: PSDP_ELEMENT_DATA,
372     ) -> DWORD;
373 }
374 STRUCT!{struct SDP_STRING_TYPE_DATA {
375     encoding: USHORT,
376     mibeNum: USHORT,
377     attributeId: USHORT,
378 }}
379 pub type PSDP_STRING_TYPE_DATA = *mut SDP_STRING_TYPE_DATA;
380 extern "system" {
BluetoothSdpGetString( pRecordStream: LPBYTE, cbRecordLength: ULONG, pStringData: PSDP_STRING_TYPE_DATA, usStringOffset: USHORT, pszString: PWSTR, pcchStringLength: PULONG, ) -> DWORD381     pub fn BluetoothSdpGetString(
382         pRecordStream: LPBYTE,
383         cbRecordLength: ULONG,
384         pStringData: PSDP_STRING_TYPE_DATA,
385         usStringOffset: USHORT,
386         pszString: PWSTR,
387         pcchStringLength: PULONG,
388     ) -> DWORD;
389 }
390 FN!{stdcall PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK(
391     uAttribId: ULONG,
392     pValueStream: LPBYTE,
393     cbStreamSize: ULONG,
394     pvParam: LPVOID,
395 ) -> BOOL}
396 pub use self::BluetoothSdpEnumAttributes as BluetoothEnumAttributes;
397 extern "system" {
BluetoothSdpEnumAttributes( pSDPStream: LPBYTE, cbStreamSize: ULONG, pfnCallback: PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK, pvParam: LPVOID, ) -> BOOL398     pub fn BluetoothSdpEnumAttributes(
399         pSDPStream: LPBYTE,
400         cbStreamSize: ULONG,
401         pfnCallback: PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK,
402         pvParam: LPVOID,
403     ) -> BOOL;
BluetoothSetLocalServiceInfo( hRadioIn: HANDLE, pClassGuid: *const GUID, ulInstance: ULONG, pServiceInfoIn: *const BLUETOOTH_LOCAL_SERVICE_INFO, ) -> DWORD404     pub fn BluetoothSetLocalServiceInfo(
405         hRadioIn: HANDLE,
406         pClassGuid: *const GUID,
407         ulInstance: ULONG,
408         pServiceInfoIn: *const BLUETOOTH_LOCAL_SERVICE_INFO,
409     ) -> DWORD;
BluetoothIsVersionAvailable( MajorVersion: UCHAR, MinorVersion: UCHAR, ) -> BOOL410     pub fn BluetoothIsVersionAvailable(
411         MajorVersion: UCHAR,
412         MinorVersion: UCHAR,
413     ) -> BOOL;
414 }
415