Tbsi_Context_Create function (tbs.h)
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
[in] pContextParams
A parameter to a TBS_CONTEXT_PARAMS structure that contains the parameters associated with the context.
[out] phContext
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/value | Description |
---|---|
|
The function was successful. |
|
One or more parameter values are not valid. |
|
An internal software error occurred. |
|
A context parameter that is not valid was passed when attempting to create a TBS context. |
|
A specified output pointer is not valid. |
|
The TBS service has been disabled. |
|
The TBS service is not running and could not be started. |
|
The TBS service has been started but is not yet running. |
|
A new context could not be created because there are too many open contexts. |
|
A compatible Trusted Platform Module (TPM) Security Device cannot be found on this computer. |
Remarks
The 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
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | tbs.h |
Library | Tbs.lib |
DLL | Tbs.dll |