Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Wireless Networking
Bluetooth
Bluetooth Reference
Bluetooth Functions
 BluetoothRegisterForAuthentication ...
BluetoothRegisterForAuthentication function

Applies to: desktop apps only

The BluetoothRegisterForAuthentication function registers a callback function that is called when a particular Bluetooth device requests authentication.

Note  When developing for Windows Vista SP2 and Windows 7 the use of BluetoothRegisterForAuthenticationEx is recommended.

Syntax

DWORD BluetoothRegisterForAuthentication(
  BLUETOOTH_DEVICE_INFO *pbtdi,
  HBLUETOOTH_AUTHENTICATION_REGISTRATION *phRegHandle,
  PFN_AUTHENTICATION_CALLBACK pfnCallback,
  PVOID pvParam
);

Parameters

pbtdi

Pointer to a BLUETOOTH_DEVICE_INFO structure. The Address member is used for comparison.

phRegHandle

Pointer to a structure in which the registration HANDLE is stored. Call the BluetoothUnregisterAuthentication to close the handle.

pfnCallback

Function to be called when the authentication event occurs. The function should match the prototype described in PFN_AUTHENTICATION_CALLBACK.

pvParam

Optional parameter to be passed through the callback function.

Return value

Returns ERROR_SUCCESS upon successful completion, and a valid registration handle was returned in phRegHandle. Any other return value indicates failure.

Call the GetLastError function to obtain more information about the error. The following table describes a common error:

Return codeDescription
ERROR_OUTOFMEMORY

Out of memory.

 

Requirements

Minimum supported client

Windows Vista, Windows XP with SP2

Minimum supported server

None supported

Header

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

Library

Bthprops.lib

See also

BluetoothAuthenticateDevice
BluetoothAuthenticateMultipleDevices
BluetoothEnableDiscovery
BluetoothEnableIncomingConnections
BluetoothIsConnectable
BluetoothIsDiscoverable
BluetoothRegisterForAuthentication
BluetoothSendAuthenticationResponse
BluetoothUnregisterAuthentication
BLUETOOTH_DEVICE_INFO

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker