Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BluetoothRegisterForAuthenticationEx function

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 WINAPI BluetoothRegisterForAuthenticationEx(
  _In_opt_ const BLUETOOTH_DEVICE_INFO                  *pbtdiln,
  _Out_          HBLUETOOTH_AUTHENTICATION_REGISTRATION *phRegHandleOut,
  _In_opt_       PFN_AUTHENTICATION_CALLBACK_EX         pfnCallbackIn,
  _In_opt_       PVOID                                  pvParam
);

Parameters

pbtdiln [in, optional]

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

phRegHandleOut [out]

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

pfnCallbackIn [in, optional]

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

pvParam [in, optional]

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 codeDescription
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

Minimum supported client

Windows Vista, Windows XP with SP2 [desktop apps only]

Minimum supported server

None supported

Header

BluetoothAPIs.h (include Bthsdpdef.h or BluetoothAPIs.h)

Library

Bthprops.lib

DLL

Bthprops.dll

See also

BluetoothRegisterForAuthentication
BluetoothUnregisterAuthentication

 

 

Community Additions

Show: