Tspi_SetAttribUint32(3)

✨ Tspi_SetAttribUint32 ✨

okay bestie, so this is Tspi_SetAttribUint32(3) β€” it lives in the Library Functions Manual and it's part of the TCG Software Stack Developers Reference. no cap, this is the one that lets you poke a lil 32-bit value into an object's attribute slot. let's get into it πŸ’…


🌸 NAME 🌸

Tspi_SetAttribUint32 β€” set a 32bit attribute associated with a given class or object


πŸŽ€ 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_SetAttribUint32(TSS_HOBJECT hObject, TSS_FLAG attribFlag,
                                TSS_FLAG    subFlag, UINT32   ulAttrib);

like yes, that's a LOT of includes, but that's just how this whole header family rolls πŸ™ˆ keep them all, they're not decorative.


πŸ¦‹ DESCRIPTION πŸ¦‹

Tspi_SetAttribUint32 sets a uint32 attribute associated with a given class or object.

the way this works is: you gotta first create an object, and then go find the attributes you wanna set. that order is not optional, it's the whole vibe check. no object = nothing to set, periodt.


πŸ’– PARAMETERS πŸ’–

🌈 hObject

the handle of the object or class whose attributes are being set. and ngl, this is any object handler you've got lying around β€” context, policy, TPM, key, hash, etc. it's giving "equal opportunity attribute setter" πŸ’…

🌈 attribFlag

indicates the specific attribute to be set. this is one half of the "which attribute tho" answer.

🌈 subFlag

also indicates the specific attribute to be set. yes bestie, it takes two flags to name one attribute β€” that's just the house style here πŸŽ€

🌈 ulAttrib

the value that the specified attribute will be set to. this is the actual number you're shipping off. slay.


⭐ RETURN CODES ⭐

Tspi_SetAttribUint32 returns TSS_SUCCESS on success πŸŽ‰ otherwise one of these lil guys comes back at you:

  • TSS_E_INVALID_HANDLE β€” hObject is not a valid handle.
  • TSS_E_INVALID_ATTRIB_FLAG β€” attribFlag is incorrect.
  • TSS_E_INVALID_ATTRIB_SUBFLAG β€” subFlag is incorrect.
  • TSS_E_INVALID_ATTRIB_DATA β€” ulAttrib is incorrect.
  • TSS_E_INTERNAL_ERROR β€” an internal SW error has been detected. 😭 not you, it's them.
  • TSS_E_BAD_PARAMETER β€” one or more parameters is bad.
lowkey if you're seeing more than one of these, check your params first β€” that's usually the main character of the problem 🫢

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_SetAttribUint32 conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic behavior honestly ⭐


🌟 SEE ALSO 🌟


and that's the whole page bestie, you ate πŸ’…βœ¨

this one's from TSS 1.1, dated 2004-05-25 β€” yes it's vintage, yes it still slays πŸŽ€