Tss2\_TctiLdr\_GetInfo(3) Library Functions Manual Tss2\_TctiLdr\_GetInfo(3)

# [NAME](#NAME)

Tss2\_TctiLdr\_GetInfo - Query TctiLdr library for the TSS2\_TCTI\_INFO structure associated with a TCTI library.

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;tss2/tss2\_tctildr.h&gt;**

**TSS2\_RC Tss2\_TctiLdr\_GetInfo (constchar \*name", TSS2\_TCTI\_INFO \*\*info);**

# [DESCRIPTION](#DESCRIPTION)

The **Tss2\_TctiLdr\_GetInfo**() function attempts to instantiate a TSS2\_TCTI\_INFO structure appropriate for the TCTI library associated with the provided *name.* The TSS2\_TCTI\_INFO* reference returned by this function must be freed by the *Tss2\_TctiLdr\_FreeInfo ()* function.

The *name* parameter is a C string. If this string is **NULL** then the library will select a default TCTI for the caller. This is the same TCTI library that will be used to initialize the context returned by **Tss2\_TctiLdr\_Initialize** when passed a NULL *name.* If non-NULL, the **Tss2\_TctiLdr\_GetInfo ()** uses the same algorithm to map the string to the name of an installed TCTI library as the **Tss2\_TctiLdr\_Initialize ()** function.

The *info* parameter is a reference to a *TSS2\_TCTI\_INFO\*.* The reference returned will be allocated by the function and must be freed by the caller.

# [RETURN VALUE](#RETURN_VALUE)

A successful call to this function will return TSS2\_RC\_SUCCESS. An unsuccessful call to this function will return a response code described below in section **ERRORS.**

# [ERRORS](#ERRORS)

**TSS2\_TCTI\_RC\_MEMORY** is returned if memory allocation fails

**TSS2\_TCTI\_RC\_NOT\_SUPPORTED** is returned when the loader is unable to locate a TCTI library with the provided *name*

**TSS2\_TCTI\_RC\_IO\_ERROR** is returned if a failure occurs in the underlying library loading mechanism

**TSS2\_TCTI\_RC\_BAD\_REFERENCE** is returned if the *info* parameter is NULL

# [EXAMPLE](#EXAMPLE)

Example code.

```
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <tss2/tss2_tctildr.h>
TSS2_TCTI_INFO *info = NULL;
TSS2_RC rc = Tss2_TctiLdr_GetInfo (NULL, &info);
if (rc != TSS2_RC_SUCCESS) {


    fprintf (stderr, "Initialization of default TCTI context failed with "


             "response code: 0x%" PRIx32 "0, rc);


    exit (EXIT_FAILURE);
}
if (info != NULL) {


    Tss2_TctiLdr_FreeInfo (info);


    info = NULL;
}
exit (EXIT_SUCCESS);
```

# [AUTHOR](#AUTHOR)

TPM2 Software Project &lt;https://github.com/tpm2-software/tpm2-tss&gt;

# [SEE ALSO](#SEE_ALSO)

[**Tss2\_Tcti\_Device\_Init**(3)](/man/os/tpm2-tss/Tss2_Tcti_Device_Init.3), [**Tss2\_Tcti\_Socket\_Init**(3)](/man/os/tpm2-tss/Tss2_Tcti_Socket_Init.3), [**Tss2\_TctiLdr\_Initialize**(3)](/man/os/tpm2-tss/Tss2_TctiLdr_Initialize.3), [**Tss2\_TctiLdr\_Finalize**(3)](/man/os/tpm2-tss/Tss2_TctiLdr_Finalize.3), [**tcti-device**(7)](/man/os/tpm2-tss/tcti-device.7), [**tcti-socket**(7)](/man/os/tpm2-tss/tcti-socket.7), [**tcti-tabrmd**(7)](/man/os/tpm2-tss/tcti-tabrmd.7), [**tpm2-abrmd**(8)](/man/os/tpm2-tss/tpm2-abrmd.8)

# [COLOPHON](#COLOPHON)

This page is part of release 4.2.0 of Open Source implementation of the TCG TPM2 Software Stack (TSS2). A description of the project, information about reporting bugs, and the latest version of this page can be found at https://github.com/tpm2-software/tpm2-tss/.

# [LICENSE](#LICENSE)

This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). For more information visit https://creativecommons.org/licenses/by/4.0/

JUNE 2019 TPM2 Software Stack

---

Document: Tss2_TctiLdr_GetInfo(3) from tpm2-tss 4.2.0-r3 (Chainguard OS)
Source: https://github.com/tpm2-software/tpm2-tss
