---
name: "Tspi_Context_Close"
section: "3"
platform: "linux"
package: "libtspi-dev"
version: "0.3.15-0.4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Tspi_Context_Close"
---

# Tspi\_Context\_Close(3)

destroy a TSP context handle.

## NAME

Tspi\_Context\_Close - destroy a TSP context handle.

## SYNOPSIS

**#include \<tss/platform.h\>** **#include \<tss/tcpa\_defines.h\>** **#include \<tss/tcpa\_typedef.h\>** **#include \<tss/tcpa\_struct.h\>** **#include \<tss/tss\_typedef.h\>** **#include \<tss/tss\_structs.h\>** **#include \<tss/tspi.h\>** **TSS\_RESULT Tspi\_Context\_Close(TSS\_HCONTEXT** *hLocalContext***);**

## DESCRIPTION

**Tspi\_Context\_Close** destroys a context by passing in the handle to that context.

## PARAMETERS

### hLocalContext

The handle to the context to be closed.

## RETURN CODES

**Tspi\_Context\_Close** returns TSS\_SUCCESS on success, otherwise one of the following values are returned: TSS\_E\_INVALID\_HANDLE - *hLocalContext* is an invalid handle. TSS\_E\_INTERNAL\_ERROR - An error occurred internal to the TSS.

## CONFORMING TO

**Tspi\_Context\_Close** conforms to the Trusted Computing Group Software Specification version 1.1 Golden

## SEE ALSO

[**Tspi\_Context\_Create**(3)](/Tspi_Context_Create/3.md), [**Tspi\_Context\_Connect**(3)](/Tspi_Context_Connect/3.md).
