Tspi_GetPolicyObject(3)

✨ Tspi_GetPolicyObject(3) ✨

okay bestie, welcome to the TCG Software Stack Developers Reference πŸ’– this one's a library function in section 3 of the manual, and it's literally just "hey what policy is on this thing" β€” no cap.


🌸 NAME 🌸

Tspi_GetPolicyObject β€” get a policy object assigned to a working 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_GetPolicyObject(TSS_HOBJECT  hObject, TSS_FLAG policyType,
                                TSS_HPOLICY* phPolicy);

like yes, that's a whole lot of includes, but you need them all, don't @ me 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So Tspi_GetPolicyObject returns a policy object that's currently assigned to a working object. That's it. That's the whole vibe. πŸ’…

And the way that this is actually useful is: if you figure out that the policy is different from what you require, you can swap it out β€” create a new one and hit it with Tspi_Policy_AssignToObject. iconic behavior honestly.

🌈 PARAMETERS 🌈

hObject

The hObject parameter is the handle of the object. main character energy tbh ⭐

policyType

The policyType parameter tells you which policy type you're interested in. The types are TSS_POLICY_USAGE and TSS_POLICY_MIGRATION. pick your fighter πŸ₯Š

phPolicy

The phPolicy parameter receives the handle to the assigned policy object. it's giving "here, hold this" πŸ™ˆ


πŸ’€ RETURN CODES πŸ’€

Tspi_GetPolicyObject returns TSS_SUCCESS on success β€” slay ✨ β€” otherwise one of these lil guys shows up:

  • TSS_E_INVALID_HANDLE β€” hContext is not a valid handle. πŸ’€
  • TSS_E_INTERNAL_ERROR β€” an internal SW error has been detected. an oopsie fr fr 😭
  • TSS_E_BAD_PARAMETER β€” one or more parameters is bad. not the vibe.

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_GetPolicyObject conforms to the Trusted Computing Group Software Specification version 1.1 Golden. periodt.


πŸ”₯ SEE ALSO πŸ”₯


TSS 1.1 Β· 2004-05-25 β€” ok that's a whole vintage date bestie, this page is old enough to have its own license but it still ate πŸ’– mwah, go read the SEE ALSOs, ily, bye πŸŽ€πŸ¦‹βœ¨