Tbsi_Context_Create function

Creates a context handle that can be used to pass commands to TBS.

Syntax


TBS_RESULT Tbsi_Context_Create(
  _In_  PCTBS_CONTEXT_PARAMS pContextParams,
  _Out_ PTBS_HCONTEXT        *phContext
);

Parameters

pContextParams [in]

A parameter to a TBS_CONTEXT_PARAMS structure that contains the parameters associated with the context.

phContext [out]

A pointer to a location to store the new context handle.

Return value

If the function succeeds, the function returns TBS_SUCCESS.

If the function fails, it returns a TBS return code that indicates the error.

Return code/valueDescription
TBS_SUCCESS
0 (0x0)

The function was successful.

TBS_E_BAD_PARAMETER
2150121474 (0x80284002)

One or more parameter values are not valid.

TBS_E_INTERNAL_ERROR
2150121473 (0x80284001)

An internal software error occurred.

TBS_E_INVALID_CONTEXT_PARAM
2150121479 (0x80284007)

A context parameter that is not valid was passed when attempting to create a TBS context.

TBS_E_INVALID_OUTPUT_POINTER
2150121475 (0x80284003)

A specified output pointer is not valid.

TBS_E_SERVICE_DISABLED
2150121488 (0x80284010)

The TBS service has been disabled.

TBS_E_SERVICE_NOT_RUNNING
2150121480 (0x80284008)

The TBS service is not running and could not be started.

TBS_E_SERVICE_START_PENDING
2150121483 (0x8028400B)

The TBS service has been started but is not yet running.

TBS_E_TOO_MANY_TBS_CONTEXTS
2150121481 (0x80284009)

A new context could not be created because there are too many open contexts.

TBS_E_TPM_NOT_FOUND
2150121487 (0x8028400F)

A compatible Trusted Platform Module (TPM) Security Device cannot be found on this computer.

 

Remarks

The pContextParams parameter allows the caller to specify which TPM version (TPM1.2 or TPM2.0) it is designed for. For applications interacting with version 1.2 TPM only, a pointer to a TBS_CONTEXT_PARAMS structure can be provided, with the version field set to TPM_VERSION_12. Applications interacting with version 2.0 TPM will pass a pointer to a TBS_CONTEXT_PARAMS2 structure, with the version field set to TPM_VERSION_20. Set the reserved field to 0, and the includeTPm20 field to 1. If the application is prepared to interact with a version 1.2 TPM as well (in case the system has no version 2.0 TPM), set the includeTpm12 field to 1.

If no TPM is present on the system, or the TPM version does not match those requested by the caller, Tbsi_Context_Create will return the TBS_E_TPM_NOT_FOUND (0x8028400) error code. Application programs must check for both versions and be able to interact with either TPM.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Tbs.h

Library

Tbs.lib

DLL

Tbs.dll

 

 

Show: