BluetoothRegisterForAuthenticationEx function (bluetoothapis.h)

The BluetoothRegisterForAuthenticationEx function registers an application for a pin request, numeric comparison and callback function.

Note  This API is supported in Windows Vista SP2 and Windows 7.
 

Syntax

DWORD BluetoothRegisterForAuthenticationEx(
  [in, optional] const BLUETOOTH_DEVICE_INFO            *pbtdiIn,
  [out]          HBLUETOOTH_AUTHENTICATION_REGISTRATION *phRegHandleOut,
  [in, optional] PFN_AUTHENTICATION_CALLBACK_EX         pfnCallbackIn,
  [in, optional] PVOID                                  pvParam
);

Parameters

[in, optional] pbtdiIn

A pointer to a BLUETOOTH_DEVICE_INFO structure that specifies the bluetooth address to be utilized for comparison.

[out] phRegHandleOut

A pointer to a HBLUETOOTH_AUTHENTICATION_REGISTRATION handle associated with the registered application. Call BluetoothUnregisterAuthentication to close the handle.

[in, optional] pfnCallbackIn

The function that will be called when the authentication event occurs. This function should match the prototype of PFN_AUTHENTICATION_CALLBACK_EX.

[in, optional] pvParam

Optional parameter to be passed through to the callback function specified by pfnCallbackIn. This parameter can be anything the application is required to define.

Return value

Returns ERROR_SUCCESS upon successful completion; returns the following error codes upon failure:

Return code Description
ERROR_OUTOFMEMORY
Out of memory.
Win32 Error
The registration handle that was provided is invalid.

Remarks

The caller must provide a valid callback address and must unregister the callback once notification is no longer required. The deregistration of an authenticated device can be accomplished by calling BluetoothUnregisterAuthentication.

In scenarios where an application registers for authentication more than once, only the first callback function registered via this function will be called in the application while authentication is in progress.

Requirements

Requirement Value
Minimum supported client Windows Vista, Windows XP with SP2 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header bluetoothapis.h (include Bthsdpdef.h, BluetoothAPIs.h)
Library Bthprops.lib
DLL bthprops.cpl

See also

BluetoothRegisterForAuthentication

BluetoothUnregisterAuthentication