TSPI_CONTEXT_GETTPMOBJECT(3)
π Tspi_Context_GetTpmObject β get the TPM object handle π
okay bestie, welcome to the TCG Software Stack Developers Reference β¨ this one lives in section 3 of the library functions manual, and it's literally the first thing you're gonna wanna call. let's go π«Ά
β¨ NAME β¨
Context_GetTpmObject β grab the handle of the TPM object that's chillin' with a context. that's it, that's the whole job π
π¦ 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_GetTpmObject(TSS_HCONTEXT hContext, TSS_HTPM* phTPM);
look at all those includes, she's thorough, she's prepared, she's that girl π
πΈ DESCRIPTION πΈ
so Tspi_Context_GetTpmObject retrieves the TPM object of a context. and here's the tea: for any given context there is only one instance of this object, and it implicitly represents a TPM owner. one context, one TPM object, no drama, no duplicates, periodt π
you normally call this at the very beginning of a program, right after the context is established. it's giving opening credits energy π β first you make the context, then you get the TPM object, then the rest of your life happens.
β οΈ heads up bestie: you must have a context established prior to calling this function. no context, no TPM object, no service. fr fr π
π PARAMETERS π
hContext
the hContext parameter is the handle of the context object β and yes, it's already existing, you can't just make one up out of thin air π
phTPM
the phTPM parameter is a pointer to where the handle of the TPM will be placed. it's an out-param, so she's writing into your memory, you're just holding the door open π
π RETURN CODES π
Tspi_Context_GetTpmObject returns TSS_SUCCESS on success β slay β¨ β otherwise one of these lil gremlins comes back at you:
TSS_E_INVALID_HANDLEβhContextis not a valid handle. she doesn't know her. π«TSS_E_INTERNAL_ERRORβ an internal SW error has been detected. something inside went wrong and honestly same πTSS_E_BAD_PARAMETERβ one or more of the parameters is incorrect. check ur args bestie π§
π CONFORMING TO π
Tspi_Context_GetTpmObject conforms to the Trusted Computing Group Software Specification version 1.1 Golden. certified, iconic, no notes π
π SEE ALSO π
iykyk π¦ go read them, they're the whole friend group.
TSS 1.1 Β· 2004-05-25 β okay that's a wrap bestie, this page has been serving since May 25, 2004 and she's still relevant. stay encrypted, stay iconic, mwah ππ β¨
π¦ where this page comes from
- debian bookworm: libtspi-dev 0.3.15-0.3 Β· BSD-3-Clause
- debian trixie: libtspi-dev 0.3.15-0.4 Β· BSD-3-Clause
- epel 10: trousers-devel 0.3.15-11.el10_0 Β· BSD
- epel 9: trousers-devel 0.3.15-5.el9 Β· BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: trousers 0.3.15
- nixpkgs unstable: netbsd-source 11.0
- nixpkgs unstable: trousers 0.3.15
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libtspi-dev 0.3.15-0.2 Β· BSD-3-Clause
- ubuntu noble: libtspi-dev 0.3.15-0.3build2 Β· BSD-3-Clause
- ubuntu questing: libtspi-dev 0.3.15-0.4
- ubuntu resolute: libtspi-dev 0.3.15-1 Β· BSD-3-Clause
- ubuntu stonking: libtspi-dev 0.3.15-1ubuntu2 Β· BSD-3-Clause
- Copyright (C) 2004 International Business Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms