From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/bluetoothapis.h | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
diff --git a/include/bluetoothapis.h b/include/bluetoothapis.h index fd90b731bf9..3e2794f95d6 100644 --- a/include/bluetoothapis.h +++ b/include/bluetoothapis.h @@ -110,6 +110,49 @@ typedef struct _BLUETOOTH_SELECT_DEVICE_PARAMS {
typedef BOOL (WINAPI *PFN_AUTHENTICATION_CALLBACK)(void *, PBLUETOOTH_DEVICE_INFO);
+#define BLUETOOTH_DEVICE_INFO BLUETOOTH_DEVICE_INFO_STRUCT + +typedef BLUETOOTH_DEVICE_INFO * PBLUETOOTH_DEVICE_INFO; + +typedef enum _BLUETOOTH_AUTHENTICATION_METHOD { + BLUETOOTH_AUTHENTICATION_METHOD_LEGACY = 0x1, + BLUETOOTH_AUTHENTICATION_METHOD_OOB, + BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON, + BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY_NOTIFICATION, + BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY, +} BLUETOOTH_AUTHENTICATION_METHOD, * PBLUETOOTH_AUTHENTICATION_METHOD; + +typedef enum _BLUETOOTH_IO_CAPABILITY { + BLUETOOTH_IO_CAPABILITY_DISPLAYONLY = 0x00, + BLUETOOTH_IO_CAPABILITY_DISPLAYYESNO = 0x01, + BLUETOOTH_IO_CAPABILITY_KEYBOARDONLY = 0x02, + BLUETOOTH_IO_CAPABILITY_NOINPUTNOOUTPUT = 0x03, + BLUETOOTH_IO_CAPABILITY_UNDEFINED = 0xff, +} BLUETOOTH_IO_CAPABILITY; + +typedef enum _BLUETOOTH_AUTHENTICATION_REQUIREMENTS{ + BLUETOOTH_MITM_ProtectionNotRequired = 0, + BLUETOOTH_MITM_ProtectionRequired = 0x1, + BLUETOOTH_MITM_ProtectionNotRequiredBonding = 0x2, + BLUETOOTH_MITM_ProtectionRequiredBonding = 0x3, + BLUETOOTH_MITM_ProtectionNotRequiredGeneralBonding = 0x4, + BLUETOOTH_MITM_ProtectionRequiredGeneralBonding = 0x5, + BLUETOOTH_MITM_ProtectionNotDefined = 0xff, +} BLUETOOTH_AUTHENTICATION_REQUIREMENTS; + +typedef struct _BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS { + BLUETOOTH_DEVICE_INFO deviceInfo; + BLUETOOTH_AUTHENTICATION_METHOD authenticationMethod; + BLUETOOTH_IO_CAPABILITY ioCapability; + BLUETOOTH_AUTHENTICATION_REQUIREMENTS authenticationRequirements; + union{ + ULONG Numeric_Value; + ULONG Passkey; + }; +} BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, *PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS; + +typedef BOOL (CALLBACK *PFN_AUTHENTICATION_CALLBACK_EX)(void *, BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS *); + typedef struct _SDP_ELEMENT_DATA { SDP_TYPE type; SDP_SPECIFICTYPE specificType; @@ -183,6 +226,7 @@ DWORD WINAPI BluetoothGetRadioInfo(HANDLE, PBLUETOOTH_RADIO_INFO); BOOL WINAPI BluetoothIsConnectable(HANDLE); BOOL WINAPI BluetoothIsDiscoverable(HANDLE); DWORD WINAPI BluetoothRegisterForAuthentication(BLUETOOTH_DEVICE_INFO *, HBLUETOOTH_AUTHENTICATION_REGISTRATION *, PFN_AUTHENTICATION_CALLBACK, void *); +DWORD WINAPI BluetoothRegisterForAuthenticationEx(const BLUETOOTH_DEVICE_INFO *, HBLUETOOTH_AUTHENTICATION_REGISTRATION *, PFN_AUTHENTICATION_CALLBACK_EX, void *); DWORD WINAPI BluetoothRemoveDevice(BLUETOOTH_ADDRESS *); #define BluetoothEnumAttributes BluetoothSdpEnumAttributes BOOL WINAPI BluetoothSdpEnumAttributes(BYTE *, ULONG, PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK, void *);