The BluetoothSetServiceState function enables or disables services for a Bluetooth device.
DWORD BluetoothSetServiceState( HANDLE hRadio, const BLUETOOTH_DEVICE_INFO *pbtdi, const GUID *pGuidService, DWORD dwServiceFlags );
A handle of the local Bluetooth radio.
A pointer to a BLUETOOTH_DEVICE_INFO structure. Must be a previously found radio address.
A pointer to the service GUID on the remote device.
The flags that adjust the service. To disable the service, set to BLUETOOTH_SERVICE_DISABLE; to enable the service, set to BLUETOOTH_SERVICE_ENABLE.
Returns ERROR_SUCCESS upon successful completion. The following table lists common errors.
||The dwServiceFlags are not valid.|
||The GUID specified in pGuidService is not supported.|
||dwServiceFlags is set to BLUETOOTH_SERVICE_DISABLE and the service is already disabled, or dwServiceFlags is set to BLUETOOTH_SERVICE_ENABLE and the service is already enabled.|
Windows maintains a mapping of service Globally Unique Identifiers (GUIDs) to supported drivers for Bluetooth-enabled devices. Enabling a service installs the corresponding device driver and disabling a service removes the corresponding device driver. If a non-supported service is enabled, a driver is not installed.
|Minimum supported client||Windows Vista, Windows XP with SP2 [desktop apps only]|
|Minimum supported server||None supported|
|Header||bluetoothapis.h (include Bthsdpdef.h, BluetoothAPIs.h)|