Compartilhar via


Função BluetoothRegisterForAuthentication (bluetoothapis.h)

A função BluetoothRegisterForAuthentication registra uma função de retorno de chamada que é chamada quando um dispositivo Bluetooth específico solicita autenticação.

Nota Ao desenvolver para Windows Vista SP2 e Windows 7, o uso de BluetoothRegisterForAuthenticationEx é recomendado.
 

Sintaxe

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

Parâmetros

pbtdi

Ponteiro para uma estrutura BLUETOOTH_DEVICE_INFO . O membro Address é usado para comparação.

phRegHandle

Ponteiro para uma estrutura na qual o HANDLE de registro é armazenado. Chame o BluetoothUnregisterAuthentication para fechar o identificador.

pfnCallback

Função a ser chamada quando o evento de autenticação ocorrer. A função deve corresponder ao protótipo descrito em PFN_AUTHENTICATION_CALLBACK.

pvParam

Parâmetro opcional a ser passado pela função de retorno de chamada.

Retornar valor

Retorna ERROR_SUCCESS após a conclusão bem-sucedida e um identificador de registro válido foi retornado em phRegHandle. Qualquer outro valor retornado indica falha.

Chame a função GetLastError para obter mais informações sobre o erro. A tabela a seguir descreve um erro comum:

Código de retorno Descrição
ERROR_OUTOFMEMORY
Sem memória.

Requisitos

Requisito Valor
Cliente mínimo com suporte Windows Vista, Windows XP com SP2 [somente aplicativos da área de trabalho]
Servidor mínimo com suporte Nenhum compatível
Plataforma de Destino Windows
Cabeçalho bluetoothapis.h (inclua Bthsdpdef.h, BluetoothAPIs.h)
Biblioteca Bthprops.lib
DLL bthprops.cpl

Confira também

BLUETOOTH_DEVICE_INFO

BluetoothAuthenticateDevice

BluetoothAuthenticateMultipleDevices

BluetoothEnableDiscovery

BluetoothEnableIncomingConnections

BluetoothIsConnectable

BluetoothIsDiscoverable

BluetoothRegisterForAuthentication

BluetoothSendAuthenticationResponse

BluetoothUnregisterAuthentication