Fonction BluetoothRegisterForAuthenticationEx (bluetoothapis.h)
La fonction BluetoothRegisterForAuthenticationEx inscrit une application pour une demande d’épingle, une comparaison numérique et une fonction de rappel.
Syntaxe
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
);
Paramètres
[in, optional] pbtdiIn
Pointeur vers une structure de BLUETOOTH_DEVICE_INFO qui spécifie l’adresse Bluetooth à utiliser pour la comparaison.
[out] phRegHandleOut
Pointeur vers un handle HBLUETOOTH_AUTHENTICATION_REGISTRATION associé à l’application inscrite. Appelez BluetoothUnregisterAuthentication pour fermer le handle.
[in, optional] pfnCallbackIn
Fonction qui sera appelée lorsque l’événement d’authentification se produit. Cette fonction doit correspondre au prototype de PFN_AUTHENTICATION_CALLBACK_EX.
[in, optional] pvParam
Paramètre facultatif à passer à la fonction de rappel spécifiée par pfnCallbackIn. Ce paramètre peut être tout ce que l’application doit définir.
Valeur retournée
Retourne ERROR_SUCCESS en cas de réussite de l’exécution ; retourne les codes d’erreur suivants en cas d’échec :
Code de retour | Description |
---|---|
|
Mémoire insuffisante. |
|
Le handle d’inscription fourni n’est pas valide. |
Remarques
L’appelant doit fournir une adresse de rappel valide et annuler l’inscription du rappel une fois que la notification n’est plus nécessaire. La désinscription d’un appareil authentifié peut être effectuée en appelant BluetoothUnregisterAuthentication.
Dans les scénarios où une application s’inscrit à l’authentification plusieurs fois, seule la première fonction de rappel inscrite via cette fonction est appelée dans l’application pendant que l’authentification est en cours.
Configuration requise
Condition requise | Valeur |
---|---|
Client minimal pris en charge | Windows Vista, Windows XP avec SP2 [applications de bureau uniquement] |
Serveur minimal pris en charge | Aucun pris en charge |
Plateforme cible | Windows |
En-tête | bluetoothapis.h (inclure Bthsdpdef.h, BluetoothAPIs.h) |
Bibliothèque | Bthprops.lib |
DLL | bthprops.cpl |