Share via


BthSetSecurityUI (Compact 2013)

3/26/2014

This function establishes an application as the security UI handler.

Syntax

int BthSetSecurityUI(
  HANDLE hEvent,
  DWORD dwStoreTimeout,
  DWORD dwProcTimeout
);

Parameters

  • hEvent
    [in] The event handle. The event must be kept open. The application may resign as the security UI handler by passing NULL.
  • dwStoreTimeout
    [in] A period of time in msec. After hEvent is signaled, if the application does not call BthGetPINRequest before this time elapses, the stack refuses or cancels the connection. Valid values are from 1,000 through 600,000 msec.
  • dwProcTimeout
    [in] A period of time in msec. After calling BthGetPINRequest, if the application does not call BthRefusePINRequest or BthSetPIN before this time elapses, the stack refuses or cancels the connection. Valid values are from 1,000 through 600,000 msec.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_ALREADY_ASSIGNED

The event has already been set by another application.

ERROR_INVALID_PARAMETER

Time is either too short (<1,000 msec) or too long (>600 sec).

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

This function is intended for use by the shell to provide a Bluetooth PIN input dialog box that is displayed when the authentication mechanism requires a PIN. The application designated as the security handler provides an event that the stack signals when it requires a PIN.

Only one application at a time can establish itself as the security UI handler. Until the application resigns as security UI handler by calling this function with the hEvent parameter set to NULL, all attempts by other processes to establish themselves as security UI handler fail.

The security UI handler may call this function with different hEvent, hwStoreTimeout, and dwProcTimeout parameters as many times as necessary.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Security Management Functions
Bluetooth AG Service Functions