Compartir a través de


Función BluetoothRegisterForAuthentication (bluetoothapis.h)

La función BluetoothRegisterForAuthentication registra una función de devolución de llamada a la que se llama cuando un dispositivo Bluetooth determinado solicita autenticación.

Nota Al desarrollar para Windows Vista SP2 y Windows 7, se recomienda el uso de BluetoothRegisterForAuthenticationEx .
 

Sintaxis

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

Parámetros

pbtdi

Puntero a una estructura de BLUETOOTH_DEVICE_INFO . El miembro Address se usa para la comparación.

phRegHandle

Puntero a una estructura en la que se almacena el identificador de registro. Llame a BluetoothUnregisterAuthentication para cerrar el identificador.

pfnCallback

Función a la que se llamará cuando se produce el evento de autenticación. La función debe coincidir con el prototipo descrito en PFN_AUTHENTICATION_CALLBACK.

pvParam

Parámetro opcional que se va a pasar a través de la función de devolución de llamada.

Valor devuelto

Devuelve ERROR_SUCCESS tras la finalización correcta y se devolvió un identificador de registro válido en phRegHandle. Cualquier otro valor devuelto indica un error.

Llame a la función GetLastError para obtener más información sobre el error. En la tabla siguiente se describe un error común:

Código devuelto Descripción
ERROR_OUTOFMEMORY
Memoria insuficiente

Requisitos

Requisito Value
Cliente mínimo compatible Windows Vista, Windows XP con SP2 [solo aplicaciones de escritorio]
Servidor mínimo compatible No se admite ninguno
Plataforma de destino Windows
Encabezado bluetoothapis.h (incluye Bthsdpdef.h, BluetoothAPIs.h)
Library Bthprops.lib
Archivo DLL bthprops.cpl

Consulte también

BLUETOOTH_DEVICE_INFO

BluetoothAuthenticateDevice

BluetoothAuthenticateMultipleDevices

BluetoothEnableDiscovery

BluetoothEnableIncomingConnections

BluetoothIsConnectable

BluetoothIsDiscoverable

BluetoothRegisterForAuthentication

BluetoothSendAuthenticationResponse

BluetoothUnregisterAuthentication