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 β€” hContext is 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 πŸ’–πŸ’…βœ¨